cloud-ui.vusion
Version:
Vusion Cloud UI
98 lines (71 loc) • 2.64 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';
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const localVue = createLocalVue()
localVue.use(VueRouter)
const router = new VueRouter()
describe('u-toast.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-提示停留时间', async () => {
const wrapper = mount(Demo9, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
it('Demo-始终显示一条', async () => {
const wrapper = mount(Demo10, { localVue, router });
await sleep(16);
expect(wrapper).toMatchSnapshot();
});
})