This commit is contained in:
ogerly 2023-01-19 09:13:39 +01:00
parent f7b74d8e63
commit ad8e8b8609
5 changed files with 21 additions and 5 deletions

View File

@ -3,7 +3,11 @@
<div v-if="canCopyLink" class="mb-5">
<div>
<label>{{ $t('gdd_per_link.copy-link') }}</label>
<div class="pointer text-center bg-secondary gradido-border-radius p-3" @click="copyLink">
<div
class="pointer text-center bg-secondary gradido-border-radius p-3"
@click="copyLink"
data-test="copyLink"
>
{{ link }}
<div>
<b-button class="p-4">
@ -16,6 +20,7 @@
<label>{{ $t('gdd_per_link.copy-link-with-text') }}</label>
<div
class="pointer text-center bg-secondary gradido-border-radius p-3"
data-test="copyLinkWithText"
@click="copyLinkWithText"
>
{{ text }}

View File

@ -24,6 +24,7 @@ const propsData = {
memo: 'Eene meene Siegerpreis, vor mir steht ein Schokoeis. Hex-hex!',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
{
amount: '6',
@ -35,6 +36,7 @@ const propsData = {
memo: 'Eene meene buntes Laub, auf dem Schrank da liegt kein Staub.',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
],
transactionLinkCount: 3,

View File

@ -28,6 +28,7 @@ const propsData = {
id: 12,
memo: 'Katzenauge, Eulenschrei, was verschwunden komm herbei!',
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
}
describe('TransactionLink', () => {

View File

@ -52,6 +52,7 @@ describe('TransactionLinkSummary', () => {
'Hokuspokus Haselnuss, Vogelbein und Fliegenfuß, damit der Trick gelingen muss!',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
{
amount: '85',
@ -62,6 +63,7 @@ describe('TransactionLinkSummary', () => {
memo: 'Mäusespeck und Katzenbuckel, Tricks und Tracks und Zauberkugel!',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
{
amount: '95',
@ -73,6 +75,7 @@ describe('TransactionLinkSummary', () => {
'Abrakadabra 1,2,3, die Sonne kommt herbei. Schweinepups und Spuckebrei, der Regen ist vorbei.',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
{
amount: '150',
@ -84,6 +87,7 @@ describe('TransactionLinkSummary', () => {
'Abrakadabra 1,2,3 was verschwunden ist komme herbei.Wieseldreck und Schweinemist, zaubern das ist keine List.',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
],
},
@ -171,6 +175,7 @@ describe('TransactionLinkSummary', () => {
'Hat jemand die Nummer von der Hexe aus Schneewittchen? Ich bräuchte mal ein paar Äpfel.',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
{
amount: '86',
@ -182,6 +187,7 @@ describe('TransactionLinkSummary', () => {
'Die Windfahn´ krächzt am Dach, Der Uhu im Geklüfte; Was wispert wie ein Ach Verhallend in die Lüfte?',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
{
amount: '96',
@ -193,6 +199,7 @@ describe('TransactionLinkSummary', () => {
'Verschlafen kräht der Hahn, Ein Blitz noch, und ein trüber, Umwölbter Tag bricht an Walpurgisnacht vorüber!',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
{
amount: '150',
@ -203,6 +210,7 @@ describe('TransactionLinkSummary', () => {
memo: 'Eene meene Flaschenschrank, fertig ist der Hexentrank!',
redeemedAt: null,
validUntil: '2022-03-30T14:22:40.000Z',
text: '',
},
],
},

View File

@ -254,7 +254,7 @@ describe('Send', () => {
describe('copy link with success', () => {
beforeEach(async () => {
navigatorClipboardMock.mockResolvedValue()
await wrapper.find('.pointer').trigger('click')
await wrapper.find('div[data-test="copyLink"]').trigger('click')
})
it('should call clipboard.writeText', () => {
@ -270,7 +270,7 @@ describe('Send', () => {
describe('copy link with error', () => {
beforeEach(async () => {
navigatorClipboardMock.mockRejectedValue()
await wrapper.find('.clipboard-copy').find('.btn-secondary').trigger('click')
await wrapper.find('div[data-test="copyLink"]').trigger('click')
})
it('toasts error message', () => {
@ -292,7 +292,7 @@ describe('Send', () => {
describe('copy link and text with success', () => {
beforeEach(async () => {
navigatorClipboardMock.mockResolvedValue()
await wrapper.findAll('button').at(0).trigger('click')
await wrapper.find('div[data-test="copyLinkWithText"]').trigger('click')
})
it('should call clipboard.writeText', () => {
@ -312,7 +312,7 @@ describe('Send', () => {
describe('copy link and text with error', () => {
beforeEach(async () => {
navigatorClipboardMock.mockRejectedValue()
await wrapper.findAll('button').at(0).trigger('click')
await wrapper.find('div[data-test="copyLinkWithText"]').trigger('click')
})
it('toasts error message', () => {