refactor(test): drop double-cast on Person fixtures
Drops the `as unknown as Person` double-cast in makePerson and on AUGUSTE/ANNA in favor of plain return-typed object literals; this restores the type-system safety net Felix flagged on PR #629 — a future required field on Person now fails compilation in the fixture instead of silently slipping through. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -26,17 +26,21 @@ const AUGUSTE: Person = {
|
||||
firstName: 'Auguste',
|
||||
lastName: 'Raddatz',
|
||||
displayName: 'Auguste Raddatz',
|
||||
personType: 'PERSON',
|
||||
familyMember: false,
|
||||
birthYear: 1882,
|
||||
deathYear: 1944
|
||||
} as unknown as Person;
|
||||
};
|
||||
|
||||
const ANNA: Person = {
|
||||
id: 'p-anna',
|
||||
firstName: 'Anna',
|
||||
lastName: 'Schmidt',
|
||||
displayName: 'Anna Schmidt',
|
||||
personType: 'PERSON',
|
||||
familyMember: false,
|
||||
birthYear: 1860
|
||||
} as unknown as Person;
|
||||
};
|
||||
|
||||
function mockFetchWithPersons(persons: Person[] = [AUGUSTE, ANNA]) {
|
||||
vi.stubGlobal(
|
||||
|
||||
Reference in New Issue
Block a user