adjust test to bv toast

This commit is contained in:
Moriz Wahl 2022-02-16 07:55:25 +01:00
parent 5aee9c3abe
commit b8edb67558

View File

@ -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')
})
})