import React from 'react'; import Space from '..'; import { render } from '../../../tests/utils'; jest.mock('../../_util/styleChecker', () => ({ canUseDocElement: () => true, isStyleSupport: () => true, })); describe('flex gap', () => { it('should render width empty children', () => { const { container } = render( , ); expect(container.querySelector('div.ant-space')).toHaveClass( 'ant-space-gap-row-small', ); expect(container.querySelector('div.ant-space')).toHaveClass( 'ant-space-gap-col-small', ); }); it('should size work', () => { const { container } = render( test , ); const element = container.querySelector('div.ant-space'); expect(element).toHaveStyle({ rowGap: '10px', columnGap: '10px' }); }); it('should NaN work', () => { expect(() => { render( test , ); }).not.toThrow(); }); });