From eb0d3b502f7187e85f009ae810f0a24e9b59a205 Mon Sep 17 00:00:00 2001 From: Nereus Ng Wei Bin Date: Thu, 14 Mar 2024 16:10:43 +0800 Subject: [PATCH] Add test to verify navigation behavior --- tests/services/phase.service.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/services/phase.service.spec.ts b/tests/services/phase.service.spec.ts index 9abe936d0..6611cba3a 100644 --- a/tests/services/phase.service.spec.ts +++ b/tests/services/phase.service.spec.ts @@ -130,7 +130,7 @@ describe('PhaseService', () => { }); describe('changePhase(Phase)', () => { - it('should set current phase', () => { + it('should set current phase and redirect with current phase and repo', () => { phaseService.setRepository(WATCHER_REPO); expect(phaseService.currentPhase).toEqual(Phase.issuesViewer); @@ -138,6 +138,9 @@ describe('PhaseService', () => { phaseService.changePhase(Phase.activityDashboard); expect(phaseService.currentPhase).toEqual(Phase.activityDashboard); + expect(routerSpy.navigate).toHaveBeenCalledWith([Phase.activityDashboard], { + queryParams: { repo: WATCHER_REPO.toString() } + }); }); });