test: update cases for Grid.Row

This commit is contained in:
zy410419243 2019-03-04 11:49:29 +08:00
parent 0a78070b08
commit 28a82f8f09

View File

@ -62,4 +62,16 @@ describe('Grid', () => {
);
expect(wrapper).toMatchSnapshot();
});
it('when component has been unmounted, componentWillUnmount should be called', () => {
const wrapper = mount(<Row />);
const willUnmount = jest.spyOn(wrapper.instance(), 'componentWillUnmount');
wrapper.unmount();
expect(willUnmount).toHaveBeenCalled();
});
it('when typeof getGutter is object', () => {
const wrapper = mount(<Row gutter={{ xs: 8, sm: 16, md: 24 }} />).instance();
expect(wrapper.getGutter()).toBe(8);
});
});