@@ -61,7 +61,8 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
6161 line : 3 ,
6262 completed : true ,
6363 status : "x" ,
64- originalMarkdown : "- [x] Task with onCompletion 🏁 archive:done.md" ,
64+ originalMarkdown :
65+ "- [x] Task with onCompletion 🏁 archive:done.md" ,
6566 metadata : {
6667 tags : [ ] ,
6768 children : [ ] ,
@@ -86,7 +87,8 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
8687 . mockReturnValueOnce ( { path : "Archive/Completed Tasks.md" } ) ; // Archive file
8788
8889 // Mock file contents
89- const sourceContent = "# Tasks\n\n- [ ] Other task\n- [x] Task with onCompletion 🏁 archive:done.md\n- [ ] Another task" ;
90+ const sourceContent =
91+ "# Tasks\n\n- [ ] Other task\n- [x] Task with onCompletion 🏁 archive:done.md\n- [ ] Another task" ;
9092 const archiveContent = "# Archive\n\n## Completed Tasks\n\n" ;
9193
9294 mockVault . read
@@ -98,17 +100,23 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
98100 const result = await executor . execute ( mockContext , archiveConfig ) ;
99101
100102 expect ( result . success ) . toBe ( true ) ;
101- expect ( result . message ) . toContain ( "Task archived to Archive/Completed Tasks.md" ) ;
103+ expect ( result . message ) . toContain (
104+ "Task archived to Archive/Completed Tasks.md"
105+ ) ;
102106
103107 // Verify source file was updated (task removed)
104108 const sourceModifyCall = mockVault . modify . mock . calls [ 0 ] ;
105109 const updatedSourceContent = sourceModifyCall [ 1 ] ;
106- expect ( updatedSourceContent ) . toBe ( "# Tasks\n\n- [ ] Other task\n- [ ] Another task" ) ;
110+ expect ( updatedSourceContent ) . toBe (
111+ "# Tasks\n\n- [ ] Other task\n- [ ] Another task"
112+ ) ;
107113
108114 // Verify archive file was updated (task added without onCompletion metadata)
109115 const archiveModifyCall = mockVault . modify . mock . calls [ 1 ] ;
110116 const updatedArchiveContent = archiveModifyCall [ 1 ] ;
111- expect ( updatedArchiveContent ) . toContain ( "- [x] Task with onCompletion - Completed" ) ;
117+ expect ( updatedArchiveContent ) . toContain (
118+ "- [x] Task with onCompletion ✅ 2025-07-04 (from source.md)"
119+ ) ;
112120 expect ( updatedArchiveContent ) . not . toContain ( "🏁" ) ;
113121 expect ( updatedArchiveContent ) . not . toContain ( "archive:done.md" ) ;
114122 expect ( updatedArchiveContent ) . toMatch ( / \d { 4 } - \d { 2 } - \d { 2 } / ) ; // Date pattern
@@ -147,7 +155,8 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
147155 . mockReturnValueOnce ( { path : "Archive/Completed Tasks.md" } ) ; // Archive file
148156
149157 // Mock file contents
150- const sourceContent = "# Tasks\n- [ ] Incomplete task to archive 🏁 archive\n- [ ] Other task" ;
158+ const sourceContent =
159+ "# Tasks\n- [ ] Incomplete task to archive 🏁 archive\n- [ ] Other task" ;
151160 const archiveContent = "# Archive\n\n## Completed Tasks\n\n" ;
152161
153162 mockVault . read
@@ -163,7 +172,9 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
163172 // Verify archive file contains completed task without onCompletion metadata
164173 const archiveModifyCall = mockVault . modify . mock . calls [ 1 ] ;
165174 const updatedArchiveContent = archiveModifyCall [ 1 ] ;
166- expect ( updatedArchiveContent ) . toContain ( "- [x] Incomplete task to archive - Completed" ) ;
175+ expect ( updatedArchiveContent ) . toContain (
176+ "- [x] Incomplete task to archive ✅ 2025-07-04 (from source.md)"
177+ ) ;
167178 expect ( updatedArchiveContent ) . not . toContain ( "- [ ]" ) ; // Should not contain incomplete checkbox
168179 expect ( updatedArchiveContent ) . not . toContain ( "🏁" ) ;
169180 } ) ;
@@ -176,7 +187,8 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
176187 line : 0 ,
177188 completed : true ,
178189 status : "x" ,
179- originalMarkdown : "- [x] Task with dataview onCompletion [onCompletion:: archive:done.md]" ,
190+ originalMarkdown :
191+ "- [x] Task with dataview onCompletion [onCompletion:: archive:done.md]" ,
180192 metadata : {
181193 tags : [ ] ,
182194 children : [ ] ,
@@ -201,7 +213,8 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
201213 . mockReturnValueOnce ( { path : "Archive/Completed Tasks.md" } ) ; // Archive file
202214
203215 // Mock file contents
204- const sourceContent = "- [x] Task with dataview onCompletion [onCompletion:: archive:done.md]" ;
216+ const sourceContent =
217+ "- [x] Task with dataview onCompletion [onCompletion:: archive:done.md]" ;
205218 const archiveContent = "# Archive\n\n## Completed Tasks\n\n" ;
206219
207220 mockVault . read
@@ -217,7 +230,9 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
217230 // Verify archive file contains task without dataview onCompletion metadata
218231 const archiveModifyCall = mockVault . modify . mock . calls [ 1 ] ;
219232 const updatedArchiveContent = archiveModifyCall [ 1 ] ;
220- expect ( updatedArchiveContent ) . toContain ( "- [x] Task with dataview onCompletion - Completed" ) ;
233+ expect ( updatedArchiveContent ) . toContain (
234+ "- [x] Task with dataview onCompletion ✅ 2025-07-04 (from source.md)"
235+ ) ;
221236 expect ( updatedArchiveContent ) . not . toContain ( "[onCompletion::" ) ;
222237 expect ( updatedArchiveContent ) . not . toContain ( "archive:done.md" ) ;
223238 } ) ;
@@ -230,11 +245,13 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
230245 line : 0 ,
231246 completed : true ,
232247 status : "x" ,
233- originalMarkdown : '- [x] Task with JSON onCompletion 🏁 {"type": "archive", "archiveFile": "custom.md"}' ,
248+ originalMarkdown :
249+ '- [x] Task with JSON onCompletion 🏁 {"type": "archive", "archiveFile": "custom.md"}' ,
234250 metadata : {
235251 tags : [ ] ,
236252 children : [ ] ,
237- onCompletion : '{"type": "archive", "archiveFile": "custom.md"}' ,
253+ onCompletion :
254+ '{"type": "archive", "archiveFile": "custom.md"}' ,
238255 } ,
239256 } ;
240257
@@ -255,7 +272,8 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
255272 . mockReturnValueOnce ( { path : "Archive/Completed Tasks.md" } ) ; // Archive file
256273
257274 // Mock file contents
258- const sourceContent = '- [x] Task with JSON onCompletion 🏁 {"type": "archive", "archiveFile": "custom.md"}' ;
275+ const sourceContent =
276+ '- [x] Task with JSON onCompletion 🏁 {"type": "archive", "archiveFile": "custom.md"}' ;
259277 const archiveContent = "# Archive\n\n## Completed Tasks\n\n" ;
260278
261279 mockVault . read
@@ -271,7 +289,9 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
271289 // Verify archive file contains task without JSON onCompletion metadata
272290 const archiveModifyCall = mockVault . modify . mock . calls [ 1 ] ;
273291 const updatedArchiveContent = archiveModifyCall [ 1 ] ;
274- expect ( updatedArchiveContent ) . toContain ( "- [x] Task with JSON onCompletion - Completed" ) ;
292+ expect ( updatedArchiveContent ) . toContain (
293+ "- [x] Task with JSON onCompletion ✅ 2025-07-04 (from source.md)"
294+ ) ;
275295 expect ( updatedArchiveContent ) . not . toContain ( "🏁" ) ;
276296 expect ( updatedArchiveContent ) . not . toContain ( '{"type": "archive"' ) ;
277297 } ) ;
@@ -312,4 +332,4 @@ describe("ArchiveActionExecutor - Markdown Tasks", () => {
312332 expect ( result . error ) . toContain ( "Source file not found: missing.md" ) ;
313333 } ) ;
314334 } ) ;
315- } ) ;
335+ } ) ;
0 commit comments