cloud-ui.vusion
Version:
Vusion Cloud UI
266 lines (197 loc) • 7.48 kB
JavaScript
/**
* 以下测试用例根据 docs/*.md 自动生成,请勿修改和提交!!!
*/
import { mount, createLocalVue } from '@vue/test-utils';
import VueRouter from 'vue-router'
import Demo1 from './__demos__/demo1.vue';
import Demo2 from './__demos__/demo2.vue';
import Demo3 from './__demos__/demo3.vue';
import Demo4 from './__demos__/demo4.vue';
import Demo5 from './__demos__/demo5.vue';
import Demo6 from './__demos__/demo6.vue';
import Demo7 from './__demos__/demo7.vue';
import Demo8 from './__demos__/demo8.vue';
import Demo9 from './__demos__/demo9.vue';
import Demo10 from './__demos__/demo10.vue';
import Demo11 from './__demos__/demo11.vue';
import Demo12 from './__demos__/demo12.vue';
import Demo13 from './__demos__/demo13.vue';
import Demo14 from './__demos__/demo14.vue';
import Demo15 from './__demos__/demo15.vue';
import Demo16 from './__demos__/demo16.vue';
import Demo17 from './__demos__/demo17.vue';
import Demo18 from './__demos__/demo18.vue';
import Demo19 from './__demos__/demo19.vue';
import Demo20 from './__demos__/demo20.vue';
import Demo21 from './__demos__/demo21.vue';
import Demo22 from './__demos__/demo22.vue';
import Demo23 from './__demos__/demo23.vue';
import Demo24 from './__demos__/demo24.vue';
import Demo25 from './__demos__/demo25.vue';
import Demo26 from './__demos__/demo26.vue';
import Demo27 from './__demos__/demo27.vue';
import Demo28 from './__demos__/demo28.vue';
import Demo29 from './__demos__/demo29.vue';
import Demo30 from './__demos__/demo30.vue';
import Demo31 from './__demos__/demo31.vue';
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const localVue = createLocalVue()
localVue.use(VueRouter)
const router = new VueRouter()
describe('u-tabs.vue', () => {
it('Demo-基本用法', async () => {
const wrapper = mount(Demo1, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-动态数据源', async () => {
const wrapper = mount(Demo2, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-外观-方形卡片(默认)', async () => {
const wrapper = mount(Demo3, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-外观-圆形卡片(默认)', async () => {
const wrapper = mount(Demo4, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-外观-线条导航', async () => {
const wrapper = mount(Demo5, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-外观-胶囊导航', async () => {
const wrapper = mount(Demo6, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-外观-文本形态', async () => {
const wrapper = mount(Demo7, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-随机添加测试', async () => {
const wrapper = mount(Demo8, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-text', async () => {
const wrapper = mount(Demo9, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-capsule', async () => {
const wrapper = mount(Demo10, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-square', async () => {
const wrapper = mount(Demo11, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-round', async () => {
const wrapper = mount(Demo12, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-line', async () => {
const wrapper = mount(Demo13, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-添加', async () => {
const wrapper = mount(Demo14, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-动态数据渲染', async () => {
const wrapper = mount(Demo15, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-使用to', async () => {
const wrapper = mount(Demo16, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-使用tdestination', async () => {
const wrapper = mount(Demo17, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-使用 value 控制', async () => {
const wrapper = mount(Demo18, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-动态数据渲染', async () => {
const wrapper = mount(Demo19, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-路由', async () => {
const wrapper = mount(Demo20, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-默认显示和可关闭', async () => {
const wrapper = mount(Demo21, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-方形卡片(默认)', async () => {
const wrapper = mount(Demo22, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-圆形卡片(默认)', async () => {
const wrapper = mount(Demo23, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-线条导航', async () => {
const wrapper = mount(Demo24, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-胶囊导航', async () => {
const wrapper = mount(Demo25, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-文本形态', async () => {
const wrapper = mount(Demo26, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-竖线分割', async () => {
const wrapper = mount(Demo27, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-禁用状态', async () => {
const wrapper = mount(Demo28, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-可关闭', async () => {
const wrapper = mount(Demo29, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-标签页较多的情形', async () => {
const wrapper = mount(Demo30, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-插槽扩展', async () => {
const wrapper = mount(Demo31, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
})