mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Remove route from apolloProvider.test and changed the test that checks the redirect on wallet login.
This commit is contained in:
parent
a3682a424e
commit
9d29c00ebb
@ -4,12 +4,10 @@ import CONFIG from '../config'
|
||||
|
||||
import VueApollo from 'vue-apollo'
|
||||
import store from '../store/store'
|
||||
import router from '../router/router'
|
||||
import i18n from '../i18n'
|
||||
|
||||
jest.mock('vue-apollo')
|
||||
jest.mock('../store/store')
|
||||
jest.mock('../router/router')
|
||||
jest.mock('../i18n')
|
||||
|
||||
jest.mock('apollo-boost', () => {
|
||||
@ -59,13 +57,6 @@ describe('apolloProvider', () => {
|
||||
errors: [{ message: '403.13 - Client certificate revoked' }],
|
||||
}
|
||||
|
||||
// mock router
|
||||
const routerPushMock = jest.fn()
|
||||
router.push = routerPushMock
|
||||
router.currentRoute = {
|
||||
path: '/overview',
|
||||
}
|
||||
|
||||
const windowLocationMock = jest.fn()
|
||||
delete window.location
|
||||
window.location = {
|
||||
@ -133,16 +124,8 @@ describe('apolloProvider', () => {
|
||||
expect(storeDispatchMock).toBeCalledWith('logout', null)
|
||||
})
|
||||
|
||||
describe('current route is not logout', () => {
|
||||
it('redirects to logout', () => {
|
||||
expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login')
|
||||
})
|
||||
})
|
||||
|
||||
describe('current route is logout', () => {
|
||||
it('does not redirect to logout', () => {
|
||||
expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login')
|
||||
})
|
||||
it('redirects to logout', () => {
|
||||
expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user