Files
TREK/server/tests/unit/db/tour-source-hint-columns.test.ts
T
Maurice 4d81180fc1 test(tours): bring the server tests in line with the tours board
Expectations follow createAssignment's options, the stage_ends column, the editor's trip access and the broadcasts of the take-over. Refusals in the run and ski e2e tests go one by one so supertest does not reset a connection under another request. A parity test keeps the source hint enums in step with the contract.
2026-10-20 17:51:27 +02:00

21 lines
1016 B
TypeScript

import { TourSourceHintsReason, TourSourceHintsState } from '../../../src/db/entities/TourSourceHints.entity';
import { tourSourceHintReasonSchema, tourSourceHintStateSchema } from '@trek/shared';
import { describe, expect, it } from 'vitest';
/**
* WAN-02: a hint's state and reason are CHECK lists (migration 046120) the
* entity carries as enums, and the contract holds its own. A value one side
* knows and the other refuses would be a hint the watch can find and the
* database cannot store, or one stored that the answer cannot describe.
*/
describe('wanderer source hint columns match the contract', () => {
it('TOURHINTCOL-001: knows the same states as the hint contract', () => {
expect(Object.values(TourSourceHintsState).sort()).toEqual([...tourSourceHintStateSchema.options].sort());
});
it('TOURHINTCOL-002: knows the same reasons as the hint contract', () => {
expect(Object.values(TourSourceHintsReason).sort()).toEqual([...tourSourceHintReasonSchema.options].sort());
});
});