Files
TREK/server/tests/unit/db/tour-station-columns.test.ts
T
Maurice 4c594876ef feat(tours): plan a city walk with its stops, stays, importance and protection (CW-01, CW-02, CW-10)
City walk is a type of the planner: routed on foot without a hiking limit, on
the standard map. Each stop is edited in its own dialog, its name, its stay
(empty is not known, 0 a point passed through), its importance and whether a
proposed change must leave it; none of it plans the route again. The walk's
time is walking plus the stays, at least that much while a stay is unknown,
with no breaks on top.
2026-10-20 07:09:56 +00:00

22 lines
996 B
TypeScript

import { TourStationVisitsStatus } from '../../../src/db/entities/TourStationVisits.entity';
import { TourWaypointsImportance } from '../../../src/db/entities/TourWaypoints.entity';
import { STATION_IMPORTANCES, TOUR_VISIT_STATUSES } from '@trek/shared';
import { describe, expect, it } from 'vitest';
/**
* CW-03: a station's importance and a visit's status are CHECK lists
* (migration 045300) the entities carry as enums, and the contract holds its
* own. A value one side knows and the other refuses would be a station the
* planner can save and the database cannot store.
*/
describe('city walk columns match the contract', () => {
it('knows the same importances as the station contract', () => {
expect(Object.values(TourWaypointsImportance).sort()).toEqual([...STATION_IMPORTANCES].sort());
});
it('knows the same visit statuses as the visit contract', () => {
expect(Object.values(TourStationVisitsStatus).sort()).toEqual([...TOUR_VISIT_STATUSES].sort());
});
});