diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js index cdb71e4e1..e779f5928 100644 --- a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js +++ b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js @@ -217,7 +217,7 @@ describe('DashboardLayoutGdd', () => { expect(wrapper.vm.pending).toBeTruthy() }) - it('calls $toasted.global.error method', () => { + it('toasts the error message', () => { expect(toastErrorSpy).toBeCalledWith('Ouch!') }) }) diff --git a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js index a03122527..16c9de309 100644 --- a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js @@ -2,6 +2,8 @@ import { mount } from '@vue/test-utils' import { GdtEntryType } from '../../../graphql/enums' import GdtTransactionList from './GdtTransactionList' +import { toasters } from '../../../mixins/toaster' + const localVue = global.localVue const apolloMock = jest.fn().mockResolvedValue({ @@ -13,9 +15,10 @@ const apolloMock = jest.fn().mockResolvedValue({ }, }) -const toastErrorMock = jest.fn() const windowScrollToMock = jest.fn() +const toastErrorSpy = jest.spyOn(toasters.methods, 'toastError') + window.scrollTo = windowScrollToMock const state = { @@ -36,11 +39,6 @@ describe('GdtTransactionList ', () => { $t: jest.fn((t) => t), $n: jest.fn((n) => n), $d: jest.fn((d) => d), - $toasted: { - global: { - error: toastErrorMock, - }, - }, $apollo: { query: apolloMock, }, @@ -152,7 +150,7 @@ describe('GdtTransactionList ', () => { }) it('toasts an error message', () => { - expect(toastErrorMock).toBeCalledWith('Ouch!') + expect(toastErrorSpy).toBeCalledWith('Ouch!') }) }) diff --git a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue index 9c8b51f5e..953a0e5e0 100644 --- a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue @@ -71,7 +71,7 @@ export default { window.scrollTo(0, 0) }) .catch((error) => { - this.$toasted.global.error(error.message) + this.toastError(error.message) }) }, },