mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 09:21:22 +08:00
a26e5036e6
* fix: only row gutter use gap * test: Update test case
30 lines
686 B
JavaScript
30 lines
686 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import { Col, Row } from '..';
|
|
// eslint-disable-next-line no-unused-vars
|
|
import * as styleChecker from '../../_util/styleChecker';
|
|
|
|
jest.mock('../../_util/styleChecker', () => ({
|
|
canUseDocElement: () => true,
|
|
isStyleSupport: () => true,
|
|
detectFlexGapSupported: () => true,
|
|
}));
|
|
|
|
describe('Grid.Gap', () => {
|
|
it('should use gap', () => {
|
|
const wrapper = mount(
|
|
<Row gutter={[16, 8]}>
|
|
<Col />
|
|
</Row>,
|
|
);
|
|
|
|
expect(wrapper.find('.ant-row').props().style).toEqual(
|
|
expect.objectContaining({
|
|
marginLeft: -8,
|
|
rowGap: 8,
|
|
marginRight: -8,
|
|
}),
|
|
);
|
|
});
|
|
});
|