generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3109 from ilandikov/refactor-test-renderering-des…
…criptions refactor: test renderering descriptions
- Loading branch information
Showing
10 changed files
with
351 additions
and
17 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
resources/sample_vaults/Tasks-Demo/Test Data/inheritance_rendering_sample.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- grandparent list item | ||
- [ ] parent 1 | ||
- [ ] child 1 | ||
- [ ] grandchild 1 | ||
- list item grand grand child | ||
- [ ] child 2 | ||
- non task grandchild | ||
- [ ] grand grand child | ||
- [ ] parent 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
178 changes: 178 additions & 0 deletions
178
tests/Obsidian/__test_data__/inheritance_rendering_sample.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
export const inheritance_rendering_sample = { | ||
filePath: 'Test Data/inheritance_rendering_sample.md', | ||
fileContents: | ||
'- grandparent list item\n' + | ||
' - [ ] parent 1\n' + | ||
' - [ ] child 1\n' + | ||
' - [ ] grandchild 1\n' + | ||
' - list item grand grand child\n' + | ||
' - [ ] child 2\n' + | ||
' - non task grandchild\n' + | ||
' - [ ] grand grand child\n' + | ||
' - [ ] parent 2\n', | ||
cachedMetadata: { | ||
sections: [ | ||
{ | ||
type: 'list', | ||
position: { | ||
start: { | ||
line: 0, | ||
col: 0, | ||
offset: 0, | ||
}, | ||
end: { | ||
line: 8, | ||
col: 18, | ||
offset: 257, | ||
}, | ||
}, | ||
}, | ||
], | ||
listItems: [ | ||
{ | ||
position: { | ||
start: { | ||
line: 0, | ||
col: 0, | ||
offset: 0, | ||
}, | ||
end: { | ||
line: 0, | ||
col: 24, | ||
offset: 24, | ||
}, | ||
}, | ||
parent: -1, | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 1, | ||
col: 3, | ||
offset: 28, | ||
}, | ||
end: { | ||
line: 1, | ||
col: 18, | ||
offset: 43, | ||
}, | ||
}, | ||
parent: 0, | ||
task: ' ', | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 2, | ||
col: 6, | ||
offset: 50, | ||
}, | ||
end: { | ||
line: 2, | ||
col: 21, | ||
offset: 65, | ||
}, | ||
}, | ||
parent: 1, | ||
task: ' ', | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 3, | ||
col: 10, | ||
offset: 76, | ||
}, | ||
end: { | ||
line: 3, | ||
col: 30, | ||
offset: 96, | ||
}, | ||
}, | ||
parent: 2, | ||
task: ' ', | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 4, | ||
col: 14, | ||
offset: 111, | ||
}, | ||
end: { | ||
line: 4, | ||
col: 45, | ||
offset: 142, | ||
}, | ||
}, | ||
parent: 3, | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 5, | ||
col: 6, | ||
offset: 149, | ||
}, | ||
end: { | ||
line: 5, | ||
col: 21, | ||
offset: 164, | ||
}, | ||
}, | ||
parent: 1, | ||
task: ' ', | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 6, | ||
col: 10, | ||
offset: 175, | ||
}, | ||
end: { | ||
line: 6, | ||
col: 33, | ||
offset: 198, | ||
}, | ||
}, | ||
parent: 5, | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 7, | ||
col: 14, | ||
offset: 213, | ||
}, | ||
end: { | ||
line: 7, | ||
col: 39, | ||
offset: 238, | ||
}, | ||
}, | ||
parent: 6, | ||
task: ' ', | ||
}, | ||
{ | ||
position: { | ||
start: { | ||
line: 8, | ||
col: 3, | ||
offset: 242, | ||
}, | ||
end: { | ||
line: 8, | ||
col: 18, | ||
offset: 257, | ||
}, | ||
}, | ||
parent: 0, | ||
task: ' ', | ||
}, | ||
], | ||
}, | ||
obsidianApiVersion: '1.7.3', | ||
getAllTags: [], | ||
parseFrontMatterTags: null, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
...rer/QueryResultsRenderer.test.QueryResultsRenderer_tests_parent-child_items.approved.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<div> | ||
<ul class="contains-task-list plugin-tasks-query-result tasks-layout-hide-urgency"> | ||
<li | ||
class="task-list-item plugin-tasks-list-item" | ||
data-task-priority="normal" | ||
data-task="" | ||
data-line="0" | ||
data-task-status-name="Todo" | ||
data-task-status-type="TODO"> | ||
<input class="task-list-item-checkbox" type="checkbox" title="Right-click for options" data-line="0" /> | ||
<span class="tasks-list-text"> | ||
<span class="task-description"><span>parent 1</span></span> | ||
</span> | ||
<span class="task-extras"> | ||
<span class="tasks-backlink"> | ||
( | ||
<a rel="noopener" target="_blank" class="internal-link">inheritance_rendering_sample</a> | ||
) | ||
</span> | ||
<a class="tasks-edit" title="Edit task" href="#"></a> | ||
</span> | ||
</li> | ||
<li | ||
class="task-list-item plugin-tasks-list-item" | ||
data-task-priority="normal" | ||
data-task="" | ||
data-line="1" | ||
data-task-status-name="Todo" | ||
data-task-status-type="TODO"> | ||
<input class="task-list-item-checkbox" type="checkbox" title="Right-click for options" data-line="1" /> | ||
<span class="tasks-list-text"> | ||
<span class="task-description"><span>child 1</span></span> | ||
</span> | ||
<span class="task-extras"> | ||
<span class="tasks-backlink"> | ||
( | ||
<a rel="noopener" target="_blank" class="internal-link">inheritance_rendering_sample</a> | ||
) | ||
</span> | ||
<a class="tasks-edit" title="Edit task" href="#"></a> | ||
</span> | ||
</li> | ||
<li | ||
class="task-list-item plugin-tasks-list-item" | ||
data-task-priority="normal" | ||
data-task="" | ||
data-line="2" | ||
data-task-status-name="Todo" | ||
data-task-status-type="TODO"> | ||
<input class="task-list-item-checkbox" type="checkbox" title="Right-click for options" data-line="2" /> | ||
<span class="tasks-list-text"> | ||
<span class="task-description"><span>grandchild 1</span></span> | ||
</span> | ||
<span class="task-extras"> | ||
<span class="tasks-backlink"> | ||
( | ||
<a rel="noopener" target="_blank" class="internal-link">inheritance_rendering_sample</a> | ||
) | ||
</span> | ||
<a class="tasks-edit" title="Edit task" href="#"></a> | ||
</span> | ||
</li> | ||
<li | ||
class="task-list-item plugin-tasks-list-item" | ||
data-task-priority="normal" | ||
data-task="" | ||
data-line="3" | ||
data-task-status-name="Todo" | ||
data-task-status-type="TODO"> | ||
<input class="task-list-item-checkbox" type="checkbox" title="Right-click for options" data-line="3" /> | ||
<span class="tasks-list-text"> | ||
<span class="task-description"><span>child 2</span></span> | ||
</span> | ||
<span class="task-extras"> | ||
<span class="tasks-backlink"> | ||
( | ||
<a rel="noopener" target="_blank" class="internal-link">inheritance_rendering_sample</a> | ||
) | ||
</span> | ||
<a class="tasks-edit" title="Edit task" href="#"></a> | ||
</span> | ||
</li> | ||
<li | ||
class="task-list-item plugin-tasks-list-item" | ||
data-task-priority="normal" | ||
data-task="" | ||
data-line="4" | ||
data-task-status-name="Todo" | ||
data-task-status-type="TODO"> | ||
<input class="task-list-item-checkbox" type="checkbox" title="Right-click for options" data-line="4" /> | ||
<span class="tasks-list-text"> | ||
<span class="task-description"><span>grand grand child</span></span> | ||
</span> | ||
<span class="task-extras"> | ||
<span class="tasks-backlink"> | ||
( | ||
<a rel="noopener" target="_blank" class="internal-link">inheritance_rendering_sample</a> | ||
) | ||
</span> | ||
<a class="tasks-edit" title="Edit task" href="#"></a> | ||
</span> | ||
</li> | ||
<li | ||
class="task-list-item plugin-tasks-list-item" | ||
data-task-priority="normal" | ||
data-task="" | ||
data-line="5" | ||
data-task-status-name="Todo" | ||
data-task-status-type="TODO"> | ||
<input class="task-list-item-checkbox" type="checkbox" title="Right-click for options" data-line="5" /> | ||
<span class="tasks-list-text"> | ||
<span class="task-description"><span>parent 2</span></span> | ||
</span> | ||
<span class="task-extras"> | ||
<span class="tasks-backlink"> | ||
( | ||
<a rel="noopener" target="_blank" class="internal-link">inheritance_rendering_sample</a> | ||
) | ||
</span> | ||
<a class="tasks-edit" title="Edit task" href="#"></a> | ||
</span> | ||
</li> | ||
</ul> | ||
<div class="task-count">6 tasks</div> | ||
</div> |
Oops, something went wrong.