2021-02-01 10:15:39 +08:00
|
|
|
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,
|
2021-02-03 15:39:51 +08:00
|
|
|
detectFlexGapSupported: () => true,
|
2021-02-01 10:15:39 +08:00
|
|
|
}));
|
|
|
|
|
|
|
|
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',
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|