xrkffgg
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
0 deletions
-
components/space/__tests__/__snapshots__/index.test.js.snap
-
components/space/__tests__/index.test.js
|
|
@ -1,5 +1,7 @@ |
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP |
|
|
|
|
|
|
|
exports[`Space rtl render component should be rendered correctly in RTL direction 1`] = `null`; |
|
|
|
|
|
|
|
exports[`Space should render correct with children 1`] = ` |
|
|
|
<div |
|
|
|
class="ant-space ant-space-horizontal ant-space-align-center" |
|
|
|
|
|
@ -4,9 +4,11 @@ import { act } from 'react-test-renderer'; |
|
|
|
import Space from '..'; |
|
|
|
import ConfigProvider from '../../config-provider'; |
|
|
|
import mountTest from '../../../tests/shared/mountTest'; |
|
|
|
import rtlTest from '../../../tests/shared/rtlTest'; |
|
|
|
|
|
|
|
describe('Space', () => { |
|
|
|
mountTest(Space); |
|
|
|
rtlTest(Space); |
|
|
|
|
|
|
|
it('should render width empty children', () => { |
|
|
|
const wrapper = mount(<Space />); |
|
|
@ -47,6 +49,17 @@ describe('Space', () => { |
|
|
|
expect(wrapper.find('div.ant-space-item').at(1).prop('style').marginRight).toBeUndefined(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should render width size 0', () => { |
|
|
|
const wrapper = mount( |
|
|
|
<Space size={NaN}> |
|
|
|
<span>1</span> |
|
|
|
<span>2</span> |
|
|
|
</Space>, |
|
|
|
); |
|
|
|
|
|
|
|
expect(wrapper.find('div.ant-space-item').at(0).prop('style').marginRight).toBe(0); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should render vertical space width customize size', () => { |
|
|
|
const wrapper = mount( |
|
|
|
<Space size={10} direction="vertical"> |
|
|
|