Files
TREK/client/tests/helpers/msw/handlers/tours.ts
T
Maurice 204ee2ef86 chore(ci): give the server test typecheck room, format new client files
The server's src and tests together are past 570,000 lines and the test
typecheck needs about 4.3 GB, over Node's default heap; it now gets 8 GB like
the test jobs. Forty new client files are formatted, and the react-hooks/refs
baseline drops by the one warning a split hook removed.
2026-10-20 18:39:58 +02:00

39 lines
1.2 KiB
TypeScript

import {
tourPackingLinkResponseSchema,
tourSourceHintResponseSchema,
tourVisitListResponseSchema,
wandererWatchSchema,
} from '@trek/shared';
import { contractHandler } from '../contract';
export const toursHandlers = [
// CW-03: a trip opened with Tours on reads the visits of its city walks; none is checked off unless a test says so.
contractHandler('get', '/api/trips/:id/tour-visits', { response: tourVisitListResponseSchema }, () => ({
visits: [],
})),
// P2D-XD-01: a tour's detail reads its packing link; a tour points at none unless a test says so.
contractHandler(
'get',
'/api/trips/:id/tours/:placeId/packing-link',
{ response: tourPackingLinkResponseSchema },
() => ({
packing_link: null,
})
),
// WAN-02: the wanderer watch is off and leaves no hint on a tour unless a test says so.
contractHandler('get', '/api/integrations/wanderer/watch', { response: wandererWatchSchema }, () => ({
enabled: false,
connected: false,
lastRunAt: null,
pausedUntil: null,
blocked: false,
hints: [],
})),
contractHandler(
'get',
'/api/trips/:id/tours/wanderer/sources/:placeId/hint',
{ response: tourSourceHintResponseSchema },
() => ({ hint: null })
),
];