Alina Beck 77f4810ddc set up global localVue
by setting up localVue with all required plugins (such as styleguide and vuex)
in a separate testSetup file we can avoid doing this individually in all component tests
the testSetup is executed before each test suite, so each test file gets a fresh
instance of localVue
2019-11-20 12:31:40 +03:00

35 lines
618 B
JavaScript

import { shallowMount } from '@vue/test-utils'
import Category from './index'
const localVue = global.localVue
describe('Category', () => {
let icon
let name
let Wrapper = () => {
return shallowMount(Category, {
localVue,
propsData: {
icon,
name,
},
})
}
describe('given Strings for Icon and Name', () => {
beforeEach(() => {
icon = 'mouse-cursor'
name = 'Peter'
})
it('shows Name', () => {
expect(Wrapper().text()).toContain('Peter')
})
it('shows Icon Svg', () => {
expect(Wrapper().contains('svg'))
})
})
})