mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
81aac069ac
* test: move test cases to testing-library for Grid * fix: test when typeof gutter is object array in large screen
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
// eslint-disable-next-line no-unused-vars
|
|
import { Col, Row } from '..';
|
|
import { render } from '../../../tests/utils';
|
|
|
|
jest.mock('rc-util/lib/Dom/canUseDom', () => () => false);
|
|
|
|
describe('Grid.Server', () => {
|
|
it('use compatible gap logic', () => {
|
|
const { container } = render(
|
|
<Row gutter={[8, 16]}>
|
|
<Col />
|
|
</Row>,
|
|
);
|
|
|
|
expect((container.querySelector('.ant-row') as HTMLElement)!.style.marginLeft).toEqual('-4px');
|
|
expect((container.querySelector('.ant-row') as HTMLElement)!.style.marginRight).toEqual('-4px');
|
|
expect((container.querySelector('.ant-row') as HTMLElement)!.style.marginTop).toEqual('-8px');
|
|
expect((container.querySelector('.ant-row') as HTMLElement)!.style.marginBottom).toEqual(
|
|
'-8px',
|
|
);
|
|
|
|
expect((container.querySelector('.ant-col') as HTMLElement)!.style.paddingLeft).toEqual('4px');
|
|
expect((container.querySelector('.ant-col') as HTMLElement)!.style.paddingRight).toEqual('4px');
|
|
expect((container.querySelector('.ant-col') as HTMLElement)!.style.paddingTop).toEqual('8px');
|
|
expect((container.querySelector('.ant-col') as HTMLElement)!.style.paddingBottom).toEqual(
|
|
'8px',
|
|
);
|
|
});
|
|
});
|