mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
import { mount } from '@vue/test-utils'
|
|
import ContributionMessagesList from './ContributionMessagesList'
|
|
|
|
const localVue = global.localVue
|
|
|
|
describe('ContributionMessagesList', () => {
|
|
let wrapper
|
|
|
|
const propsData = {
|
|
contributionId: 42,
|
|
state: 'IN_PROGRESS',
|
|
messages: [],
|
|
}
|
|
|
|
const mocks = {
|
|
$t: jest.fn((t) => t),
|
|
$i18n: {
|
|
locale: 'en',
|
|
},
|
|
}
|
|
|
|
const Wrapper = () => {
|
|
return mount(ContributionMessagesList, {
|
|
localVue,
|
|
mocks,
|
|
propsData,
|
|
})
|
|
}
|
|
|
|
describe('mount', () => {
|
|
beforeEach(() => {
|
|
wrapper = Wrapper()
|
|
})
|
|
|
|
it('has a DIV .contribution-messages-list', () => {
|
|
expect(wrapper.find('div.contribution-messages-list').exists()).toBe(true)
|
|
})
|
|
|
|
it('has a Component ContributionMessagesFormular', () => {
|
|
expect(wrapper.findComponent({ name: 'ContributionMessagesFormular' }).exists()).toBe(true)
|
|
})
|
|
|
|
describe('update State', () => {
|
|
beforeEach(() => {
|
|
wrapper.vm.updateState()
|
|
})
|
|
|
|
it('emits getListContributionMessages', async () => {
|
|
expect(wrapper.vm.$emit('update-state')).toBeTruthy()
|
|
})
|
|
})
|
|
})
|
|
})
|