mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Increase coverage in admin interface
This commit is contained in:
parent
cb0e044fb4
commit
b75b822d10
@ -3,11 +3,15 @@ import NavBar from './NavBar.vue'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const apolloMutateMock = jest.fn()
|
||||
const storeDispatchMock = jest.fn()
|
||||
const routerPushMock = jest.fn()
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$apollo: {
|
||||
mutate: apolloMutateMock,
|
||||
},
|
||||
$store: {
|
||||
state: {
|
||||
openCreations: 1,
|
||||
@ -69,5 +73,9 @@ describe('NavBar', () => {
|
||||
it('dispatches logout to store', () => {
|
||||
expect(storeDispatchMock).toBeCalledWith('logout')
|
||||
})
|
||||
|
||||
it('has called logout mutation', () => {
|
||||
expect(apolloMutateMock).toBeCalled()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -36,16 +36,10 @@ export default {
|
||||
async logout() {
|
||||
window.location.assign(CONFIG.WALLET_URL)
|
||||
// window.location = CONFIG.WALLET_URL
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: logout,
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.dispatch('logout')
|
||||
})
|
||||
.catch(() => {
|
||||
this.$store.dispatch('logout')
|
||||
})
|
||||
this.$store.dispatch('logout')
|
||||
await this.$apollo.mutate({
|
||||
mutation: logout,
|
||||
})
|
||||
},
|
||||
wallet() {
|
||||
window.location = CONFIG.WALLET_AUTH_URL.replace('{token}', this.$store.state.token)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user