Closed akmittal closed 9 months ago
akmittal is not a collaborator of the repo
Thanks a lot for this PR @akmittal!
I've left a few comments and it would also be good to add a few tests:
- Check that the portal is not opened until the delay time.
- Check that blur before the delay time cancels the timeout.
- Check that setting the delay to
0
causes the tooltip to appear instantly.To write those tests you will need to use Jest's fake timers.
Thanks for reviewing. I have resolved review comments. Unit tests are also complete. please re-review @huwshimi
This is looking great. One last issue: when the tests run they have an error
Warning: An update to Tooltip inside a test was not wrapped in act(...)
on most of the tests. To fix this you'll need to wrap the events that open the tooltip inawait act(async ...)
eg.await act(async () => { await user.hover(screen.getByRole("button", { name: "Child" })); });
Completed the changes as suggested
@akmittal thanks a lot for those fixes. The test run is showing some more act() warnings: https://github.com/canonical/react-components/actions/runs/6961479419/job/18948453606?pr=998#step:7:9.
I really appreciate you're work on this PR, it's very close to being complete, but I'm happy to fix up those act calls if you'd like me to.
@akmittal thanks a lot for those fixes. The test run is showing some more act() warnings: https://github.com/canonical/react-components/actions/runs/6961479419/job/18948453606?pr=998#step:7:9.
I really appreciate you're work on this PR, it's very close to being complete, but I'm happy to fix up those act calls if you'd like me to.
Yes please go ahead
Done
QA
Storybook
To see rendered examples of all react-components, run:
QA in your project
from
react-components
run:Install the resulting tarball in your project with:
QA steps
Fixes
Fixes: #975 .