Skip to content

Commit 40c4b80

Browse files
committed
test: udpate space test
1 parent e64fb33 commit 40c4b80

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

components/space/__tests__/__snapshots__/index.test.js.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Space should render correct with children 1`] = `
4-
<div class="ant-space ant-space-horizontal ant-space-align-center" style="column-gap: 8px; row-gap: 8px;">
5-
<div class="ant-space-item">text1</div>
4+
<div class="ant-space ant-space-horizontal ant-space-align-center">
5+
<div class="ant-space-item" style="margin-right: 8px;">text1</div>
66
<!---->
7-
<div class="ant-space-item"><span>text1</span></div>
7+
<div class="ant-space-item" style="margin-right: 8px;"><span>text1</span></div>
88
<!---->
99
<div class="ant-space-item">text3</div>
1010
<!---->

components/space/__tests__/index.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('Space', () => {
2525
);
2626
},
2727
});
28-
expect(wrapper.find('.ant-space').element.style.columnGap).toBe('10px');
29-
expect(wrapper.find('.ant-space').element.style.rowGap).toBe('10px');
28+
expect(wrapper.findAll('.ant-space-item')[0].element.style.marginRight).toBe('10px');
29+
expect(wrapper.findAll('.ant-space-item')[1].element.style.marginRight).toBe('');
3030
});
3131

3232
it('should render vertical space width customize size', () => {
@@ -40,8 +40,8 @@ describe('Space', () => {
4040
);
4141
},
4242
});
43-
expect(wrapper.find('.ant-space').element.style.columnGap).toBe('10px');
44-
expect(wrapper.find('.ant-space').element.style.rowGap).toBe('10px');
43+
expect(wrapper.findAll('.ant-space-item')[0].element.style.marginBottom).toBe('10px');
44+
expect(wrapper.findAll('.ant-space-item')[1].element.style.marginBottom).toBe('');
4545
});
4646

4747
it('should render correct with children', () => {

0 commit comments

Comments
 (0)