Fixing a unit test in performSpeedyReservation
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful

This commit is contained in:
collin 2026-07-25 09:26:14 +02:00
parent c5978a8289
commit 63114e7736

View file

@ -61,13 +61,16 @@ describe('baanreserveren.service', () => {
describe('performSpeedyReservation', () => { describe('performSpeedyReservation', () => {
it.each([ it.each([
[18, 15, CourtSlot.Six, CourtSlot.Seven], [18, 15, CourtSlot.Seven, CourtSlot.Six],
[18, 30, CourtSlot.One, CourtSlot.Four], [18, 30, CourtSlot.One, CourtSlot.Four],
[18, 45, CourtSlot.Twelve, CourtSlot.Thirteen], [18, 45, CourtSlot.Twelve, CourtSlot.Thirteen],
])( ])(
'should try highest ranked court first', 'should try highest ranked court first',
async (startHour, startMinute, preferredCourt, backupCourt) => { async (startHour, startMinute, preferredCourt, backupCourt) => {
const start = dayjs() const start = dayjs()
.set('year', 2026)
.set('month', 7)
.set('date', 27)
.set('hour', startHour) .set('hour', startHour)
.set('minute', startMinute) .set('minute', startMinute)
.set('second', 0) .set('second', 0)
@ -94,7 +97,7 @@ describe('baanreserveren.service', () => {
) )
it.each([ it.each([
[18, 15, CourtSlot.Six, CourtSlot.Seven], [18, 15, CourtSlot.Seven, CourtSlot.Eight],
[18, 30, CourtSlot.One, CourtSlot.Four], [18, 30, CourtSlot.One, CourtSlot.Four],
[18, 45, CourtSlot.Twelve, CourtSlot.Thirteen], [18, 45, CourtSlot.Twelve, CourtSlot.Thirteen],
])( ])(
@ -112,6 +115,9 @@ describe('baanreserveren.service', () => {
return Promise.resolve({ status: () => 200 }) return Promise.resolve({ status: () => 200 })
}) })
const start = dayjs() const start = dayjs()
.set('year', 2026)
.set('month', 7)
.set('date', 27)
.set('hour', startHour) .set('hour', startHour)
.set('minute', startMinute) .set('minute', startMinute)
.set('second', 0) .set('second', 0)