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:
parent
3f444d7725
commit
706f91d234
1 changed files with 1 additions and 1 deletions
|
|
@ -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\)/);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue