diff --git a/components/auto-complete/__tests__/index.test.js b/components/auto-complete/__tests__/index.test.js index 835c832d5..14c4ffc60 100644 --- a/components/auto-complete/__tests__/index.test.js +++ b/components/auto-complete/__tests__/index.test.js @@ -28,7 +28,7 @@ describe('AutoComplete with Custom Input Element Render', () => { const input = wrapper.find('input'); input.element.value = '123'; input.trigger('input'); - await sleep(); + await sleep(100); expect($$('.ant-select-item-option').length).toBe(3); }); }); diff --git a/components/calendar/__tests__/index.test.js b/components/calendar/__tests__/index.test.js index 66225e893..fe41d8539 100644 --- a/components/calendar/__tests__/index.test.js +++ b/components/calendar/__tests__/index.test.js @@ -1,6 +1,6 @@ import dayjs from 'dayjs'; import { mount } from '@vue/test-utils'; -import { asyncExpect , sleep } from '../../../tests/utils'; +import { asyncExpect, sleep } from '../../../tests/utils'; import MockDate from 'mockdate'; import Calendar from '..'; import Header from '../Header'; @@ -37,7 +37,7 @@ describe('Calendar', () => { ); await asyncExpect(() => { wrapper.findAll('.ant-picker-cell')[0].trigger('click'); - }); + }, 0); await asyncExpect(() => { expect(onSelect).toHaveBeenCalledWith(expect.anything()); const value = onSelect.mock.calls[0][0]; @@ -141,11 +141,11 @@ describe('Calendar', () => { ); await sleep(); openSelect(wrapper, '.ant-picker-calendar-year-select'); - await sleep(); + await sleep(100); clickSelectItem(wrapper); await sleep(); openSelect(wrapper, '.ant-picker-calendar-month-select'); - await sleep(); + await sleep(100); // 2 years and 11 months expect(wrapper.findAll('.ant-select-item-option').length).toBe(13); }); @@ -336,7 +336,7 @@ describe('Calendar', () => { ); await sleep(); openSelect(wrapper, '.ant-picker-calendar-month-select'); - await sleep(); + await sleep(100); clickSelectItem(wrapper); expect(onValueChange).toHaveBeenCalledWith(value.month(10)); });