From 82ff8383599db2e900311aab499aa07e13d5ad6a Mon Sep 17 00:00:00 2001 From: Collin Duncan <3679940+cgduncan7@users.noreply.github.com> Date: Wed, 2 Apr 2025 14:21:05 +0200 Subject: [PATCH] Correcting tests regarding court prioritization --- test/unit/baanreserveren/service.spec.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/unit/baanreserveren/service.spec.ts b/test/unit/baanreserveren/service.spec.ts index 0219c24..d7d5a64 100644 --- a/test/unit/baanreserveren/service.spec.ts +++ b/test/unit/baanreserveren/service.spec.ts @@ -21,6 +21,7 @@ describe('baanreserveren.service', () => { beforeAll(async () => { pageGotoSpy = jest .fn() + .mockClear() .mockImplementation(() => Promise.resolve({ status: () => 200 })) module = await Test.createTestingModule({ providers: [ @@ -54,10 +55,12 @@ describe('baanreserveren.service', () => { brService = module.get(BaanReserverenService) }) + beforeEach(() => pageGotoSpy.mockClear()) + describe('performSpeedyReservation', () => { it.each([ - [18, 15, CourtSlot.Seven, CourtSlot.Six], - [18, 30, CourtSlot.Four, CourtSlot.Two], + [18, 15, CourtSlot.Six, CourtSlot.Seven], + [18, 30, CourtSlot.One, CourtSlot.Four], [18, 45, CourtSlot.Twelve, CourtSlot.Thirteen], ])( 'should try highest ranked court first', @@ -89,8 +92,8 @@ describe('baanreserveren.service', () => { ) it.each([ - [18, 15, CourtSlot.Seven, CourtSlot.Eight], - [18, 30, CourtSlot.Four, CourtSlot.Two], + [18, 15, CourtSlot.Six, CourtSlot.Seven], + [18, 30, CourtSlot.One, CourtSlot.Four], [18, 45, CourtSlot.Twelve, CourtSlot.Thirteen], ])( 'should try backup if first rank is taken',