Replace the shared MOCK_* fixtures with factories

A frozen shared constant forces a test needing one different field to
either mutate shared state, leaking into every other test, or spread it
by hand. The make*(overrides) factories cover both cases and were already
doing the same job, so the constants were redundant.

MOCK_PARENT_A and MOCK_PARENT_B were distinct identities that partner
tests tell apart, so their uuid and name are now passed explicitly at
each call site rather than left to a factory default -- the values those
tests depend on stay visible where they are used.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXMhc9nT6sNz1SL4j8dznL
This commit is contained in:
2026-09-15 07:47:34 +02:00
parent 46e89a4359
commit 5d9ac5024a
3 changed files with 14 additions and 22 deletions
-11
View File
@@ -36,8 +36,6 @@ export function makeWorkspace(overrides: Partial<Workspace> = {}): Workspace {
}
}
export const MOCK_WORKSPACE: Workspace = makeWorkspace()
// ---------------------------------------------------------------------------
// Personal data (parents)
// ---------------------------------------------------------------------------
@@ -54,9 +52,6 @@ export function makePersonalData(overrides: Partial<PersonalData> = {}): Persona
}
}
export const MOCK_PARENT_A: PersonalData = makePersonalData({ uuid: 'pd-a', name: 'Förälder A' })
export const MOCK_PARENT_B: PersonalData = makePersonalData({ uuid: 'pd-b', name: 'Förälder B' })
// ---------------------------------------------------------------------------
// Child
// ---------------------------------------------------------------------------
@@ -74,8 +69,6 @@ export function makeChild(overrides: Partial<Child> = {}): Child {
}
}
export const MOCK_CHILD: Child = makeChild()
// ---------------------------------------------------------------------------
// Vacation days
// ---------------------------------------------------------------------------
@@ -94,8 +87,6 @@ export function makeVacationDays(overrides: Partial<VacationDays> = {}): Vacatio
}
}
export const MOCK_VACATION_DAYS: VacationDays = makeVacationDays()
// ---------------------------------------------------------------------------
// Parental leave fetch (+ tier data)
// ---------------------------------------------------------------------------
@@ -134,8 +125,6 @@ export function makeParentalLeaveFetch(overrides: Partial<ParentalLeaveFetch> =
}
}
export const MOCK_PARENTAL_LEAVE: ParentalLeaveFetch = makeParentalLeaveFetch()
// ---------------------------------------------------------------------------
// Leave wishes
// ---------------------------------------------------------------------------