test(client): hold the default MSW handlers to the @trek/shared contracts

contractHandler() parses the request body against the shared request schema,
answering 400 like the server's Zod pipe on a body it would refuse, and the
mock's answer against the response schema, failing on a factory that drifted.
The trips, budget, places, todo, tags and categories, day notes, packing,
reservations and assignments handlers and the vacay plan and colour updates use
it wherever shared has a schema; the offline bundle and the other vacay routes
have none yet and stay plain.
The typed bodies showed where the old handlers echoed request shapes back as
stored rows: payers and members are no longer echoed into a budget item, and
checked and is_private come back as 0/1 the way the server stores them.
This commit is contained in:
Maurice
2026-10-10 12:18:00 +02:00
parent da280f0d2f
commit 5fcb307270
13 changed files with 588 additions and 217 deletions
-10
View File
@@ -1878,23 +1878,13 @@
"tests/helpers/mobileAdmin.ts",
"tests/helpers/mobileTrip.ts",
"tests/helpers/msw/handlers/admin.ts",
"tests/helpers/msw/handlers/assignments.ts",
"tests/helpers/msw/handlers/auth.ts",
"tests/helpers/msw/handlers/budget.ts",
"tests/helpers/msw/handlers/dayNotes.ts",
"tests/helpers/msw/handlers/index.ts",
"tests/helpers/msw/handlers/notifications.ts",
"tests/helpers/msw/handlers/packing.ts",
"tests/helpers/msw/handlers/places.ts",
"tests/helpers/msw/handlers/reservations.ts",
"tests/helpers/msw/handlers/shared.ts",
"tests/helpers/msw/handlers/tags.ts",
"tests/helpers/msw/handlers/todo.ts",
"tests/helpers/msw/handlers/trips.ts",
"tests/helpers/multipart.ts",
"tests/helpers/render.tsx",
"tests/helpers/roadtripRail.ts",
"tests/helpers/store.ts",
"tests/integration/api/client.test.ts",
"tests/integration/api/websocket.test.ts",
"tests/integration/hooks/useDayNotes.test.ts",