MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / TestComponent

Function TestComponent

src/test/tooltip-imperative.spec.js:112–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111 test('tooltip with isOpen controlled prop', async () => {
112 const TestComponent = () => {
113 const [isOpen, setIsOpen] = React.useState(false)
114
115 return (
116 <>
117 <button onClick={() => setIsOpen(true)}>Open</button>
118 <button onClick={() => setIsOpen(false)}>Close</button>
119 <span data-tooltip-id="controlled-tooltip">Target</span>
120 <Tooltip
121 id="controlled-tooltip"
122 content="Controlled Tooltip"
123 isOpen={isOpen}
124 setIsOpen={setIsOpen}
125 />
126 </>
127 )
128 }
129
130 render(<TestComponent />)
131

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected