mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
[new feature] add skeleton component
This commit is contained in:
45
packages/skeleton/test/index.spec.js
Normal file
45
packages/skeleton/test/index.spec.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import { mount } from '../../../test/utils';
|
||||
import Skeleton from '..';
|
||||
|
||||
test('row-width array', () => {
|
||||
const wrapper = mount(Skeleton, {
|
||||
propsData: {
|
||||
row: 4,
|
||||
rowWidth: ['100%', 30, '5rem']
|
||||
}
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('render chidren', () => {
|
||||
const wrapper = mount({
|
||||
template: `
|
||||
<skeleton :loading="false">
|
||||
<div>Content</div>
|
||||
</skeleton>
|
||||
`,
|
||||
components: { Skeleton }
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('avatar shape', () => {
|
||||
const wrapper = mount(Skeleton, {
|
||||
propsData: {
|
||||
avatar: true,
|
||||
avatarSize: 20,
|
||||
avatarShape: 'square'
|
||||
}
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('disable animate', () => {
|
||||
const wrapper = mount(Skeleton, {
|
||||
propsData: {
|
||||
row: 1,
|
||||
aniamte: false
|
||||
}
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
Reference in New Issue
Block a user