test: lock bumping tenancy and auth email/MFA routes - #82
Draft
cursor[bot] wants to merge 3 commits into
Draft
Conversation
College bumping had no HTTP-layer coverage, and the recent SMTP diagnostic flatten only changed production routes. Guard cross-union reads, write-role gates, and operator email/MFA contracts so those regressions fail in unit tests instead of on a live host. Co-authored-by: Ryan Morris <ryan@ryanmorris.ca>
Main already failed these two @smoke cases. Add the missing EN Hub sync panel label (FR had it; dashboard threw MISSING_MESSAGE), point the DFR playbook smoke at the module-15 callout, and give Graphic Maker the same 90s export budget as the other canvas PNG smokes. Co-authored-by: Ryan Morris <ryan@ryanmorris.ca>
The case-insensitive Duty of Fair Representation locator also matched the Canada Labour Code bibliography row. Assert the module-15 callout by its exact accessible name so the playbook smoke stays unique. Co-authored-by: Ryan Morris <ryan@ryanmorris.ca>
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
Daily coverage pass after the 2026-09-07 SMTP diagnostic flatten and a scan of Hub routes that still had no HTTP-layer tests. Adds deterministic unit coverage for college bumping tenancy/write gates, public auth email/reset contracts, and MFA enroll/verify so those regressions fail in CI instead of on a live host.
Risky behavior now covered
platform_adminwith no write; notes/decisions/sessions require fields and ignore forged author IDs; seniority ranking stays advisory, local-scoped, and excludes inactive + other-local rows.smtpHost/smtpPort/smtpFrom/smtpAuthConfigured/smtpJsonas strings in audit metadata and never includeSMTP_PASS; email-status snapshot has no password; reset-password GET 404/pending and POST consumes a token once.mfaVerifiedboolean); TOTP-without-secret returnsneedsEnrollment.Test files added/updated
src/lib/bumping/api-routes.test.ts(new)src/lib/bumping/memory-adapter.ts(resetBumpingMemoryForTestsonly)src/lib/auth/auth-email-routes.test.ts(new)src/lib/auth/mfa-routes.test.ts(new)Why these tests materially reduce regression risk
Bumping is confidential casework with a large blast radius and had no route tests. The 2026-09-07 SMTP flatten only changed production routes — a nested
smtpobject in audit metadata would 500 durable hosts. MFA verify is the SEC-001 grant boundary; a client-boolean regression would skip the second factor.Did not duplicate open coverage PRs #57 / #68 / #79 / #80 (expense/elections/documents, polls/check-ins/discussions, tasks/snippets, marketplace/grievance QOL).
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)Lint: 0 errors (pre-existing warnings only). Unit: 37 new tests + 91 related tests green. No UI/route behavior change — smoke not required. No production behavior change except a test-only bumping memory reset helper.
Test plan
npx vitest run src/lib/bumping/api-routes.test.ts src/lib/auth/auth-email-routes.test.ts src/lib/auth/mfa-routes.test.ts