Skip to content

test(e2e): stop persisting on the plugin's behalf in anchored paths - #17

Merged
omar-nahhas merged 1 commit into
mainfrom
fix/no-test-side-persist
Aug 3, 2026
Merged

omar-nahhas merged 1 commit into
mainfrom
fix/no-test-side-persist

Conversation

@omar-nahhas

Copy link
Copy Markdown
Contributor

commentOnPhrase() and the edit step called store.persist() from the test — the test performing the very save it was verifying. If the plugin stopped saving on its own, both scenarios would still go green. Same violation already fixed in the add/delete steps.

Why it was there: the store saves fire-and-forget (void this.persist() at chat-comments-store.js L277 add-anchored, L422 editComment), so a reload can outrun the request.

Fix: waitForSave() — wait for the plugin's OWN POST to /plugins/chat_comments/comments with action=save, armed before the click. Keeps determinism, drops the cheat.

bdd-lint: 3/3 gates pass.

commentOnPhrase() and the edit step called store.persist() from the test,
which made the TEST perform the very save it was verifying: if the plugin
stopped saving on its own, both scenarios would still have gone green.
Same violation already fixed in the add/delete steps.

The store saves fire-and-forget (`void this.persist()` at
chat-comments-store.js L277 add-anchored, L422 editComment), so a reload can
outrun the request -- that race is what the test-side persist was papering
over. Replaced with waitForSave(): wait for the plugin's OWN POST to
/plugins/chat_comments/comments with action=save, armed before the click.

Keeps the determinism, drops the cheat. bdd-lint: 3/3 gates pass.
@omar-nahhas
omar-nahhas merged commit 90537e6 into main Aug 3, 2026
2 checks passed
@omar-nahhas
omar-nahhas deleted the fix/no-test-side-persist branch August 3, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant