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
66b9a822b2
commit
5aee9c3abe
@ -1,8 +1,9 @@
|
||||
import { mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import flushPromises from 'flush-promises'
|
||||
|
||||
import Register from './Register'
|
||||
|
||||
import { toasters } from '../../mixins/toaster'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
@ -16,11 +17,12 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
},
|
||||
})
|
||||
|
||||
const toastErrorMock = jest.fn()
|
||||
const mockStoreCommit = jest.fn()
|
||||
const registerUserMutationMock = jest.fn()
|
||||
const routerPushMock = jest.fn()
|
||||
|
||||
const toastErrorSpy = jest.spyOn(toasters.methods, 'toastError')
|
||||
|
||||
describe('Register', () => {
|
||||
let wrapper
|
||||
|
||||
@ -48,11 +50,6 @@ describe('Register', () => {
|
||||
publisherId: 12345,
|
||||
},
|
||||
},
|
||||
$toasted: {
|
||||
global: {
|
||||
error: toastErrorMock,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const stubs = {
|
||||
@ -96,7 +93,7 @@ describe('Register', () => {
|
||||
})
|
||||
|
||||
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