From e4a4744f4e4be78367ed5128410709be95ad1ef0 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 5 Jul 2022 12:30:46 +0200 Subject: [PATCH] fix unit tests --- .../TransactionLinks/TransactionLink.spec.js | 15 ++++++++------- .../TransactionLinks/TransactionLink.vue | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/TransactionLinks/TransactionLink.spec.js b/frontend/src/components/TransactionLinks/TransactionLink.spec.js index 469a8377e..50f1588d7 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.spec.js +++ b/frontend/src/components/TransactionLinks/TransactionLink.spec.js @@ -9,15 +9,16 @@ const mockAPIcall = jest.fn() const navigatorClipboardMock = jest.fn() const mocks = { - $i18n: { - locale: 'en', - }, $t: jest.fn((t) => t), $d: jest.fn((d) => d), - $tc: jest.fn((tc) => tc), $apollo: { mutate: mockAPIcall, }, + $store: { + state: { + firstName: 'Testy', + }, + }, } const propsData = { @@ -103,9 +104,9 @@ describe('TransactionLink', () => { it('should call clipboard.writeText', () => { expect(navigator.clipboard.writeText).toHaveBeenCalledWith( 'http://localhost/redeem/c00000000c000000c0000\n' + - 'Testy wants to send you 75 Gradido.\n' + - '"Katzenauge, Eulenschrei, was verschwunden komm herbei!"\n' + - 'For the Gradido to be credited, click on the link! The link is valid until 3/30/2022.', + 'Testy transaction-link.send_you 75 Gradido.\n' + + '"Katzenauge, Eulenschrei, was verschwunden komm herbei!"\n' + + 'gdd_per_link.credit-your-gradido gdd_per_link.validUntilDate', ) }) it('toasts success message', () => { diff --git a/frontend/src/components/TransactionLinks/TransactionLink.vue b/frontend/src/components/TransactionLinks/TransactionLink.vue index d5491835c..5618c8696 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.vue +++ b/frontend/src/components/TransactionLinks/TransactionLink.vue @@ -110,7 +110,7 @@ export default { copyLinkWithText() { navigator.clipboard .writeText( - `${this.link}\n + `${this.link} ${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido. "${this.memo}" ${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {