mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Window.location.assign instead of window.location =, so we can test it.
This commit is contained in:
parent
c08cd7e37c
commit
d857ee02a8
@ -53,13 +53,17 @@ describe('NavBar', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('logout', () => {
|
describe('logout', () => {
|
||||||
// const assignLocationSpy = jest.fn()
|
const windowLocationMock = jest.fn()
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
delete window.location
|
||||||
|
window.location = {
|
||||||
|
assign: windowLocationMock,
|
||||||
|
}
|
||||||
await wrapper.findAll('a').at(6).trigger('click')
|
await wrapper.findAll('a').at(6).trigger('click')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('redirects to /logout', () => {
|
it('redirects to /logout', () => {
|
||||||
expect(routerPushMock).toBeCalledWith('/logout')
|
expect(windowLocationMock).toBeCalledWith('http://localhost/vue/login')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('dispatches logout to store', () => {
|
it('dispatches logout to store', () => {
|
||||||
|
|||||||
@ -33,7 +33,8 @@ export default {
|
|||||||
name: 'navbar',
|
name: 'navbar',
|
||||||
methods: {
|
methods: {
|
||||||
logout() {
|
logout() {
|
||||||
window.location = CONFIG.WALLET_URL
|
window.location.assign(CONFIG.WALLET_URL)
|
||||||
|
// window.location = CONFIG.WALLET_URL
|
||||||
this.$store.dispatch('logout')
|
this.$store.dispatch('logout')
|
||||||
},
|
},
|
||||||
wallet() {
|
wallet() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user