mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test is no entering the catch block after logout fail
This commit is contained in:
parent
a0583cbb50
commit
9cecec97b0
@ -32,6 +32,9 @@ describe('DashboardLayoutGdd', () => {
|
||||
},
|
||||
$router: {
|
||||
push: routerPushMock,
|
||||
currentRoute: {
|
||||
path: '/overview',
|
||||
},
|
||||
},
|
||||
$toasted: {
|
||||
error: toasterMock,
|
||||
@ -143,21 +146,23 @@ describe('DashboardLayoutGdd', () => {
|
||||
it('redirects to login page', () => {
|
||||
expect(routerPushMock).toBeCalledWith('/login')
|
||||
})
|
||||
})
|
||||
|
||||
describe('logout fails', () => {
|
||||
beforeEach(() => {
|
||||
apolloMock.mockRejectedValue({
|
||||
message: 'error',
|
||||
})
|
||||
describe('logout fails', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMock.mockRejectedValue({
|
||||
message: 'error',
|
||||
})
|
||||
await wrapper.findComponent({ name: 'sidebar' }).vm.$emit('logout')
|
||||
await flushPromises()
|
||||
})
|
||||
|
||||
it('dispatches logout to store', () => {
|
||||
expect(storeDispatchMock).toBeCalledWith('logout')
|
||||
})
|
||||
it('dispatches logout to store', () => {
|
||||
expect(storeDispatchMock).toBeCalledWith('logout')
|
||||
})
|
||||
|
||||
it('redirects to login page', () => {
|
||||
expect(routerPushMock).toBeCalledWith('/login')
|
||||
})
|
||||
it('redirects to login page', () => {
|
||||
expect(routerPushMock).toBeCalledWith('/login')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user