|
1 | 1 | import dayjs from 'dayjs'; |
2 | 2 | import { mount } from '@vue/test-utils'; |
3 | | -import { asyncExpect , sleep } from '../../../tests/utils'; |
| 3 | +import { asyncExpect, sleep } from '../../../tests/utils'; |
4 | 4 | import MockDate from 'mockdate'; |
5 | 5 | import Calendar from '..'; |
6 | 6 | import Header from '../Header'; |
@@ -37,7 +37,7 @@ describe('Calendar', () => { |
37 | 37 | ); |
38 | 38 | await asyncExpect(() => { |
39 | 39 | wrapper.findAll('.ant-picker-cell')[0].trigger('click'); |
40 | | - }); |
| 40 | + }, 0); |
41 | 41 | await asyncExpect(() => { |
42 | 42 | expect(onSelect).toHaveBeenCalledWith(expect.anything()); |
43 | 43 | const value = onSelect.mock.calls[0][0]; |
@@ -141,11 +141,11 @@ describe('Calendar', () => { |
141 | 141 | ); |
142 | 142 | await sleep(); |
143 | 143 | openSelect(wrapper, '.ant-picker-calendar-year-select'); |
144 | | - await sleep(); |
| 144 | + await sleep(100); |
145 | 145 | clickSelectItem(wrapper); |
146 | 146 | await sleep(); |
147 | 147 | openSelect(wrapper, '.ant-picker-calendar-month-select'); |
148 | | - await sleep(); |
| 148 | + await sleep(100); |
149 | 149 | // 2 years and 11 months |
150 | 150 | expect(wrapper.findAll('.ant-select-item-option').length).toBe(13); |
151 | 151 | }); |
@@ -336,7 +336,7 @@ describe('Calendar', () => { |
336 | 336 | ); |
337 | 337 | await sleep(); |
338 | 338 | openSelect(wrapper, '.ant-picker-calendar-month-select'); |
339 | | - await sleep(); |
| 339 | + await sleep(100); |
340 | 340 | clickSelectItem(wrapper); |
341 | 341 | expect(onValueChange).toHaveBeenCalledWith(value.month(10)); |
342 | 342 | }); |
|
0 commit comments