load provide from dashboard layout, test set tunneled email

This commit is contained in:
Moriz Wahl 2022-03-22 14:59:24 +01:00
parent 78aaf629d2
commit 31dcf30c46
3 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,7 @@
import { mount } from '@vue/test-utils'
import TransactionForm from './TransactionForm'
import flushPromises from 'flush-promises'
import DashboardLayout from '@/layouts/DashboardLayout_gdd.vue'
const localVue = global.localVue
@ -29,11 +30,7 @@ describe('TransactionForm', () => {
localVue,
mocks,
propsData,
provide: {
getTunneledEmail() {
return null
},
},
provide: DashboardLayout.provide,
})
}

View File

@ -284,5 +284,14 @@ describe('DashboardLayoutGdd', () => {
})
})
})
describe('set tunneled email', () => {
it('updates tunneled email', async () => {
await wrapper
.findComponent({ ref: 'router-view' })
.vm.$emit('set-tunneled-email', 'bibi@bloxberg.de')
expect(wrapper.vm.tunneledEmail).toBe('bibi@bloxberg.de')
})
})
})
})

View File

@ -3,6 +3,7 @@ import Send, { SEND_TYPES } from './Send'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
import { TRANSACTION_STEPS } from '@/components/GddSend.vue'
import { sendCoins, createTransactionLink } from '@/graphql/mutations.js'
import DashboardLayout from '@/layouts/DashboardLayout_gdd.vue'
const apolloMutationMock = jest.fn()
apolloMutationMock.mockResolvedValue('success')
@ -43,11 +44,7 @@ describe('Send', () => {
localVue,
mocks,
propsData,
provide: {
getTunneledEmail() {
return null
},
},
provide: DashboardLayout.provide,
})
}