-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
chore: Add disclosure-animated
example
#981
Conversation
This pull request is being automatically deployed with Vercel (learn more). ariakit – ./🔍 Inspect: https://vercel.com/ariakit/ariakit/4CXXCRWtStgeRPsbF34xfKG3X1dD reakit – ./🔍 Inspect: https://vercel.com/ariakit/reakit/8ctKitoLVZGKL7vEbcYoWT2GAnHX [Deployment for 043d702 canceled] |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
It's okay not to use Tailwind for animations here. I think it would add specific |
Codecov Report
@@ Coverage Diff @@
## main #981 +/- ##
===========================================
- Coverage 80.73% 65.20% -15.53%
===========================================
Files 229 175 -54
Lines 5699 4294 -1405
Branches 1584 1176 -408
===========================================
- Hits 4601 2800 -1801
- Misses 1094 1493 +399
+ Partials 4 1 -3
Continue to review full report at Codecov.
|
Don't know if this is what you expected from an animated example :) Still learning all of this :) I tried to test the animation but it failed. It throws that content is visible, while it's not. I guessed it's because of the timeout delay and added a sleep function, but no effect. Here is what I did: const sleep = (ms:number) => new Promise((resolve) => setTimeout(resolve, ms))
test("show/hide on click", async () => {
render(<Example />);
expect(getContent()).not.toBeVisible();
expect(getDisclosure()).toHaveAttribute("aria-expanded", "false");
await click(getDisclosure());
expect(getContent()).toBeVisible();
expect(getDisclosure()).toHaveAttribute("aria-expanded", "true");
await click(getDisclosure());
await sleep(3000);
//Here it throws that content is still visible
expect(getContent()).not.toBeVisible();
expect(getDisclosure()).toHaveAttribute("aria-expanded", "false");
}); |
That's what matters! :)
I'm not sure if JSDOM supports animation, but that |
failed as well. I guess it won't be supported then await click(getDisclosure());
await waitFor(expect(getContent()).not.toBeVisible, {
timeout: 2000,
}); |
That's the case where we'll probably need e2e tests. I was thinking about adding e2e test support for examples as well (they could be |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 043d702:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I tried to use tailwinds transition utilities but they don't have an effect. I know you customized thetailwind.config
. Could it be that this disabled the transition & animation classes?