From ced29278d5f8fb7f3328118b86a7c790bdc6f952 Mon Sep 17 00:00:00 2001 From: sundasnoreen12 Date: Tue, 17 Oct 2023 13:27:04 +0500 Subject: [PATCH] test: fixed test cases --- src/notification-preferences/data/reducers.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/notification-preferences/data/reducers.test.js b/src/notification-preferences/data/reducers.test.js index 57eb7ad84..919bbfb2d 100644 --- a/src/notification-preferences/data/reducers.test.js +++ b/src/notification-preferences/data/reducers.test.js @@ -5,6 +5,7 @@ import { FAILURE_STATUS, LOADING_STATUS, SUCCESS_STATUS, + IDLE_STATUS, } from '../../constants'; describe('notification-preferences reducer', () => { @@ -80,15 +81,16 @@ describe('notification-preferences reducer', () => { ); expect(result.preferences).toEqual({ status: SUCCESS_STATUS, + updatePreferenceStatus: SUCCESS_STATUS, selectedCourse: null, ...preferenceData, }); }); test.each([ - { action: Actions.FETCHING_PREFERENCES, status: LOADING_STATUS }, - { action: Actions.FAILED_PREFERENCES, status: FAILURE_STATUS }, - ])('preferences are empty when api call is %s', ({ action, status }) => { + { action: Actions.FETCHING_PREFERENCES, status: LOADING_STATUS, updatePreferenceStatus: IDLE_STATUS }, + { action: Actions.FAILED_PREFERENCES, status: FAILURE_STATUS, updatePreferenceStatus: FAILURE_STATUS }, + ])('preferences are empty when api call is %s', ({ action, status, updatePreferenceStatus }) => { const result = reducer( state, { type: action }, @@ -99,6 +101,7 @@ describe('notification-preferences reducer', () => { preferences: [], apps: [], nonEditable: {}, + updatePreferenceStatus, }); });