mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix unit tests
This commit is contained in:
parent
a9a518c9bb
commit
e4a4744f4e
@ -9,15 +9,16 @@ const mockAPIcall = jest.fn()
|
|||||||
const navigatorClipboardMock = jest.fn()
|
const navigatorClipboardMock = jest.fn()
|
||||||
|
|
||||||
const mocks = {
|
const mocks = {
|
||||||
$i18n: {
|
|
||||||
locale: 'en',
|
|
||||||
},
|
|
||||||
$t: jest.fn((t) => t),
|
$t: jest.fn((t) => t),
|
||||||
$d: jest.fn((d) => d),
|
$d: jest.fn((d) => d),
|
||||||
$tc: jest.fn((tc) => tc),
|
|
||||||
$apollo: {
|
$apollo: {
|
||||||
mutate: mockAPIcall,
|
mutate: mockAPIcall,
|
||||||
},
|
},
|
||||||
|
$store: {
|
||||||
|
state: {
|
||||||
|
firstName: 'Testy',
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
@ -103,9 +104,9 @@ describe('TransactionLink', () => {
|
|||||||
it('should call clipboard.writeText', () => {
|
it('should call clipboard.writeText', () => {
|
||||||
expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
|
expect(navigator.clipboard.writeText).toHaveBeenCalledWith(
|
||||||
'http://localhost/redeem/c00000000c000000c0000\n' +
|
'http://localhost/redeem/c00000000c000000c0000\n' +
|
||||||
'Testy wants to send you 75 Gradido.\n' +
|
'Testy transaction-link.send_you 75 Gradido.\n' +
|
||||||
'"Katzenauge, Eulenschrei, was verschwunden komm herbei!"\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.',
|
'gdd_per_link.credit-your-gradido gdd_per_link.validUntilDate',
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
it('toasts success message', () => {
|
it('toasts success message', () => {
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export default {
|
|||||||
copyLinkWithText() {
|
copyLinkWithText() {
|
||||||
navigator.clipboard
|
navigator.clipboard
|
||||||
.writeText(
|
.writeText(
|
||||||
`${this.link}\n
|
`${this.link}
|
||||||
${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
|
${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
|
||||||
"${this.memo}"
|
"${this.memo}"
|
||||||
${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
|
${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user