mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
bv toaster in Dashboard Layout
This commit is contained in:
parent
fcd89dd139
commit
abfae25c7b
@ -2,6 +2,8 @@ import { mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import flushPromises from 'flush-promises'
|
||||
import DashboardLayoutGdd from './DashboardLayout_gdd'
|
||||
|
||||
import { toasters } from '../../mixins/toaster'
|
||||
|
||||
jest.useFakeTimers()
|
||||
|
||||
jest.setTimeout(30000)
|
||||
@ -16,7 +18,8 @@ const apolloMock = jest.fn().mockResolvedValue({
|
||||
logout: 'success',
|
||||
},
|
||||
})
|
||||
const toasterMock = jest.fn()
|
||||
|
||||
const toastErrorSpy = jest.spyOn(toasters.methods, 'toastError')
|
||||
|
||||
describe('DashboardLayoutGdd', () => {
|
||||
let wrapper
|
||||
@ -38,11 +41,6 @@ describe('DashboardLayoutGdd', () => {
|
||||
path: '/overview',
|
||||
},
|
||||
},
|
||||
$toasted: {
|
||||
global: {
|
||||
error: toasterMock,
|
||||
},
|
||||
},
|
||||
$apollo: {
|
||||
query: apolloMock,
|
||||
},
|
||||
@ -220,7 +218,7 @@ describe('DashboardLayoutGdd', () => {
|
||||
})
|
||||
|
||||
it('calls $toasted.global.error method', () => {
|
||||
expect(toasterMock).toBeCalledWith('Ouch!')
|
||||
expect(toastErrorSpy).toBeCalledWith('Ouch!')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ export default {
|
||||
.catch((error) => {
|
||||
this.pending = true
|
||||
this.transactionCount = -1
|
||||
this.$toasted.global.error(error.message)
|
||||
this.toastError(error.message)
|
||||
// what to do when loading balance fails?
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user