Skip to content

Commit

Permalink
peer review fixs for SRS frontend test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ppratikcr7 committed Oct 16, 2023
1 parent 2736b4d commit e8d7519
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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']);
Expand Down

0 comments on commit e8d7519

Please sign in to comment.