mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test Send.spec.js, two apollo querys
This commit is contained in:
parent
86e956f320
commit
7893a5d09c
@ -1,11 +1,12 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import Send from './Send'
|
import Send from './Send'
|
||||||
|
import { toastErrorSpy } from '../../test/testSetup'
|
||||||
|
|
||||||
const sendCoinsMock = jest.fn()
|
const sendCoinsMock = jest.fn()
|
||||||
sendCoinsMock.mockResolvedValue('success')
|
sendCoinsMock.mockResolvedValue('success')
|
||||||
|
|
||||||
const createTransactionLinkMock = jest.fn()
|
const createTransactionLinkMock = jest.fn()
|
||||||
createTransactionLinkMock.mockResolvedValue('success')
|
createTransactionLinkMock.mockResolvedValue('error')
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
@ -154,6 +155,18 @@ describe('Send', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('send apollo if transaction link with error', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
createTransactionLinkMock.mockRejectedValue({ message: 'OUCH!' })
|
||||||
|
wrapper = Wrapper()
|
||||||
|
wrapper.find('button.btn-success').trigger('click')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('toasts an error message', () => {
|
||||||
|
expect(toastErrorSpy).toBeCalledWith('unregister_mail.error')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('confirm transaction if selected:link', () => {
|
describe('confirm transaction if selected:link', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper.setData({
|
wrapper.setData({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user