Repository navigation
test(platform): close out the auth/2FA/SSO gaps of #2085 with regression cover - #2526
Merged
Merged
Conversation
The /2fa-enroll wall's guard (#2085 [04]) had no regression test: it must bounce an already-enrolled user (honouring redirectTo), keep a not-yet-enrolled user on the wall, and never interrupt an in-progress enrollment after verifyTotp flips twoFactorEnabled. Exports TwoFactorEnrollPage from the route file for the test, mirroring LogInPage. Refs #2085
The forced-change-password route is /forced-change-password/$id, so the
pathname ends with the org id — the gate's original
endsWith('forced-change-password') never matched and kept re-navigating to
the page the user was already on (#2085 [06]). Pins the inclusion match,
the redirect on an expired credential, and the not-expired no-op.
Refs #2085
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
Closes #2085.
All six code fixes enumerated in #2085 already landed on
mainvia #2118 and its follow-ups (6ecb7c7, c1ac556, 4c85d2f, a5ac8ab) — I verified each site against the current code. What was missing to close the issue out safely was regression cover: only [12] and [13] were pinned by tests. This PR adds the missing regression tests (happy path + the guarded edge per item) so none of the fixed behaviours can silently regress, and re-verifies the two already-pinned items.Item map
app/routes/2fa-enroll.tsxalready-enrolled bounce (4c85d2f, scoped by a5ac8ab)app/features/auth/two-factor-enroll-guard.test.tsx(30c10cb): bounce + redirectTo, stays for un-enrolled, never interrupts mid-enrollmentrole="alert"role="status"(c1ac556)two-factor-grace-banner.test.tsx+two-factor-low-backup-codes-banner.test.tsx(affdd08): polite status role, no alert, hide conditionsendsWith('forced-change-password')guarduse-password-expiry-gate.tsinclusion match (c1ac556)use-password-expiry-gate.test.ts(b32cf23): short-circuit on the real/forced-change-password/<id>shape, redirect when expired, no-op otherwiseRoleMappingRulesEditorin the SSO form (4c85d2f)enterprise-sso-form.test.tsx"adds a role-mapping rule and saves it (#2085[12])" — re-run greenscim/internal_mutations.ts(6ecb7c7)scim/provisioning_logic.test.ts(#2085[13]) — re-run greendisableEnforcedWarningin the disable dialog (4c85d2f)two-factor-section.test.tsx(385aafc): warning when enforced, none otherwise, warn-not-blockEach new test was watched fail against the pre-fix code (guard/role/match/warning reverted locally) and pass against the current code. Only production-code change:
TwoFactorEnrollPageis now exported from the route file for the test, mirroringLogInPage.Tests
bunx vitest --run --config vitest.ui.config.tson the five new files +enterprise-sso-form.test.tsx→ 6 files, 31 tests passingbunx vitest --run --project server convex/scim/→ 3 files, 54 tests passingbunx tsc --noEmit(platform) cleanbunx oxlint --type-awareon changed files → 0 warnings, 0 errorsoxfmt --checkclean; opengrep SAST on changed files → 0 findingsNo new user-visible strings (no locale changes needed).