chore: rename all legacy test cases

This commit is contained in:
chenjiahan
2020-10-13 16:56:11 +08:00
parent ec943578b2
commit f2b6f3d4d1
133 changed files with 0 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
import { mount } from '../../../test';
test('click grid item', () => {
const onClick = jest.fn();
const wrapper = mount({
template: `
<van-grid>
<van-grid-item @click="onClick" />
</van-grid>
`,
methods: {
onClick,
},
});
const Item = wrapper.find('.van-grid-item__content');
Item.trigger('click');
expect(onClick).toHaveBeenCalledTimes(1);
});
test('sqaure and set gutter', () => {
const wrapper = mount({
template: `
<van-grid square :column-num="2" gutter="10rem">
<van-grid-item />
<van-grid-item />
<van-grid-item />
</van-grid>
`,
});
expect(wrapper).toMatchSnapshot();
});
test('icon-size prop', () => {
const wrapper = mount({
template: `
<van-grid icon-size="10">
<van-grid-item icon="success" />
</van-grid>
`,
});
expect(wrapper).toMatchSnapshot();
});
test('render icon-slot', () => {
const wrapper = mount({
template: `
<van-grid icon-size="10">
<van-grid-item badge="1">
<template #icon>
<div>Custom Icon</div>
</template>
</van-grid-item>
</van-grid>
`,
});
expect(wrapper).toMatchSnapshot();
});