Skip to content

Commit f440e14

Browse files
author
Ganjar Setia M
authored
test: add CChartBarExample unit test (#193)
1 parent db2fd31 commit f440e14

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Vue from 'vue'
2+
import { shallowMount } from '@vue/test-utils';
3+
import CoreuiVue from '@coreui/vue'
4+
import CChartBarExample from '@/views/charts/CChartBarExample'
5+
6+
Vue.use(CoreuiVue)
7+
8+
describe('CChartBarExample', () => {
9+
it('has a name', () => {
10+
expect(CChartBarExample.name).toBe('CChartBarExample')
11+
})
12+
it('is Vue instance', () => {
13+
const wrapper = shallowMount(CChartBarExample)
14+
expect(wrapper.isVueInstance()).toBe(true)
15+
})
16+
it('is CChartBarExample', () => {
17+
const wrapper = shallowMount(CChartBarExample)
18+
expect(wrapper.is(CChartBarExample)).toBe(true)
19+
})
20+
test('renders correctly', () => {
21+
const wrapper = shallowMount(CChartBarExample)
22+
expect(wrapper.element).toMatchSnapshot()
23+
})
24+
it('should have computed', () => {
25+
const wrapper = shallowMount(CChartBarExample)
26+
27+
expect(wrapper.vm.defaultDatasets).toBeDefined()
28+
})
29+
})
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`CChartBarExample renders correctly 1`] = `
4+
<cchartbar-stub
5+
datasets="[object Object]"
6+
labels="months"
7+
/>
8+
`;

0 commit comments

Comments
 (0)