Skip to content

Commit 9ed7352

Browse files
committed
test: update test
1 parent 698b684 commit 9ed7352

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

components/auto-complete/__tests__/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('AutoComplete with Custom Input Element Render', () => {
2828
const input = wrapper.find('input');
2929
input.element.value = '123';
3030
input.trigger('input');
31-
await sleep();
31+
await sleep(100);
3232
expect($$('.ant-select-item-option').length).toBe(3);
3333
});
3434
});

components/calendar/__tests__/index.test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import dayjs from 'dayjs';
22
import { mount } from '@vue/test-utils';
3-
import { asyncExpect , sleep } from '../../../tests/utils';
3+
import { asyncExpect, sleep } from '../../../tests/utils';
44
import MockDate from 'mockdate';
55
import Calendar from '..';
66
import Header from '../Header';
@@ -37,7 +37,7 @@ describe('Calendar', () => {
3737
);
3838
await asyncExpect(() => {
3939
wrapper.findAll('.ant-picker-cell')[0].trigger('click');
40-
});
40+
}, 0);
4141
await asyncExpect(() => {
4242
expect(onSelect).toHaveBeenCalledWith(expect.anything());
4343
const value = onSelect.mock.calls[0][0];
@@ -141,11 +141,11 @@ describe('Calendar', () => {
141141
);
142142
await sleep();
143143
openSelect(wrapper, '.ant-picker-calendar-year-select');
144-
await sleep();
144+
await sleep(100);
145145
clickSelectItem(wrapper);
146146
await sleep();
147147
openSelect(wrapper, '.ant-picker-calendar-month-select');
148-
await sleep();
148+
await sleep(100);
149149
// 2 years and 11 months
150150
expect(wrapper.findAll('.ant-select-item-option').length).toBe(13);
151151
});
@@ -336,7 +336,7 @@ describe('Calendar', () => {
336336
);
337337
await sleep();
338338
openSelect(wrapper, '.ant-picker-calendar-month-select');
339-
await sleep();
339+
await sleep(100);
340340
clickSelectItem(wrapper);
341341
expect(onValueChange).toHaveBeenCalledWith(value.month(10));
342342
});

0 commit comments

Comments
 (0)