Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(tours): the reasons a region request waits for are pinned to the contract

Mauricec9e1e8ad86b0
diff --git a/server/tests/unit/db/tour-paddle-columns.test.ts b/server/tests/unit/db/tour-paddle-columns.test.ts
index 0ac733b3c..f439c39ed 100644
--- a/server/tests/unit/db/tour-paddle-columns.test.ts
+++ b/server/tests/unit/db/tour-paddle-columns.test.ts
@@ -1,5 +1,11 @@
+import { PaddleRegionRequestsReason } from '../../../src/db/entities/PaddleRegionRequests.entity';
import { ToursBoatType, ToursPaddleLakeStyle, ToursWaterContext } from '../../../src/db/entities/Tours.entity';
-import { paddleBoatTypeSchema, paddleLakeStyleSchema, paddleWaterContextSchema } from '@trek/shared';
+import {
+ paddleBoatTypeSchema,
+ paddleLakeStyleSchema,
+ paddleRegionWaitReasonSchema,
+ paddleWaterContextSchema,
+} from '@trek/shared';
import { describe, expect, it } from 'vitest';
@@ -8,7 +14,8 @@ import { describe, expect, it } from 'vitest';
* and 044600) 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.
+ * and the database cannot store, or the other way round. A region request's
+ * reason (044700) is held the same way against the planner's answer.
*/
describe('paddle columns match the contract', () => {
it('knows the same boats as the paddle contract', () => {
@@ -22,4 +29,8 @@ describe('paddle columns match the contract', () => {
it('knows the same lake styles as the paddle contract (PAD-11)', () => {
expect(Object.values(ToursPaddleLakeStyle).sort()).toEqual([...paddleLakeStyleSchema.options].sort());
});
+
+ it('knows the same reasons a region request waits for as the region contract (PAD-11C)', () => {
+ expect(Object.values(PaddleRegionRequestsReason).sort()).toEqual([...paddleRegionWaitReasonSchema.options].sort());
+ });
});