mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
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.
This commit is contained in:
@@ -386,6 +386,7 @@ describe('ToursRepository writes', () => {
|
||||
ski_technique: null,
|
||||
track_started_at: null,
|
||||
track_ended_at: null,
|
||||
stage_ends: 0,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
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());
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user