mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
test: fix test case
This commit is contained in:
parent
8315262804
commit
7f2bdb7569
@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { spyElementPrototype } from 'rc-util/lib/test/domHook';
|
||||
import Popconfirm from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import { sleep } from '../../../tests/utils';
|
||||
@ -14,6 +15,12 @@ describe('Popconfirm', () => {
|
||||
preventDefault: expect.any(Function),
|
||||
});
|
||||
|
||||
beforeAll(() => {
|
||||
spyElementPrototype(HTMLElement, 'offsetParent', {
|
||||
get: () => ({}),
|
||||
});
|
||||
});
|
||||
|
||||
it('should popup Popconfirm dialog', () => {
|
||||
const onVisibleChange = jest.fn();
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { spyElementPrototype } from 'rc-util/lib/test/domHook';
|
||||
import Tooltip from '..';
|
||||
import Button from '../../button';
|
||||
import Switch from '../../switch';
|
||||
@ -15,6 +16,12 @@ describe('Tooltip', () => {
|
||||
mountTest(Tooltip);
|
||||
rtlTest(Tooltip);
|
||||
|
||||
beforeAll(() => {
|
||||
spyElementPrototype(HTMLElement, 'offsetParent', {
|
||||
get: () => ({}),
|
||||
});
|
||||
});
|
||||
|
||||
it('check `onVisibleChange` arguments', () => {
|
||||
const onVisibleChange = jest.fn();
|
||||
const ref = React.createRef();
|
||||
|
Loading…
Reference in New Issue
Block a user