diff --git a/components/popover/__tests__/__snapshots__/demo.test.js.snap b/components/popover/__tests__/__snapshots__/demo.test.js.snap index f9d82fa3c0..860bc98ce3 100644 --- a/components/popover/__tests__/__snapshots__/demo.test.js.snap +++ b/components/popover/__tests__/__snapshots__/demo.test.js.snap @@ -43,6 +43,17 @@ exports[`renders ./components/popover/demo/control.md correctly 1`] = ` `; +exports[`renders ./components/popover/demo/hover-with-click.md correctly 1`] = ` + +`; + exports[`renders ./components/popover/demo/placement.md correctly 1`] = `
+ This is hover content. +
+); + +const clickContent = ( +
+ This is click content. +
+); + +const initalState = { + clicked: false, + hovered: false, +}; + +class App extends React.Component { + state = initalState; + + hide = () => { + this.setState({ + ...initalState, + }); + } + + handleHoverChange = (visible) => { + this.setState({ + hovered: visible, + clicked: false, + }); + } + + handleClickChange = (visible) => { + this.setState({ + clicked: visible, + hovered: false, + }); + } + + render() { + return ( + + Close]} + title="Click title" + trigger="click" + visible={this.state.clicked} + onVisibleChange={this.handleClickChange} + > + + + + ); + } +} + +ReactDOM.render(, mountNode); +````