bv toast in creation transaction formular

This commit is contained in:
Moriz Wahl 2022-03-03 12:26:10 +01:00
parent f2af159914
commit 11808f1e22
2 changed files with 3 additions and 7 deletions

View File

@ -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!')
})
})
})

View File

@ -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)
})
},
},