ant-design/tests/__mocks__/rc-trigger.js
Wei Zhu 55c85f77a1
Update dependendies (#8150)
* deps: upgrade rc-menu, and close: #2837

* test: update snapshots

* Update rc-calendar

* Update rc-cascader

* Update rc-dialog

* Update dropdown

* Update rc-select@7.1.0

* Update rc-slider

* Update rc-time-picker

* Update rc-tooltip

* Update rc-tree-select

* Mock rc-trigger and Portal

* Fix animation warning when inlineCollapsed changes

* fix: should use SubMenu[popupClassName]

* Fix typescript error

* Fix lint

* fix: style for menu

* Mock rc-trigger for React 15

* Remvoe allow_failures
2017-11-11 00:07:03 +08:00

32 lines
718 B
JavaScript

import React from 'react';
let Trigger; // eslint-disable-line
if (process.env.REACT === '15') {
const ActualTrigger = require.requireActual('rc-trigger');
const render = ActualTrigger.prototype.render;
ActualTrigger.prototype.render = function () {
const { popupVisible } = this.state;
let component;
if (popupVisible || this._component) { // eslint-disable-line
component = this.getComponent();
}
return (
<div id="TriggerContainer">
{render.call(this)}
{component}
</div>
);
};
Trigger = ActualTrigger;
} else {
const TriggerMock = require('rc-trigger/lib/mock'); // eslint-disable-line
Trigger = TriggerMock;
}
export default Trigger;