diff --git a/admin/src/components/CreationTransactionListFormular.spec.js b/admin/src/components/CreationTransactionListFormular.spec.js index 88cda89ee..7331184b7 100644 --- a/admin/src/components/CreationTransactionListFormular.spec.js +++ b/admin/src/components/CreationTransactionListFormular.spec.js @@ -1,5 +1,6 @@ import { mount } from '@vue/test-utils' import CreationTransactionListFormular from './CreationTransactionListFormular.vue' +import { toastErrorSpy } from '../../test/testSetup' const localVue = global.localVue @@ -50,17 +51,12 @@ const apolloQueryMock = jest.fn().mockResolvedValue({ }, }) -const toastedErrorMock = jest.fn() - const mocks = { $d: jest.fn((t) => t), $t: jest.fn((t) => t), $apollo: { query: apolloQueryMock, }, - $toasted: { - error: toastedErrorMock, - }, } const propsData = { @@ -109,7 +105,7 @@ describe('CreationTransactionListFormular', () => { }) it('toast error', () => { - expect(toastedErrorMock).toBeCalledWith('OUCH!') + expect(toastErrorSpy).toBeCalledWith('OUCH!') }) }) }) diff --git a/admin/src/components/CreationTransactionListFormular.vue b/admin/src/components/CreationTransactionListFormular.vue index 627647534..f4fbe7c8b 100644 --- a/admin/src/components/CreationTransactionListFormular.vue +++ b/admin/src/components/CreationTransactionListFormular.vue @@ -62,7 +62,7 @@ export default { this.items = result.data.transactionList.transactions.filter((t) => t.type === 'creation') }) .catch((error) => { - this.$toasted.error(error.message) + this.toastError(error.message) }) }, },