2022-08-16 10:14:41 +08:00
|
|
|
import React from 'react';
|
2023-09-05 10:17:56 +08:00
|
|
|
|
2022-08-16 10:14:41 +08:00
|
|
|
import { Col, Row } from '..';
|
|
|
|
import { render } from '../../../tests/utils';
|
|
|
|
|
2023-06-07 21:59:21 +08:00
|
|
|
jest.mock('rc-util/lib/Dom/canUseDom', () => () => false);
|
2022-08-16 10:14:41 +08:00
|
|
|
|
|
|
|
describe('Grid.Server', () => {
|
|
|
|
it('use compatible gap logic', () => {
|
|
|
|
const { container } = render(
|
|
|
|
<Row gutter={[8, 16]}>
|
|
|
|
<Col />
|
|
|
|
</Row>,
|
|
|
|
);
|
|
|
|
|
2023-09-05 10:17:56 +08:00
|
|
|
expect((container.querySelector('.ant-row') as HTMLElement)?.style.marginLeft).toBe('-4px');
|
|
|
|
expect((container.querySelector('.ant-row') as HTMLElement)?.style.marginRight).toBe('-4px');
|
|
|
|
expect((container.querySelector('.ant-row') as HTMLElement)?.style.marginTop).toBe('');
|
|
|
|
expect((container.querySelector('.ant-row') as HTMLElement)?.style.marginBottom).toBe('');
|
2022-08-16 10:14:41 +08:00
|
|
|
|
2023-09-05 10:17:56 +08:00
|
|
|
expect((container.querySelector('.ant-col') as HTMLElement)?.style.paddingLeft).toBe('4px');
|
|
|
|
expect((container.querySelector('.ant-col') as HTMLElement)?.style.paddingRight).toBe('4px');
|
|
|
|
expect((container.querySelector('.ant-col') as HTMLElement)?.style.paddingTop).toBe('');
|
|
|
|
expect((container.querySelector('.ant-col') as HTMLElement)?.style.paddingBottom).toBe('');
|
2022-08-16 10:14:41 +08:00
|
|
|
});
|
|
|
|
});
|