Files
TREK/server/tests/unit/db/tour-paddle-columns.test.ts
T
Maurice 9494521ac7 feat(tours): plan paddle tours, hand-drawn legs, reverse and return to start, maps per tour type
- Paddle as a plannable tour type: one boat (kayak, canoe, SUP, other), river or
  lake, a pace that a boat change never overwrites; time is distance over pace
- Hand-drawn legs beside routed ones, drawn dotted and labelled as not routed,
  kept through save, reopen and edits elsewhere
- Reverse a tour and close it back to its start, each one undo step
- GPX import shows a preview first (line, measures, duplicates, type) and only
  the confirmation stores the tour
- Base maps and overlays per tour type in the planner: hike keeps topo and the
  via ferrata layer, paddle gets the OpenSeaMap seamark overlay
2026-10-16 23:14:52 +02:00

21 lines
911 B
TypeScript

import { ToursBoatType, ToursWaterContext } from '../../../src/db/entities/Tours.entity';
import { paddleBoatTypeSchema, paddleWaterContextSchema } from '@trek/shared';
import { describe, expect, it } from 'vitest';
/**
* The boat and water columns hold a CHECK list (migration 043900) that the
* entity carries as its enum, and the contract holds its own list. A value
* one side knows and the other refuses would be a tour the planner can save
* and the database cannot store, or the other way round.
*/
describe('paddle columns match the contract', () => {
it('knows the same boats as the paddle contract', () => {
expect(Object.values(ToursBoatType).sort()).toEqual([...paddleBoatTypeSchema.options].sort());
});
it('knows the same waters as the paddle contract', () => {
expect(Object.values(ToursWaterContext).sort()).toEqual([...paddleWaterContextSchema.options].sort());
});
});