From 706f91d234976e2eb2b16828eb620843c09d8233 Mon Sep 17 00:00:00 2001 From: le king fu Date: Tue, 3 Nov 2026 20:42:41 -0500 Subject: [PATCH] test(sync): let the setTagsForTask wipe guard match across lines Review of PR #187: the regex did not allow the line break between .delete(taskTags) and .where(...), so the guard could never fail. Refs #180 Co-Authored-By: Claude Opus 5.5 --- tests/smoke.test.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/smoke.test.cjs b/tests/smoke.test.cjs index 89603c8..39fe31e 100644 --- a/tests/smoke.test.cjs +++ b/tests/smoke.test.cjs @@ -444,7 +444,7 @@ check('tag links: removals written by the app, pull aligned without the outbox ( assert.match(set, /tagLinkDiff\(/, 'setTagsForTask must diff with the local links'); assert.match(set, /for \(const tagId of removed\) \{\s*writeOutboxEntry\('taskTag', taskId, 'delete', \{ tagId \}\)/); assert.match(set, /for \(const tagId of added\) \{\s*writeOutboxEntry\('taskTag', taskId, 'create', \{ tagId \}\)/); - assert.ok(!/db\.delete\(taskTags\)\.where\(eq\(taskTags\.taskId, taskId\)\)/.test(set), 'setTagsForTask must not wipe every link'); + assert.ok(!/db\s*\.delete\(taskTags\)\s*\.where\(eq\(taskTags\.taskId, taskId\)\)/.test(set), 'setTagsForTask must not wipe every link'); assert.match(fnOf(tags, 'addTagToTask'), /writeOutboxEntry\('taskTag', taskId, 'create', \{ tagId \}\)\.then\(requestSync\)/); assert.match(fnOf(tags, 'removeTagFromTask'), /writeOutboxEntry\('taskTag', taskId, 'delete', \{ tagId \}\)\.then\(requestSync\)/);