fixed test for navigator.clipboard

This commit is contained in:
ogerly 2022-04-04 11:16:32 +02:00
parent 68b8cb53e7
commit 0642b19791

View File

@ -58,10 +58,14 @@ describe('TransactionLink', () => {
navigatorClipboardMock.mockResolvedValue()
await wrapper.findAll('button').at(0).trigger('click')
})
it('toasts success message', () => {
expect(toastSuccessSpy).toBeCalledWith('gdd_per_link.link-copied')
it('should call clipboard.writeText', () => {
expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
'http://localhost/redeem/c00000000c000000c0000',
)
})
// it('toasts success message', () => {
// expect(toastSuccessSpy).toBeCalledWith('gdd_per_link.link-copied')
// })
})
describe('copy with error', () => {