Repository navigation
test(web): add contribution editor coverage - #26
Conversation
|
Implementation note for Trello card https://trello.com/c/IwdCoxpw: This PR adds the first real web test harness and contribution editor coverage called out from the PR #20 review gap. Covered cases:
Verified locally:
|
|
Vercel preview is ready: https://hivelore-68akx8x8i-kareemn1936s-projects.vercel.app Commit: 2f8da59 |
mcfarhat
left a comment
There was a problem hiding this comment.
Approving. This is the card I raised on 24 Aug when we agreed not to block your PR #20 over missing tests — good that you picked it up unprompted.
The harness is properly wired
Vitest + jsdom + Testing Library in apps/web, a test script, and root npm test --workspaces --if-present picks it up. I checked the thing that actually matters for a test-infrastructure PR — that it runs in CI, not just locally — by reading the real log from the Quality job on this head:
> vitest run
RUN v4.1.11 /home/runner/work/hivelore/hivelore/apps/web
Test Files 2 passed (2)
So the suite is genuinely gated, not a script nobody invokes.
The tests have power
Coverage claims are worthless unless the tests fail when the behaviour breaks, so I mutated the component and re-ran:
| mutation | result |
|---|---|
| save path never retries on 401 (always rethrow) | fails |
| retry reuses the stale token instead of the rotated one | fails |
| 403 permission preflight treated as allowed | fails |
That third one is the nice case — it proves the preflight test asserts on the editor actually being hidden, not just on a call count. And the token-rotation mutation is the one most test suites miss: plenty of tests would assert "retried twice" and pass even if the retry re-sent the expired token.
Nothing blocking. Merging.
Summary
Trello
Verification