2016-12-14 14:48:09 +08:00
|
|
|
import React from 'react';
|
2017-09-15 10:56:00 +08:00
|
|
|
import { render } from 'enzyme';
|
2016-12-14 14:48:09 +08:00
|
|
|
import { Col, Row } from '..';
|
|
|
|
|
|
|
|
describe('Grid', () => {
|
|
|
|
it('should render Col', () => {
|
2018-12-07 20:02:01 +08:00
|
|
|
const wrapper = render(<Col span="2" />);
|
2017-09-15 10:56:00 +08:00
|
|
|
expect(wrapper).toMatchSnapshot();
|
2016-12-14 14:48:09 +08:00
|
|
|
});
|
2018-09-21 19:30:39 +08:00
|
|
|
|
2016-12-14 14:48:09 +08:00
|
|
|
it('should render Row', () => {
|
2018-12-07 20:02:01 +08:00
|
|
|
const wrapper = render(<Row />);
|
2017-09-15 10:56:00 +08:00
|
|
|
expect(wrapper).toMatchSnapshot();
|
2016-12-14 14:48:09 +08:00
|
|
|
});
|
2018-09-21 19:30:39 +08:00
|
|
|
|
|
|
|
it('renders wrapped Col correctly', () => {
|
|
|
|
const MyCol = () => <Col span="12" />;
|
|
|
|
const wrapper = render(
|
|
|
|
<Row gutter={20}>
|
|
|
|
<div>
|
|
|
|
<Col span="12" />
|
|
|
|
</div>
|
|
|
|
<MyCol />
|
2018-12-07 20:02:01 +08:00
|
|
|
</Row>,
|
2018-09-21 19:30:39 +08:00
|
|
|
);
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
2016-12-14 14:48:09 +08:00
|
|
|
});
|