bv toast in creation page

This commit is contained in:
Moriz Wahl 2022-03-03 12:33:40 +01:00
parent 371bfba0ee
commit b8f4980bda
2 changed files with 3 additions and 6 deletions

View File

@ -1,5 +1,6 @@
import { mount } from '@vue/test-utils'
import Creation from './Creation.vue'
import { toastErrorSpy } from '../../test/testSetup'
const localVue = global.localVue
@ -29,7 +30,6 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
},
})
const toastErrorMock = jest.fn()
const storeCommitMock = jest.fn()
const mocks = {
@ -38,9 +38,6 @@ const mocks = {
$apollo: {
query: apolloQueryMock,
},
$toasted: {
error: toastErrorMock,
},
$store: {
commit: storeCommitMock,
state: {
@ -298,7 +295,7 @@ describe('Creation', () => {
})
it('toasts an error message', () => {
expect(toastErrorMock).toBeCalledWith('Ouch')
expect(toastErrorSpy).toBeCalledWith('Ouch')
})
})
})

View File

@ -118,7 +118,7 @@ export default {
}
})
.catch((error) => {
this.$toasted.error(error.message)
this.toastError(error.message)
})
},
pushItem(selectedItem) {