mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +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 TestUtils from 'react-dom/test-utils';
|
||||
import { render } from 'enzyme';
|
||||
import { Col, Row } from '..';
|
||||
|
||||
describe('Grid', () => {
|
||||
it('should render Col', () => {
|
||||
const col = TestUtils.renderIntoDocument(
|
||||
const wrapper = render(
|
||||
<Col span="2" />
|
||||
);
|
||||
const colNode = TestUtils.findRenderedDOMComponentWithTag(col, 'DIV');
|
||||
expect(colNode.className).toBe('ant-col-2');
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
it('should render Row', () => {
|
||||
const row = TestUtils.renderIntoDocument(
|
||||
const wrapper = render(
|
||||
<Row />
|
||||
);
|
||||
const rowNode = TestUtils.findRenderedDOMComponentWithTag(row, 'DIV');
|
||||
expect(rowNode.className).toBe('ant-row');
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user