WIP: test(mocks): migrate vi.mock factories to __mocks__ + test-fixtures (#560) #657
Closed
marcel
wants to merge 2 commits from
feat/issue-560-vimock-migration into main
pull from: feat/issue-560-vimock-migration
merge into: marcel:main
marcel:main
marcel:feat/issue-753-journey-editor
marcel:feat/issue-750-lesereisen-data-model
marcel:worktree-feat+issue-738-nl-search-backend
marcel:feat/issue-286-notification-bell-form-actions
marcel:feat/issue-580-sentry-backend
marcel:fix/issue-593-management-port-zero
marcel:worktree-feat+issue-557-upload-artifact-v3-pin
marcel:worktree-chore+issue-556-drop-client-branches-coverage-gate
marcel:fix/issue-514-prerender-crawl-bakes-redirects
marcel:fix/issue-472-prerender-entries
marcel:feat/issue-395-readme
marcel:feat/issue-345-bulk-mark-reviewed
marcel:feat/issue-344-bell-tooltip
marcel:feat/issue-341-annotieren-contrast
marcel:feat/issue-225-bulk-metadata-edit
marcel:feat/issue-317-bulk-upload
marcel:feat/issue-271-dashboard-redesign
marcel:docs/issue-240-mission-control-spec
marcel:refactor/issues-193-200
marcel:feat/issue-162-korrespondenz-redesign
marcel:feature/68-new-document-file-first
marcel:feat/81-discussion-discoverability
marcel:feat/62-document-bottom-panel
marcel:feature/56-backfill-file-hashes
marcel:feat/38-document-edit-history
marcel:fix/svelte5-test-delegation-and-login-auth
2 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9fcd0553bd |
test(mocks): switch $app/navigation factory mocks to shared __mocks__ stub
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 2m51s
CI / OCR Service Tests (pull_request) Successful in 21s
CI / Backend Unit Tests (pull_request) Successful in 3m43s
CI / fail2ban Regex (pull_request) Failing after 42s
CI / Semgrep Security Scan (pull_request) Successful in 20s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m1s
Migrates 36 of the remaining 37 vi.mock('$app/navigation', factory) call
sites in frontend/src/**/*.svelte.{spec,test}.ts to
vi.mock('$app/navigation') (no factory), so they all resolve to the
shared src/__mocks__/$app/navigation.ts stub introduced in commit
|
||
|
|
aea37250f4 |
test(mocks): wire DocumentRow spec to shared __mocks__/$app/navigation
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m33s
CI / OCR Service Tests (pull_request) Successful in 20s
CI / Backend Unit Tests (pull_request) Successful in 3m35s
CI / fail2ban Regex (pull_request) Successful in 43s
CI / Semgrep Security Scan (pull_request) Successful in 20s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m0s
Smallest possible first step of issue #560. Adds a shared __mocks__/$app/navigation.ts exporting every nav function as vi.fn(), and switches one consumer (DocumentRow.svelte.spec.ts) from a per-spec factory to vi.mock('\$app/navigation') (no factory) to verify Vitest's __mocks__/ redirect resolves for SvelteKit virtual modules in browser-mode tests. CI is the gate: if the migrated spec passes alongside the 35 unchanged factory call sites, the same redirect pattern is applied across the remaining $app/navigation, $app/state, $app/forms and paraglide factories. Per ADR-012, eliminating factory mocks shrinks the birpc teardown-race surface; this commit is the first concrete cut. Refs #560. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |