mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
refactor: info component
This commit is contained in:
32
src-next/info/test/index.spec.js
Normal file
32
src-next/info/test/index.spec.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import Info from '..';
|
||||
import { mount } from '../../../test';
|
||||
|
||||
test('should not render when info is empty string', () => {
|
||||
const wrapper = mount(Info, {
|
||||
propsData: {
|
||||
info: '',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should not render when info is empty undefined', () => {
|
||||
const wrapper = mount(Info, {
|
||||
propsData: {
|
||||
info: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should render when info is zero', () => {
|
||||
const wrapper = mount(Info, {
|
||||
propsData: {
|
||||
info: 0,
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
Reference in New Issue
Block a user