test: added update account preference test case
This commit is contained in:
@@ -84,7 +84,7 @@ const mockData = {
|
||||
profileDataManager: null,
|
||||
},
|
||||
notificationPreferences: {
|
||||
showPreferences: false,
|
||||
showPreferences: true,
|
||||
courses: {
|
||||
status: 'success',
|
||||
courses: [],
|
||||
|
||||
@@ -77,6 +77,7 @@ const setupStore = (override = {}) => {
|
||||
storeState.courses = {
|
||||
status: SUCCESS_STATUS,
|
||||
courses: [
|
||||
{ id: '', name: 'Account' },
|
||||
{ id: 'selected-course-id', name: 'Selected Course' },
|
||||
],
|
||||
};
|
||||
@@ -145,4 +146,16 @@ describe('Notification Preferences', () => {
|
||||
await fireEvent.click(element);
|
||||
expect(mockDispatch).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('update account preference on click', async () => {
|
||||
store = setupStore({
|
||||
...defaultPreferences,
|
||||
status: SUCCESS_STATUS,
|
||||
selectedCourse: '',
|
||||
});
|
||||
await render(notificationPreferences(store));
|
||||
const element = screen.getByTestId('core-web');
|
||||
await fireEvent.click(element);
|
||||
expect(mockDispatch).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user