From e8d751988a515504d67bb4172c6054f0ef81fb84 Mon Sep 17 00:00:00 2001 From: pratik Date: Mon, 16 Oct 2023 13:53:17 +0530 Subject: [PATCH] peer review fixs for SRS frontend test cases --- .../store/stratification-factors.effects.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/projects/upgrade/src/app/core/stratification-factors/store/stratification-factors.effects.spec.ts b/frontend/projects/upgrade/src/app/core/stratification-factors/store/stratification-factors.effects.spec.ts index 3d3f008681..fdaa0da1b7 100644 --- a/frontend/projects/upgrade/src/app/core/stratification-factors/store/stratification-factors.effects.spec.ts +++ b/frontend/projects/upgrade/src/app/core/stratification-factors/store/stratification-factors.effects.spec.ts @@ -28,11 +28,11 @@ describe('StratificationFactorsEffects', () => { describe('fetchStratificationFactors$', () => { it('should dispatch actionFetchStratificationFactorsSuccess on API call success', fakeAsync(() => { - stratificationFactorsDataService.fetchStratificationFactors = jest.fn().mockReturnValue(of(mockData[0])); - selectAllStratificationFactors.setResult(mockData[0]); + stratificationFactorsDataService.fetchStratificationFactors = jest.fn().mockReturnValue(of([mockData])); + selectAllStratificationFactors.setResult([mockData]); const expectedAction = StratificationFactorsActions.actionFetchStratificationFactorsSuccess({ - stratificationFactors: mockData[0], + stratificationFactors: [mockData], }); service.fetchStratificationFactors$.subscribe((result) => { @@ -71,7 +71,7 @@ describe('StratificationFactorsEffects', () => { const expectedAction = StratificationFactorsActions.actionDeleteStratificationFactorSuccess({ stratificationFactor: { ...mockData }, }); - console.log('expectedAction: ', expectedAction); + service.deleteStratificationFactor$.subscribe((result) => { expect(result).toEqual(expectedAction); expect(router.navigate).toHaveBeenCalledWith(['/participants']);