vue-wcharts
Version:
Vuejs charts
58 lines (52 loc) • 1.57 kB
JavaScript
import { mount, shallowMount } from '@vue/test-utils'
import WSpread from './WSpread.vue'
describe('Widgets/WSpread', () => {
const propsData = {
id: 'test',
axis: 'x',
transition: 'all 250s 250ss ease',
}
const defaultConfig = {
context: {
props: propsData,
},
}
it(`Should be render correctly`, () => {
const wrapper = shallowMount(WSpread, defaultConfig)
expect(wrapper.html()).toMatchSnapshot()
})
it(`Should be render correctly with children and axis it is x`, () => {
const wrapper = mount({
components: { WSpread },
props: {
axis: 'x',
transition: 'all 250s 250ss ease',
},
template: `
<div>
<WSpread :transition="transition" axis="x">
<span>Hello</span>
</WSpread>
</div>
`,
})
expect(wrapper.html()).toMatchSnapshot()
})
it(`Should be render correctly with children and axis it is y`, () => {
const wrapper = mount({
components: { WSpread },
props: {
axis: 'y',
transition: 'all 250s 250ss ease',
},
template: `
<div>
<WSpread :transition="transition" axis="y">
<span>Hello</span>
</WSpread>
</div>
`,
})
expect(wrapper.html()).toMatchSnapshot()
})
})