提交 7f2bdb75 编写于 作者: Z zombiej

test: fix test case

上级 83152628
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();
......
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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册