mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 11:32:52 +08:00
Use snapshot test for grid
This commit is contained in:
parent
2437ca419e
commit
6acf6fc643
13
components/grid/__tests__/__snapshots__/index.test.js.snap
Normal file
13
components/grid/__tests__/__snapshots__/index.test.js.snap
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`Grid should render Col 1`] = `
|
||||||
|
<div
|
||||||
|
class="ant-col-2"
|
||||||
|
/>
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`Grid should render Row 1`] = `
|
||||||
|
<div
|
||||||
|
class="ant-row"
|
||||||
|
/>
|
||||||
|
`;
|
@ -1,20 +1,18 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import TestUtils from 'react-dom/test-utils';
|
import { render } from 'enzyme';
|
||||||
import { Col, Row } from '..';
|
import { Col, Row } from '..';
|
||||||
|
|
||||||
describe('Grid', () => {
|
describe('Grid', () => {
|
||||||
it('should render Col', () => {
|
it('should render Col', () => {
|
||||||
const col = TestUtils.renderIntoDocument(
|
const wrapper = render(
|
||||||
<Col span="2" />
|
<Col span="2" />
|
||||||
);
|
);
|
||||||
const colNode = TestUtils.findRenderedDOMComponentWithTag(col, 'DIV');
|
expect(wrapper).toMatchSnapshot();
|
||||||
expect(colNode.className).toBe('ant-col-2');
|
|
||||||
});
|
});
|
||||||
it('should render Row', () => {
|
it('should render Row', () => {
|
||||||
const row = TestUtils.renderIntoDocument(
|
const wrapper = render(
|
||||||
<Row />
|
<Row />
|
||||||
);
|
);
|
||||||
const rowNode = TestUtils.findRenderedDOMComponentWithTag(row, 'DIV');
|
expect(wrapper).toMatchSnapshot();
|
||||||
expect(rowNode.className).toBe('ant-row');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user