Skip to content

Commit b271a03

Browse files
committed
test: - QueryResultsRenderer.test.ts now includes markdown in approved files
For consistency with similar TaskLineRenderer approved files.
1 parent 5dbf7e8 commit b271a03

7 files changed

+48
-1
lines changed

tests/Renderer/QueryResultsRenderer.test.QueryResultsRenderer_tests_fully_populated_task.approved.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
- [ ] Do exercises #todo #health 🆔 abcdef ⛔ 123456,abc123 🔼 🔁 every day when done 🏁 delete ➕ 2023-07-01 🛫 2023-07-02 ⏳ 2023-07-03 📅 2023-07-04 ❌ 2023-07-06 ✅ 2023-07-05 ^dcf64c
3+
-->
4+
15
<div>
26
<ul class="contains-task-list plugin-tasks-query-result">
37
<li

tests/Renderer/QueryResultsRenderer.test.QueryResultsRenderer_tests_fully_populated_task_-_short_mode.approved.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
- [ ] Do exercises #todo #health 🆔 abcdef ⛔ 123456,abc123 🔼 🔁 every day when done 🏁 delete ➕ 2023-07-01 🛫 2023-07-02 ⏳ 2023-07-03 📅 2023-07-04 ❌ 2023-07-06 ✅ 2023-07-05 ^dcf64c
3+
-->
4+
15
<div>
26
<ul class="contains-task-list plugin-tasks-query-result tasks-layout-short-mode">
37
<li

tests/Renderer/QueryResultsRenderer.test.QueryResultsRenderer_tests_parent-child_items.approved.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!--
2+
- [ ] parent 1
3+
- [ ] child 1
4+
- [ ] grandchild 1
5+
- [ ] child 2
6+
- [ ] grand grand child
7+
- [ ] parent 2
8+
-->
9+
110
<div>
211
<ul class="contains-task-list plugin-tasks-query-result tasks-layout-hide-urgency">
312
<li

tests/Renderer/QueryResultsRenderer.test.QueryResultsRenderer_tests_parent-child_items_hidden.approved.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!--
2+
- [ ] parent 1
3+
- [ ] child 1
4+
- [ ] grandchild 1
5+
- [ ] child 2
6+
- [ ] grand grand child
7+
- [ ] parent 2
8+
-->
9+
110
<div>
211
<ul class="contains-task-list plugin-tasks-query-result tasks-layout-hide-urgency">
312
<li

tests/Renderer/QueryResultsRenderer.test.QueryResultsRenderer_tests_parent-child_items_reverse_sorted.approved.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!--
2+
- [ ] parent 2
3+
- [ ] grand grand child
4+
- [ ] child 2
5+
- [ ] grandchild 1
6+
- [ ] child 1
7+
- [ ] parent 1
8+
-->
9+
110
<div>
211
<ul class="contains-task-list plugin-tasks-query-result tasks-layout-hide-urgency">
312
<li

tests/Renderer/QueryResultsRenderer.test.QueryResultsRenderer_tests_should_render_tasks_without_their_parents.approved.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
- [ ] parent task
3+
- [ ] grandchild task 1
4+
- [ ] grandchild task 2
5+
- [ ] grandchild task 3
6+
-->
7+
18
<div>
29
<ul class="contains-task-list plugin-tasks-query-result tasks-layout-hide-urgency">
310
<li

tests/Renderer/QueryResultsRenderer.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { readTasksFromSimulatedFile } from '../Obsidian/SimulatedFile';
1212
import { verifyWithFileExtension } from '../TestingTools/ApprovalTestHelpers';
1313
import { prettifyHTML } from '../TestingTools/HTMLHelpers';
1414
import { TaskBuilder } from '../TestingTools/TaskBuilder';
15+
import { toMarkdown } from '../TestingTools/TestHelpers';
1516
import { mockHTMLRenderer } from './RenderingTestHelpers';
1617

1718
window.moment = moment;
@@ -46,8 +47,12 @@ describe('QueryResultsRenderer tests', () => {
4647

4748
await renderer.render(State.Warm, allTasks, container, queryRendererParameters);
4849

50+
const taskAsMarkdown = `<!--
51+
${toMarkdown(allTasks)}
52+
-->\n\n`;
53+
4954
const prettyHTML = prettifyHTML(container.outerHTML);
50-
verifyWithFileExtension(prettyHTML, 'html');
55+
verifyWithFileExtension(taskAsMarkdown + prettyHTML, 'html');
5156
}
5257

5358
it('fully populated task', async () => {

0 commit comments

Comments
 (0)