ant-design/tests/__mocks__/rc-trigger.js
dingkang 1ef45439d6
test: replace Cascader test case with test library (#36475)
* test: relpace test case with test library

* test: fix test case

* test: replace snapshot

Co-authored-by: 二货机器人 <smith3816@gmail.com>
2022-07-26 22:27:42 +08:00

10 lines
391 B
JavaScript

import * as React from 'react';
import Trigger from 'rc-trigger/lib/mock';
import { TriggerMockContext } from '../shared/demoTestContext';
export default React.forwardRef((props, ref) => {
const mergedPopupVisible = React.useContext(TriggerMockContext) ?? props.popupVisible;
global.triggerProps = props;
return <Trigger {...props} ref={ref} popupVisible={mergedPopupVisible} />;
});