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

Function RemovableTest

src/test/tooltip-edge-cases.spec.js:144–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142 test('tooltip handles active anchor being removed', async () => {
143 // Create a component where we'll remove the active anchor
144 const RemovableTest = () => {
145 const [showAnchor, setShowAnchor] = useState(true)
146
147 useEffect(() => {
148 // Remove the anchor after a delay
149 const timer = setTimeout(() => {
150 setShowAnchor(false)
151 }, 100)
152 return () => clearTimeout(timer)
153 }, [])
154
155 return (
156 <div>
157 {showAnchor && <span data-tooltip-id="removable-test">Hover Me</span>}
158 <TooltipController id="removable-test" content="Removable Test" />
159 </div>
160 )
161 }
162
163 // Render the component
164 render(<RemovableTest />)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected