diff --git a/frontend/src/views/Pages/RegisterCommunity.spec.js b/frontend/src/views/Pages/RegisterCommunity.spec.js index 6d6574881..f29ea5386 100644 --- a/frontend/src/views/Pages/RegisterCommunity.spec.js +++ b/frontend/src/views/Pages/RegisterCommunity.spec.js @@ -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') }) })