-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update @ariakit/react to v0.3.12 and @ariakit/test to v0.3.7 #57547
Conversation
Size Change: -31 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
A few unit tests broke — it looks like the failures are related to keyboard focus. I'll look into it |
The issues seemed related to the general incompatibility between This PR is (once again) ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thanks 👍
I've left a couple of questions, but I don't see any blockers to shipping.
🚀
await hover( document.body ); | ||
await hover( document.body, { clientX: 10, clientY: 10 } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need two hover
calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is something that I derived from looking at how ariakit tests are written, and it is used to simulate hovering outside an element. I refactored it to a separate utility function to better clarify. ec59f15
(#57547)
await waitFor( () => | ||
expect( | ||
screen.queryByRole( 'tooltip', { | ||
name: 'Click for Delicious Gnocchi', | ||
} ) | ||
).not.toBeInTheDocument() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is waitForElementToBeRemoved()
a better possible alternative here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not, because it turns out that there is no need to wait for it — the tooltip gets removed immediately, so I refactored the code and removed the waitFor
altogether. I also took the chance to refine some tooltip-related tests in ToggleGroupControl
to actually test that the tooltip doesn't show even after its default delay has passed 428809b
Does this mean the failures couldn't be replicated when manually tested in the browser? |
06639c4
to
428809b
Compare
Exactly. I couldn't replicate failures in the browser. On top of that, those tests were flaky — sometimes they would pass, sometimes they would fail, also based on which specific tests are running. |
What?
Update
@ariakit/*
dependencies to latest versionWhy?
We should keep our dependencies up to date to enjoy of the recent features and bug fixes. We should also update frequently to make sure that each update is quick and easier to test.
How?
As per the docs:
package.json
filesnpm run distclean && npm install
npm run distclean && npm install
Testing Instructions
From the official CHANGELOG, there are no breaking changes highlighted since the previous version (
0.3.10
).Most of the items seem to be related to the
Combobox
component (which we don't use); here are the items that could be potentially relevant to our repository:Our ariakit-based components should be relatively well tested, so I assume that a good smoke test in Storybook and in the editor should be enough.