From d9912d8ea36b24182c8ac3a3c796fca2ff3d4467 Mon Sep 17 00:00:00 2001 From: tomivm Date: Thu, 4 Aug 2022 18:01:48 -0300 Subject: [PATCH] refactor logout test --- src/components/Account/Login/Login.actions.test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Account/Login/Login.actions.test.js b/src/components/Account/Login/Login.actions.test.js index 6dd2c7f70..5dce681ad 100644 --- a/src/components/Account/Login/Login.actions.test.js +++ b/src/components/Account/Login/Login.actions.test.js @@ -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);