Skip to content

Commit 276e4ec

Browse files
committed
test: update snap
1 parent 1cd6e94 commit 276e4ec

File tree

6 files changed

+53
-54
lines changed

6 files changed

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

3-
exports[`Radio should render correctly 1`] = `<label class="ant-radio-wrapper customized"><span class="ant-radio"><input type="radio" class="ant-radio-input" value=""><span class="ant-radio-inner"></span></span><span>Test</span></label>`;
3+
exports[`Radio should render correctly 1`] = `<label class="ant-radio-wrapper customized"><span class="ant-radio"><input type="radio" class="ant-radio-input"><span class="ant-radio-inner"></span></span><span>Test</span></label>`;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`Select Select Custom Icons should support customized icons 1`] = `
66
<!---->
77
<div class="ant-select-selector"><span class="ant-select-selection-search"><input id="rc_select_TEST_OR_SSR" autocomplete="off" class="ant-select-selection-search-input" style="opacity: 0;" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0" readonly="" unselectable="on" type="search"></span>
88
<!----><span class="ant-select-selection-placeholder"><!----></span>
9-
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896" focusable="false"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
9+
</div><span class="ant-select-arrow" style="user-select: none;" unselectable="on" aria-hidden="true"><span role="img" aria-label="down" class="anticon anticon-down ant-select-suffix"><svg focusable="false" class="" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></span></span>
1010
<!---->
1111
</div>
1212
`;

components/select/__tests__/index.test.js

+41-25
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ describe('Select', () => {
2929
});
3030

3131
it('should have default notFoundContent', async () => {
32-
const wrapper = mount(Select, {
33-
props: {
34-
mode: 'multiple',
32+
const wrapper = mount(
33+
{
34+
render() {
35+
return <Select mode="multiple" />;
36+
},
3537
},
36-
sync: false,
37-
attachTo: 'body',
38-
});
38+
{
39+
sync: false,
40+
attachTo: 'body',
41+
},
42+
);
3943
await asyncExpect(() => {
4044
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
4145
});
@@ -47,14 +51,17 @@ describe('Select', () => {
4751
});
4852

4953
it('should support set notFoundContent to null', async () => {
50-
const wrapper = mount(Select, {
51-
props: {
52-
mode: 'multiple',
53-
notFoundContent: null,
54+
const wrapper = mount(
55+
{
56+
render() {
57+
return <Select mode="multiple" notFoundContent={null} />;
58+
},
5459
},
55-
sync: false,
56-
attachTo: 'body',
57-
});
60+
{
61+
sync: false,
62+
attachTo: 'body',
63+
},
64+
);
5865
await asyncExpect(() => {
5966
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
6067
});
@@ -65,13 +72,17 @@ describe('Select', () => {
6572
});
6673

6774
it('should not have default notFoundContent when mode is combobox', async () => {
68-
const wrapper = mount(Select, {
69-
props: {
70-
mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE,
75+
const wrapper = mount(
76+
{
77+
render() {
78+
return <Select mode={Select.SECRET_COMBOBOX_MODE_DO_NOT_USE} />;
79+
},
7180
},
72-
sync: false,
73-
attachTo: 'body',
74-
});
81+
{
82+
sync: false,
83+
attachTo: 'body',
84+
},
85+
);
7586
await asyncExpect(() => {
7687
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
7788
});
@@ -82,13 +93,18 @@ describe('Select', () => {
8293
});
8394

8495
it('should not have notFoundContent when mode is combobox and notFoundContent is set', async () => {
85-
const wrapper = mount(Select, {
86-
props: {
87-
mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE,
88-
notFoundContent: 'not at all',
96+
const wrapper = mount(
97+
{
98+
render() {
99+
return (
100+
<Select mode={Select.SECRET_COMBOBOX_MODE_DO_NOT_USE} notFoundContent="not at all" />
101+
);
102+
},
89103
},
90-
sync: false,
91-
});
104+
{
105+
sync: false,
106+
},
107+
);
92108
await asyncExpect(() => {
93109
wrapper.findAll('.ant-select-selector')[0].element.dispatchEvent(new MouseEvent('mousedown'));
94110
});

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
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">
5-
<div class="ant-space-item" style="margin-right: 8px;">text1</div>
6-
<div class="ant-space-item" style="margin-right: 8px;"><span>text1</span></div>
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>
6+
<!---->
7+
<div class="ant-space-item"><span>text1</span></div>
8+
<!---->
79
<div class="ant-space-item">text3</div>
10+
<!---->
811
</div>
912
`;
1013

components/space/__tests__/index.test.js

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

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

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

components/statistic/__tests__/index.test.js

-19
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,6 @@ describe('Statistic', () => {
8888
expect(wrapper.find('.ant-statistic-content-value').text()).toEqual(value);
8989
});
9090
});
91-
92-
it('time going', async () => {
93-
const now = Date.now() + 1000;
94-
const props = {
95-
props: {
96-
value: now,
97-
},
98-
};
99-
const wrapper = mount(Statistic.Countdown, props);
100-
101-
// setInterval should work
102-
const instance = wrapper.vm;
103-
expect(instance.countdownId).not.toBe(undefined);
104-
105-
// await delay(50);
106-
107-
// wrapper.unmount();
108-
// expect(instance.countdownId).toBe(undefined);
109-
});
11091
});
11192
describe('utils', () => {
11293
it('format should support escape', () => {

0 commit comments

Comments
 (0)