mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 06:09:34 +08:00
9914ceb6be
* fix: get flex gap support before render * chore: patch unit * chore: rename * test: fix test case
29 lines
678 B
JavaScript
29 lines
678 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({
|
|
'--column-gap': '16px',
|
|
'--row-gap': '8px',
|
|
}),
|
|
);
|
|
});
|
|
});
|