-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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 jest config for ui package, convert Button tests to ts and fix existing assertions #13580
Conversation
… fix existing assertions
@brandongregoryscott is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…ing when wrapped by Link
it("shouldn't crash when wrapped with next/link", () => { | ||
expect(() => | ||
render( | ||
<Link href="https://supabase.com"> |
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.
This test was failing before the change to the ref - doesn't seem related to passing a custom element with the as
prop as originally theorized in #13540 (comment)
Hey @brandongregoryscott ! had a look at this — your ui tests look good! But studio tests are failing on this branch. Any ideas? |
Hey @saltcod - the studio tests are passing for me locally. Looks like they failed in Github Actions but not for the same reason (JavaScript heap error) Edit: Alright, seeing the same heap errors on my fork. Might be a resource limitation I'm not seeing on my local machine. Let me take another look at these. I'm seeing it happen on the latest
|
Following-up: The heap issue was happening on my fork off of the fresh |
What kind of change does this PR introduce?
Chore - reinstates tests for the
ui
package.What is the current behavior?
See #13540 (comment) - it sounds like tests were started at some point (maybe in the https://github.com/supabase/ui repo) but weren't maintained once ported back into the monorepo.
What is the new behavior?
This PR adds a minimal jest config + refactors the
Button
component tests to pass based on its current code. It also adds a Github Action for running the tests in thepackages/ui
directory when any file in it changes.Additional context
In an effort to keep this PR smaller and incrementally reinstate test suites / add new ones, I restricted the
testRegex
to just *.test.tsx files. I left a comment in the config file on why, but the existing tests are likely going to need some refactoring to pass anyway.This PR also introduces a change to the way the
Button
component exposes its ref, since it was causing issues when wrapped with the NextLink
component - I added a test for this as well. It's kinda hard to tell where/if the current ref was being used, but I think this should work.