[bugfix] Popup: ensure z-index setting order (#4026)

This commit is contained in:
neverland
2019-08-02 10:41:40 +08:00
committed by GitHub
parent d3b214a402
commit ff85de854c
6 changed files with 45 additions and 41 deletions

View File

@@ -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);