From d4eb34057cd4a3cd7fa8766bd1d495f7311dcf6b Mon Sep 17 00:00:00 2001 From: Collin Duncan <3679940+cgduncan7@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:16:46 +0200 Subject: [PATCH] Changing priorities of courts --- src/runner/baanreserveren/service.ts | 4 ++-- test/unit/baanreserveren/service.spec.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runner/baanreserveren/service.ts b/src/runner/baanreserveren/service.ts index bae48bb..3a6e45c 100644 --- a/src/runner/baanreserveren/service.ts +++ b/src/runner/baanreserveren/service.ts @@ -68,8 +68,8 @@ const CourtSlotToNumber: Record = { // Lower is better const CourtRank: Record = { [CourtSlot.One]: 2, - [CourtSlot.Two]: 1, - [CourtSlot.Three]: 0, + [CourtSlot.Two]: 0, + [CourtSlot.Three]: 1, // team at squash city has this pre-booked at 19.15 on Tuesday :sad: [CourtSlot.Four]: 0, [CourtSlot.Five]: 99, // shitty [CourtSlot.Six]: 99, // shitty diff --git a/test/unit/baanreserveren/service.spec.ts b/test/unit/baanreserveren/service.spec.ts index 7d90da6..fc1f12f 100644 --- a/test/unit/baanreserveren/service.spec.ts +++ b/test/unit/baanreserveren/service.spec.ts @@ -57,7 +57,7 @@ describe('baanreserveren.service', () => { describe('performSpeedyReservation', () => { it.each([ [18, 15, CourtSlot.Seven, CourtSlot.Six], - [18, 30, CourtSlot.Three, CourtSlot.One], + [18, 30, CourtSlot.Two, CourtSlot.Four], [18, 45, CourtSlot.Twelve, CourtSlot.Thirteen], ])( 'should try highest ranked court first', @@ -90,7 +90,7 @@ describe('baanreserveren.service', () => { it.each([ [18, 15, CourtSlot.Seven, CourtSlot.Eight], - [18, 30, CourtSlot.Three, CourtSlot.Four], + [18, 30, CourtSlot.Two, CourtSlot.Four], [18, 45, CourtSlot.Twelve, CourtSlot.Thirteen], ])( 'should try backup if first rank is taken',