From 0642b19791a4e36337325e4ef78c6f9e59c8f377 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 4 Apr 2022 11:16:32 +0200 Subject: [PATCH] fixed test for navigator.clipboard --- .../TransactionLinks/TransactionLink.spec.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/TransactionLinks/TransactionLink.spec.js b/frontend/src/components/TransactionLinks/TransactionLink.spec.js index fd1ac4bf4..ddb4c79d7 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.spec.js +++ b/frontend/src/components/TransactionLinks/TransactionLink.spec.js @@ -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', () => {