mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1024 from gradido/flaky-logout-test
fix: Flaky Dashboard Layout Test on Logout
This commit is contained in:
commit
66c92d2198
@ -4,6 +4,8 @@ import DashboardLayoutGdd from './DashboardLayout_gdd'
|
||||
|
||||
jest.useFakeTimers()
|
||||
|
||||
jest.setTimeout(30000)
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const storeDispatchMock = jest.fn()
|
||||
@ -137,6 +139,7 @@ describe('DashboardLayoutGdd', () => {
|
||||
})
|
||||
await wrapper.findComponent({ name: 'sidebar' }).vm.$emit('logout')
|
||||
await flushPromises()
|
||||
await wrapper.vm.$nextTick()
|
||||
})
|
||||
|
||||
it('calls the API', async () => {
|
||||
@ -168,6 +171,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', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user