mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 22:46:32 +00:00
feat(roadtrip): add daily scheduling and configurable day endings
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
assignmentCreateRequestSchema,
|
||||
assignmentEndDayRequestSchema,
|
||||
assignmentMoveRequestSchema,
|
||||
assignmentParticipantsRequestSchema,
|
||||
assignmentTransportRequestSchema,
|
||||
@@ -7,6 +8,14 @@ import {
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
it('requires a boolean for an explicit day end', () => {
|
||||
expect(assignmentEndDayRequestSchema.parse({ end_day: true })).toEqual({ end_day: true });
|
||||
expect(assignmentEndDayRequestSchema.parse({ end_day: false })).toEqual({ end_day: false });
|
||||
for (const end_day of [1, 'true', null, undefined]) {
|
||||
expect(assignmentEndDayRequestSchema.safeParse({ end_day }).success).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
describe('assignmentCreateRequestSchema', () => {
|
||||
it('requires a place_id; notes optional/nullable', () => {
|
||||
expect(assignmentCreateRequestSchema.safeParse({ place_id: 2 }).success).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user