2019-01-12 11:33:27 +08:00
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
import { Col, Row } from '..';
|
2020-03-07 19:45:13 +08:00
|
|
|
import mountTest from '../../../tests/shared/mountTest';
|
2018-05-19 17:50:22 +08:00
|
|
|
|
|
|
|
describe('Grid', () => {
|
2020-03-07 19:45:13 +08:00
|
|
|
mountTest(Row);
|
|
|
|
mountTest(Col);
|
2018-05-19 17:50:22 +08:00
|
|
|
it('should render Col', () => {
|
|
|
|
const wrapper = mount(Col, {
|
2020-06-29 09:54:03 +08:00
|
|
|
props: {
|
2018-05-19 17:50:22 +08:00
|
|
|
span: 2,
|
|
|
|
},
|
2019-01-12 11:33:27 +08:00
|
|
|
});
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
2018-05-19 17:50:22 +08:00
|
|
|
it('should render Row', () => {
|
2019-01-12 11:33:27 +08:00
|
|
|
const wrapper = mount(Row);
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
2018-12-09 10:58:50 +08:00
|
|
|
|
|
|
|
it('renders wrapped Col correctly', () => {
|
|
|
|
const wrapper = mount({
|
2019-01-12 11:33:27 +08:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<Row gutter={20}>
|
|
|
|
<div>
|
2019-09-10 21:54:22 +08:00
|
|
|
<Col span={12} />
|
2019-01-12 11:33:27 +08:00
|
|
|
</div>
|
2019-09-10 21:54:22 +08:00
|
|
|
<Col span={12} />
|
2019-01-12 11:33:27 +08:00
|
|
|
</Row>
|
|
|
|
);
|
2018-12-09 10:58:50 +08:00
|
|
|
},
|
2019-01-12 11:33:27 +08:00
|
|
|
});
|
|
|
|
expect(wrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|