test: update snapshots and tests

This commit is contained in:
woothu
2019-10-19 15:29:25 +02:00
parent 452af28957
commit d2e7838db6
38 changed files with 2087 additions and 1959 deletions
+24
View File
@@ -0,0 +1,24 @@
import Vue from 'vue'
import { shallowMount } from '@vue/test-utils';
import CoreuiVue from '@coreui/vue'
import Charts from '@/views/charts/Charts'
Vue.use(CoreuiVue)
describe('Charts.vue', () => {
it('has a name', () => {
expect(Charts.name).toBe('Charts')
})
it('is Vue instance', () => {
const wrapper = shallowMount(Charts)
expect(wrapper.isVueInstance()).toBe(true)
})
it('is Charts', () => {
const wrapper = shallowMount(Charts)
expect(wrapper.is(Charts)).toBe(true)
})
test('renders correctly', () => {
const wrapper = shallowMount(Charts)
expect(wrapper.element).toMatchSnapshot()
})
})
@@ -0,0 +1,135 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Charts.vue renders correctly 1`] = `
<div>
<ccardgroup-stub
class="card-columns cols-2"
columns="true"
>
<ccard-stub
subtitletag="h6"
titletag="h4"
>
<ccardheader-stub
subtitletag="h6"
titletag="h4"
>
Line Chart
<div
class="card-header-actions"
>
<a
class="card-header-action"
href="https://coreui.io/vue/docs/3.0/components/Charts"
rel="noreferrer noopener"
target="_blank"
>
<small
class="text-muted"
>
docs
</small>
</a>
</div>
</ccardheader-stub>
<ccardbody-stub
subtitletag="h6"
titletag="h4"
>
<cchartlineexample-stub />
</ccardbody-stub>
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Bar Chart"
subtitletag="h6"
titletag="h4"
>
<cchartbarexample-stub />
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Doughnut Chart"
subtitletag="h6"
titletag="h4"
>
<cchartdoughnutexample-stub />
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Radar Chart"
subtitletag="h6"
titletag="h4"
>
<cchartradarexample-stub />
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Pie Chart"
subtitletag="h6"
titletag="h4"
>
<cchartpieexample-stub />
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Polar Area Chart"
subtitletag="h6"
titletag="h4"
>
<cchartpolarareaexample-stub />
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Simple line chart"
subtitletag="h6"
titletag="h4"
>
<cchartlinesimple-stub
backgroundcolor="transparent"
bordercolor="success"
datapoints="10,22,34,46,58,70,46,23,45,78,34,12"
label="Sales"
labels="months"
/>
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Simple pointed chart"
subtitletag="h6"
titletag="h4"
>
<cchartlinesimple-stub
backgroundcolor="transparent"
bordercolor="warning"
datapoints="10,22,34,46,58,70,46,23,45,78,34,12"
label="Sales"
pointed="true"
/>
</ccard-stub>
<ccard-stub
bodywrapper="true"
headerhtml="Simple bar chart"
subtitletag="h6"
titletag="h4"
>
<cchartbarsimple-stub
backgroundcolor="danger"
datapoints="10,22,34,46,58,70,46,23,45,78,34,12"
label="Sales"
/>
</ccard-stub>
</ccardgroup-stub>
</div>
`;