Skip to content

Commit

Permalink
refactor logout test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivm committed Aug 4, 2022
1 parent 13276b8 commit d9912d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Account/Login/Login.actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ describe('actions', () => {
};
expect(actions.loginSuccess(userData)).toEqual(expectedAction);
});
it('should create an action to logout', () => {
it('should create an action to logout', async () => {
const store = mockStore(initialState);
const expectedAction = {
type: LOGOUT
};
expect(actions.logout()).toEqual(expectedAction);
await store.dispatch(actions.logout());
const logoutActions = store.getActions();
expect(logoutActions).toContainEqual(expectedAction);
});
it('should create an action to login', () => {
const store = mockStore(initialState);
Expand Down

0 comments on commit d9912d8

Please sign in to comment.