mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
32 lines
758 B
JavaScript
32 lines
758 B
JavaScript
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.vm.$root.$emit('bv::toggle::collapse', 'newContribution')).toBeTruthy()
|
|
})
|
|
})
|
|
})
|