test(phase22): add auth redirect safety and i18n route parity checks

This commit is contained in:
2026-03-25 12:15:06 +00:00
parent 10f221af38
commit 70d2ee175d
4 changed files with 280 additions and 0 deletions
+44
View File
@@ -2681,3 +2681,47 @@ Validation:
Follow-ups:
- Closure for this condensed stream complete; any further work should be a separate expansion stream (e.g., additional service-level phase22 coverage breadth).
---
### CL-075: TASK22260 sequence-A step3 completion slice — auth redirect safety + EN/CY route parity automation
date: 2026-03-25
author: Cline
scope: `tests/phase22/{auth-redirect-safety,i18n-route-parity,index}.test.cjs`
type: change
rationale: Continue on this branch to complete the remaining sequence-A step3 gaps by adding explicit automated checks for auth callback/redirect safety and EN/CY route parity.
impact: Improves confidence in auth redirect safety behavior and bilingual rewrite parity with targeted, low-risk regression checks and no runtime code changes.
status: completed
Summary:
- Added `tests/phase22/auth-redirect-safety.test.cjs`:
- validates locale resolution precedence (`query -> body -> cookie -> default en`)
- validates redirect callback behavior for:
- relative URL to same base
- same-origin absolute URL passthrough
- external URL rewritten to locale-safe base origin with preserved path/query
- Added `tests/phase22/i18n-route-parity.test.cjs`:
- asserts presence of required CY rewrite aliases for auth/policy routes in `next.config.js`
- includes checks for signin/email/error/verify-request + privacy/accessibility/terms routes
- Updated `tests/phase22/index.test.cjs` to include both new suites in aggregate phase22 execution.
Validation:
- `node tests/phase22/auth-redirect-safety.test.cjs` -> pass (4/4)
- `node tests/phase22/i18n-route-parity.test.cjs` -> pass (1/1)
- `node tests/phase22/index.test.cjs` -> pass
- core-token: 2/2
- client-utils: 6/6
- file-client: 4/4
- case-service: 4/4
- portal-service: 4/4
- auth-redirect: 4/4
- i18n-route: 1/1
- phase22 combined: pass
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
Follow-ups:
- Sequence A step3 targeted gaps are now covered; further test expansion should be treated as new scope (e.g., deeper end-to-end journey assertions).