mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
45 lines
931 B
JavaScript
45 lines
931 B
JavaScript
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
|
import Comment from './Comment.vue'
|
|
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
import Styleguide from '@human-connection/styleguide'
|
|
|
|
const localVue = createLocalVue()
|
|
|
|
localVue.use(Vuex)
|
|
localVue.use(Styleguide)
|
|
|
|
|
|
describe('Comment.vue', () => {
|
|
let wrapper
|
|
let Wrapper
|
|
let propsData
|
|
let mocks
|
|
|
|
beforeEach(() => {
|
|
propsData = {}
|
|
mocks = {
|
|
$t: jest.fn(),
|
|
}
|
|
})
|
|
|
|
describe('shallowMount', () => {
|
|
const Wrapper = () => {
|
|
return shallowMount(Comment, { propsData, mocks, localVue })
|
|
}
|
|
|
|
describe('given a comment', () => {
|
|
beforeEach(() => {
|
|
propsData.comment = {
|
|
content: 'Hello I am a comment content'
|
|
}
|
|
})
|
|
|
|
it('renders content', () => {
|
|
const wrapper = Wrapper()
|
|
expect(wrapper.text()).toMatch('Hello I am a comment content')
|
|
})
|
|
})
|
|
})
|
|
})
|