test: add CChartBarExample unit test (#193)
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import { shallowMount } from '@vue/test-utils';
|
||||||
|
import CoreuiVue from '@coreui/vue'
|
||||||
|
import CChartBarExample from '@/views/charts/CChartBarExample'
|
||||||
|
|
||||||
|
Vue.use(CoreuiVue)
|
||||||
|
|
||||||
|
describe('CChartBarExample', () => {
|
||||||
|
it('has a name', () => {
|
||||||
|
expect(CChartBarExample.name).toBe('CChartBarExample')
|
||||||
|
})
|
||||||
|
it('is Vue instance', () => {
|
||||||
|
const wrapper = shallowMount(CChartBarExample)
|
||||||
|
expect(wrapper.isVueInstance()).toBe(true)
|
||||||
|
})
|
||||||
|
it('is CChartBarExample', () => {
|
||||||
|
const wrapper = shallowMount(CChartBarExample)
|
||||||
|
expect(wrapper.is(CChartBarExample)).toBe(true)
|
||||||
|
})
|
||||||
|
test('renders correctly', () => {
|
||||||
|
const wrapper = shallowMount(CChartBarExample)
|
||||||
|
expect(wrapper.element).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
it('should have computed', () => {
|
||||||
|
const wrapper = shallowMount(CChartBarExample)
|
||||||
|
|
||||||
|
expect(wrapper.vm.defaultDatasets).toBeDefined()
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`CChartBarExample renders correctly 1`] = `
|
||||||
|
<cchartbar-stub
|
||||||
|
datasets="[object Object]"
|
||||||
|
labels="months"
|
||||||
|
/>
|
||||||
|
`;
|
||||||
Reference in New Issue
Block a user