fix tests issue

This commit is contained in:
root
2026-05-26 18:50:14 -04:00
parent 8b3eb588f2
commit 5ec91230c1
4 changed files with 22 additions and 7 deletions
@@ -228,7 +228,7 @@ describe('checkinReservation', () => {
// ────────────────────────────────────────────────────────────────────────────
describe('checkoutReservation', () => {
it('transitions ACTIVE → COMPLETED and marks vehicle AVAILABLE', async () => {
it('transitions ACTIVE → COMPLETED and marks vehicle RETURNED', async () => {
const res = makeReservation({ status: 'ACTIVE' })
vi.mocked(repo.findByIdForCheckout).mockResolvedValue(res as any)
vi.mocked(repo.updateById).mockResolvedValue({ ...res, status: 'COMPLETED' } as any)
@@ -239,7 +239,7 @@ describe('checkoutReservation', () => {
await checkoutReservation(RES_ID, COMPANY, 58000)
expect(repo.updateById).toHaveBeenCalledWith(RES_ID, expect.objectContaining({ status: 'COMPLETED', checkOutMileage: 58000 }))
expect(repo.updateVehicleStatus).toHaveBeenCalledWith('vehicle-1', 'AVAILABLE', 58000)
expect(repo.updateVehicleStatus).toHaveBeenCalledWith('vehicle-1', 'RETURNED', 58000)
})
it('rejects non-ACTIVE reservation', async () => {