refactor: info component

This commit is contained in:
chenjiahan
2020-07-04 22:38:53 +08:00
parent 79e7b4be65
commit 425ffb87eb
4 changed files with 91 additions and 0 deletions

View 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();
});