mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test for ContributionLink
This commit is contained in:
parent
bbd0fd6478
commit
6a91de6808
32
admin/src/components/ContributionLink.spec.js
Normal file
32
admin/src/components/ContributionLink.spec.js
Normal file
@ -0,0 +1,32 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionLink from './ContributionLink.vue'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
}
|
||||
|
||||
describe('ContributionLink', () => {
|
||||
let wrapper
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(ContributionLink, { localVue, mocks })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders the Div Element ".contribution-link"', () => {
|
||||
expect(wrapper.find('div.contribution-link').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('emits toggle::collapse new Contribution', async () => {
|
||||
wrapper.vm.editContributionLinkData()
|
||||
// expect(wrapper.emitted('bv::toggle::collapse', 'newContribution')).toBeTruthy()
|
||||
expect(wrapper.vm.$root.$emit('bv::toggle::collapse', 'newContribution')).toBeTruthy()
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="contribution-link">
|
||||
<b-card
|
||||
border-variant="success"
|
||||
:header="$t('contributionLink.contributionLinks')"
|
||||
|
||||
@ -193,7 +193,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
contributionLinkData() {
|
||||
alert('change contributionLinkData')
|
||||
// alert('change contributionLinkData')
|
||||
this.form.name = this.contributionLinkData.name
|
||||
this.form.memo = this.contributionLinkData.memo
|
||||
this.form.amount = this.contributionLinkData.amount
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user