Skip to content
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(fe): migrate 4 Enzyme-based tests to RTL #31634

Merged
merged 5 commits into from
Feb 11, 2025

Conversation

hainenber
Copy link
Contributor

@hainenber hainenber commented Dec 27, 2024

chore(fe): migrate 4 Enzyme-based tests to RTL

SUMMARY

Part of ongoing effort to refactor away Enzyme-based unit test to RTL

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

The CI checks should all pass for this particular PR

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Signed-off-by: hainenber <dotronghai96@gmail.com>
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues... but I did find this rooster.

   \\
   (o>
\\_//)
 \_/_)
  _|_

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Naming
Database Operations
Documentation
Logging
Error Handling
Systems and Environment
Objects and Data Structures
Readability and Maintainability
Asynchronous Processing
Design Patterns
Third-Party Libraries
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

@hainenber hainenber changed the title chore(pkg/core): migrate 2 Enzyme-based tests in packages/superset-core to RTL chore(fe/pkg/core): migrate 2 Enzyme-based tests in packages/superset-core to RTL Dec 27, 2024
@rusackas rusackas requested a review from geido January 3, 2025 21:38
@rusackas
Copy link
Member

rusackas commented Jan 3, 2025

Running CI 🤞

@sadpandajoe sadpandajoe added review:checkpoint Last PR reviewed during the daily review standup and removed review:checkpoint Last PR reviewed during the daily review standup labels Jan 7, 2025
@hainenber
Copy link
Contributor Author

@rusackas I think the CI was failing due to Docker Hub token issue previously. Do you think it's worth another shot running? 👀

@rusackas
Copy link
Member

I think if you rebase the PR now, it'll work.

@hainenber
Copy link
Contributor Author

All green :D

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 24, 2025
@hainenber hainenber changed the title chore(fe/pkg/core): migrate 2 Enzyme-based tests in packages/superset-core to RTL chore(fe/pkg/core): migrate 4 Enzyme-based tests in packages/superset-core to RTL Jan 24, 2025
@hainenber hainenber changed the title chore(fe/pkg/core): migrate 4 Enzyme-based tests in packages/superset-core to RTL chore(fe): migrate 4 Enzyme-based tests to RTL Jan 24, 2025
@rusackas rusackas requested a review from justinpark January 28, 2025 00:11
@hainenber
Copy link
Contributor Author

re-bump :D

@rusackas
Copy link
Member

Hey hey! I'd forgotten about this PR, sorry!

I'm working on the same effort (killing enzyme) and have this PR going:
#32207

In your PR you get a couple of tests that I also worked on, but you have a couple I haven't gotten to yet.

It looks like your PR is failing CI on a Cypress test (our next nemesis!) - I just started a re-run of it to see if it passes now. If not, would you rather fix and merge your PR before I merge mine, or would you rather close this and I'll copy over your work on the tests I haven't converted yet?

@hainenber
Copy link
Contributor Author

funny thing is that the failed E2E test is due to non-Cypress issue 😆 . I'll be stand by to fix my changes if it's the case, btw

image

@hainenber
Copy link
Contributor Author

Let me rebase the branch to be up-to-date with master

import { triggerResizeObserver } from 'resize-observer-polyfill';
import { promiseTimeout, WithLegend } from '@superset-ui/core';
import { render } from '@testing-library/react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please import from spec/helpers/testing-library instead. Applies to all files - you won't need to import additional stuff like @testing-library/jest-dom

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hainenber can get that here, or (in theory) the linting rule on my PR should help sweep that up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotchu. Will push new fixes in around upcoming 5s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

superset-ui-core seems to be a tad different compared to others. I'm getting this

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed that in Evan also employed direct testing-library import in the PR :D

superset-ui-core is built different, I guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm can you try to add "../spec/**/*" to the include array in superset-ui-core/tsconfig.ts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path to spec might be different but you know what I mean 😄

@rusackas rusackas merged commit db70c79 into apache:master Feb 11, 2025
48 checks passed
@hainenber hainenber deleted the chores/migrate-enzyme-tests-to-rtl branch February 11, 2025 16:06
sfirke pushed a commit to sfirke/superset that referenced this pull request Feb 12, 2025
Signed-off-by: hainenber <dotronghai96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants