fix: Flaky Dashboard Layout Test on Logout

This commit is contained in:
Moriz Wahl 2021-10-20 08:48:10 +02:00
parent 2342b2e266
commit 1df9618473

View File

@ -137,6 +137,7 @@ describe('DashboardLayoutGdd', () => {
})
await wrapper.findComponent({ name: 'sidebar' }).vm.$emit('logout')
await flushPromises()
await wrapper.vm.$nextTick()
})
it('calls the API', async () => {
@ -168,6 +169,17 @@ describe('DashboardLayoutGdd', () => {
it('redirects to login page', () => {
expect(routerPushMock).toBeCalledWith('/login')
})
describe('redirect to login already done', () => {
beforeEach(() => {
mocks.$router.currentRoute.path = '/login'
jest.resetAllMocks()
})
it('does not call the redirect to login', () => {
expect(routerPushMock).not.toBeCalled()
})
})
})
describe('update balance', () => {