test(stammbaum): fix two CI-only browser-test failures (#692)
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m18s
CI / OCR Service Tests (pull_request) Successful in 22s
CI / Backend Unit Tests (pull_request) Successful in 3m36s
CI / fail2ban Regex (pull_request) Successful in 45s
CI / Semgrep Security Scan (pull_request) Successful in 22s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m4s

- page.svelte.test.ts mocked $app/navigation with only replaceState, dropping
  invalidateAll (imported by StammbaumSidePanel) → the module errored and failed
  all 7 tests in the file. Mock now exports invalidateAll + goto too.
- StammbaumTree viewBox 'offsets origin' test hard-coded a wrong unpanned-x; assert
  the robust relationship instead (viewBox centre − content centroid == pan).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-29 20:42:50 +02:00
parent 95d35c20b2
commit ecae789be2
2 changed files with 11 additions and 5 deletions

View File

@@ -17,7 +17,11 @@ vi.mock('$app/state', () => ({
const replaceState = vi.fn();
vi.mock('$app/navigation', () => ({
replaceState: (...args: unknown[]) => replaceState(...args)
replaceState: (...args: unknown[]) => replaceState(...args),
// StammbaumSidePanel (rendered transitively) imports invalidateAll/goto, so
// the mock must provide every export the module graph uses.
invalidateAll: vi.fn(),
goto: vi.fn()
}));
afterEach(cleanup);