test(web): add middleware + i18n + messages test suites (GOO-60)

Cover frontend middleware auth/locale logic, i18n config/routing/request/navigation,
and vi/en message parity — 91 new tests across 6 files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ho Ngoc Hai
2026-04-23 10:47:30 +07:00
parent 7a854373b3
commit 0924f0cb9b
15 changed files with 1356 additions and 61 deletions

View File

@@ -64,8 +64,24 @@ jobs:
- name: Typecheck
run: pnpm typecheck
- name: Test
run: pnpm test
- name: Test with coverage
run: pnpm test:coverage
- name: Upload API coverage report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: coverage-api
path: apps/api/coverage/
retention-days: 14
- name: Upload Web coverage report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: coverage-web
path: apps/web/coverage/
retention-days: 14
- name: Build
run: pnpm build
@@ -145,6 +161,29 @@ jobs:
print("OpenAPI paths OK:", sorted(paths.keys()))
PY
- name: Setup Node.js for contract drift check
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install pnpm for contract drift check
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install JS deps for contract drift check
working-directory: .
run: pnpm install --frozen-lockfile
- name: AI sidecar OpenAPI contract drift check
env:
AI_CORS_ORIGINS: http://localhost:3000
# Tell the drift script which Python interpreter to use; libs/ai-services
# has no .venv in CI, so we rely on the system python where deps are installed.
PYTHON: python
working-directory: .
run: node libs/ai-contract/scripts/check-drift.mjs
e2e:
name: E2E Tests
needs: ci