test: cover Officer Learning progress and proposal draft edges - #25
Draft
cursor[bot] wants to merge 1 commit into
Draft
test: cover Officer Learning progress and proposal draft edges#25cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Recent quiz navigation and Hub sync QOL changed production paths with little unit coverage. Lock the device progress state machine, tenancy/sync guards, and on-device proposal draft validation so those regressions fail in CI instead of on the floor. Co-authored-by: Ryan Morris <ryan@ryanmorris.ca>
6 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.
Summary
Adds unit coverage for recent Officer Learning quiz/progress QOL and the still-untested Proposal Tracker draft validator. Production code is unchanged.
Risky behavior now covered
hubSyncEnabledis already on; Me/local-settings Zod schemas still reject tenant identity keys andshareWithLocalwithout sync.localIdcollides.Test files added/updated
src/lib/officer-learning/progress.test.ts,modules.test.ts,hub-sync-client.test.ts,src/lib/proposal-tracker/draft.test.ts,src/lib/validation/officer-learning.test.tsquiz-scroll.test.ts,hub-store.test.ts,related-resources.test.ts,parse-module.test.ts,src/lib/rules-of-order/actions.test.tsWhy this reduces regression risk
These are shared utilities and core flows (progress persistence, tenancy, request validation) that the 2026-08-28 quiz navigation and Hub-sync work depended on without unit tests. Failures here lose steward progress or leak another union’s completions — not cosmetic chrome.
Checklist
.env, keys, or real member/PII datamessages/en.jsonandmessages/fr.json(if applicable)unionIdscoping; no cross-union access)npm run lintandnpm run test:unitpassnpm run test:smoke)Test plan
npm run test:unit -- src/lib/officer-learning/progress.test.ts src/lib/officer-learning/modules.test.ts src/lib/officer-learning/quiz-scroll.test.ts src/lib/officer-learning/hub-sync-client.test.ts src/lib/officer-learning/hub-store.test.ts src/lib/officer-learning/related-resources.test.ts src/lib/officer-learning/parse-module.test.ts src/lib/proposal-tracker/draft.test.ts src/lib/validation/officer-learning.test.ts src/lib/rules-of-order/actions.test.ts