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 <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-11-03 20:42:41 -05:00
commit 706f91d234

View file

@ -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\)/);