output error output from graphql that no recipient was found in ordinary text

This commit is contained in:
ogerly 2021-11-30 10:10:24 +01:00
parent 508b1519ee
commit 9ed7c9d71e
2 changed files with 12 additions and 5 deletions

View File

@ -116,18 +116,22 @@ describe('SendOverview', () => {
describe('transaction is confirmed and server response is error', () => {
beforeEach(async () => {
jest.clearAllMocks()
sendMock.mockRejectedValue({ message: 'receiver not found' })
sendMock.mockRejectedValue({ message: 'recipiant not known' })
await wrapper
.findComponent({ name: 'TransactionConfirmation' })
.vm.$emit('send-transaction')
})
it('shows the error page', () => {
expect(wrapper.find('div.card-body').text()).toContain('form.send_transaction_error')
expect(wrapper.find('.test-send_transaction_error').text()).toContain(
'form.send_transaction_error',
)
})
it('shows recipient not found', () => {
expect(wrapper.text()).toContain('transaction.receiverNotFound')
expect(wrapper.find('.test-receiver-not-found').text()).toContain(
'transaction.receiverNotFound',
)
})
})
})

View File

@ -20,10 +20,13 @@
<div>{{ $t('form.sorry') }}</div>
<hr />
<div>{{ $t('form.send_transaction_error') }}</div>
<div class="test-send_transaction_error">{{ $t('form.send_transaction_error') }}</div>
<hr />
<div v-if="errorResult === 'receiver not found'">
<div
class="test-test-receiver-not-found"
v-if="errorResult === 'GraphQL error: recipiant not known'"
>
{{ $t('transaction.receiverNotFound') }}
</div>
<div v-else>({{ errorResult }})</div>