16 lines
1.1 KiB
TypeScript
16 lines
1.1 KiB
TypeScript
import { expect, it } from 'vitest'
|
|||
|
|
import { appointmentFormError, appointmentPayload, createAppointmentForm } from './appointmentForm'
|
||
|
|
|
||
|
|
it('allows an undated arrangement without inventing confirmation or loading facts', () => {
|
||
|
|
const form = createAppointmentForm()
|
||
|
|
expect(appointmentFormError(form)).toBeNull()
|
||
|
|
expect(appointmentPayload(form)).toMatchObject({ plannedDate: null, plannedAt: null, appointmentAt: null, confirmationNo: null, appointmentStatus: 'PENDING' })
|
||
|
|
expect(appointmentPayload(form)).not.toHaveProperty('expectedLoadingAt')
|
||
|
|
})
|
||
|
|
it('retains an already confirmed repeated local time using its stored UTC instant', () => {
|
||
|
|
const form = createAppointmentForm({ id: '1', version: 0, appointmentNo: 'AP-1', confirmationNo: 'EXT-1', originWarehouseId: '100', fbaWarehouseCode: 'ONT8', appointmentStatus: 'SUCCESS', selectedCount: 1, items: [], appointmentAt: '2026-11-01T01:30:00', appointmentStartUtc: '2026-11-01T09:30:00Z', timezone: 'America/Los_Angeles' })
|
||
|
|
expect(form.startOffset).toBe('-08:00')
|
||
|
|
expect(appointmentPayload(form).endOffset).toBeNull()
|
||
|
|
expect(appointmentPayload(form).appointmentAt).toBe('2026-11-01T01:30:00')
|
||
|
|
})
|