diff --git a/src/action-sheet/test/index.spec.js b/src/action-sheet/test/index.spec.js index f1b147d4a..a56b9c82f 100644 --- a/src/action-sheet/test/index.spec.js +++ b/src/action-sheet/test/index.spec.js @@ -1,4 +1,4 @@ -import { mount } from '../../../test/utils'; +import { mount, later } from '../../../test/utils'; import ActionSheet from '..'; test('callback events', () => { @@ -41,7 +41,7 @@ test('callback events', () => { expect(wrapper).toMatchSnapshot(); }); -test('click overlay and close', () => { +test('click overlay and close', async () => { const onInput = jest.fn(); const onClickOverlay = jest.fn(); const div = document.createElement('div'); @@ -71,6 +71,8 @@ test('click overlay and close', () => { } }); + await later(); + div.querySelector('.van-overlay').click(); expect(onInput).toHaveBeenCalledWith(false); expect(onClickOverlay).toHaveBeenCalledTimes(1); diff --git a/src/dropdown-menu/test/__snapshots__/index.spec.js.snap b/src/dropdown-menu/test/__snapshots__/index.spec.js.snap index 4c0a26080..fe1604393 100644 --- a/src/dropdown-menu/test/__snapshots__/index.spec.js.snap +++ b/src/dropdown-menu/test/__snapshots__/index.spec.js.snap @@ -5,7 +5,8 @@ exports[`click option 1`] = `
B
B
-