mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
adjust test to bv toast
This commit is contained in:
parent
5aee9c3abe
commit
b8edb67558
@ -1,6 +1,8 @@
|
||||
import { mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import RegisterCommunity from './RegisterCommunity'
|
||||
|
||||
import { toasters } from '../../mixins/toaster'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
@ -13,9 +15,11 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
},
|
||||
},
|
||||
})
|
||||
const toastErrorMock = jest.fn()
|
||||
|
||||
const mockStoreCommit = jest.fn()
|
||||
|
||||
const toastErrorSpy = jest.spyOn(toasters.methods, 'toastError')
|
||||
|
||||
describe('RegisterCommunity', () => {
|
||||
let wrapper
|
||||
|
||||
@ -36,11 +40,6 @@ describe('RegisterCommunity', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
$toasted: {
|
||||
global: {
|
||||
error: toastErrorMock,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const stubs = {
|
||||
@ -78,7 +77,7 @@ describe('RegisterCommunity', () => {
|
||||
})
|
||||
|
||||
it('toasts an error message', () => {
|
||||
expect(toastErrorMock).toBeCalledWith('Failed to get communities')
|
||||
expect(toastErrorSpy).toBeCalledWith('Failed to get communities')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user