ant-design/tests/__mocks__/rc-trigger.js
二货机器人 2df11184f4
test: Demo check popup content (#33378)
* auto demo

* chore: update demo snapshot

* fix: trigger mock ref logic

* chore: try 2 test case

* chore: more snapshot

* chore: update snapshot

* chore: fix ts

* chore: split test

* test: Update test case

* chore: fix test order
2021-12-23 11:51:10 +08:00

9 lines
353 B
JavaScript

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