/** * Shared test fixtures — small ad hoc API response shapes that aren't a * named type in `src/types/` (they're inline return-type object literals in * `src/services/api.ts`). Derived via `Awaited>` * instead of redeclaring the shape, so a change to the real signature fails * the fixture at compile time rather than drifting silently. */ import type { addPartner } from '@/services/api' import type { Invitation, PreschoolPlanningDays } from '@/types' /** Shared by `addPartner` and `updateParentSettings` — both return the same * `{ uuid, name, salary_type, employment_status }` wire shape. */ export type PartnerMemberResponse = Awaited> export function makePartnerMemberResponse( overrides: Partial = {}, ): PartnerMemberResponse { return { uuid: 'pd-b', name: 'Partner', salary_type: 'monthly', employment_status: 'employed', ...overrides, } } export function makePreschoolPlanningDays( overrides: Partial = {}, ): PreschoolPlanningDays { return { id: 'ppd-1', childId: 'child-1', year: 2025, plannedDays: 5, takenDays: null, isDefault: false, createdAt: '2025-01-01T00:00:00Z', updatedAt: '2025-01-01T00:00:00Z', ...overrides, } } export function makeInvitation(overrides: Partial = {}): Invitation { return { id: 'inv-1', workspaceId: 'ws-1', status: 'pending', expiresAt: '2025-01-08T00:00:00Z', createdAt: '2025-01-01T00:00:00Z', ...overrides, } }