Repository navigation
test(frontend): cover gamification reward deduplication and replay guards - #2203
Merged
Merged
Conversation
…ards Adds 21 deterministic tests for useGamificationStore pinning down what stops a reward being paid or shown twice: - level-up celebration fires once per level: not replayed after dismiss or re-check, one pending reward, multi-threshold jumps, exact-threshold and max-level boundaries, level never lowers - XP: credited per call (callers own idempotency); recentXPGain id behaviour that GlobalXPGain de-duplicates on, including the same-millisecond case - achievements: retried unlocks never add entries, unknown ids are ignored, progress updates never re-stamp an unlocked achievement - persistence: reload keeps XP/level without replaying the modal or XP animation, repeated rehydration never re-credits XP, reset is persisted The new file is added to the scoped frontend regression step in ci.yml so it runs in CI. Closes LabsCrypt#2138
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2138
Adds 21 deterministic tests for useGamificationStore pinning down what stops a reward being paid or shown twice.
Covered:
The new file is added to the scoped frontend regression step in ci.yml, so it runs in CI.
Scope note: the store itself has no XP de-duplication. addXP credits every call, and dedup exists only as the guards above plus the id check in GlobalXPGain. These tests document that contract. No production code is changed here. Findings while writing them, as possible follow-ups:
Verification: CI's exact scoped command passes, 93 tests; prettier clean; no new tsc errors.
Note: submitted after the Oct 22 due date; please let me know if it can still count.