mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
use bv toaster
This commit is contained in:
parent
abfae25c7b
commit
66b9a822b2
@ -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!')
|
||||
})
|
||||
})
|
||||
|
||||
@ -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!')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ export default {
|
||||
window.scrollTo(0, 0)
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toasted.global.error(error.message)
|
||||
this.toastError(error.message)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user