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

test(Migration to RTL): Refactor ChartTable.test.tsx from Enzyme to RTL #27429

Conversation

rtexelm
Copy link
Member

@rtexelm rtexelm commented Mar 7, 2024

SUMMARY

Replace enzyme with RTL functions. Refactor the tests accordingly. Added a test for the mine tab.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

npm test ChartTable.test.tsx

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

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.37%. Comparing base (b1adede) to head (972a78b).
Report is 1431 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #27429   +/-   ##
=======================================
  Coverage   67.36%   67.37%           
=======================================
  Files        1909     1909           
  Lines       74670    74678    +8     
  Branches     8324     8325    +1     
=======================================
+ Hits        50304    50311    +7     
- Misses      22315    22317    +2     
+ Partials     2051     2050    -1     
Flag Coverage Δ
javascript 57.22% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rtexelm
Copy link
Member Author

rtexelm commented Mar 8, 2024

@justinpark could you take a look at this one when you have a moment?

handler({} as any);
}
await renderChartTable(mockedProps);
fireEvent.click(screen.getByText(/favorite/i));
Copy link
Member

@geido geido Mar 11, 2024

Choose a reason for hiding this comment

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

Let's use userEvent instead as suggested in the wiki

Copy link
Member Author

@rtexelm rtexelm Mar 11, 2024

Choose a reason for hiding this comment

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

@justinpark curious what should be the go-to usage, fireEvent or userEvent, as you mentioned we should save userEvent for special cases but this seems to go against the RTL wiki and docs

Copy link
Member Author

Choose a reason for hiding this comment

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

@justinpark sent this article . Switching to userEvent

@geido
Copy link
Member

geido commented Mar 11, 2024

@rtexelm can we follow the best practices for Jest and RTL from the wiki? Avoid nesting, the usage of test instead of it, etc. these are all good to have. Thank you!

@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 11, 2024
@rtexelm rtexelm force-pushed the test/to-rtl-src-features-home-charttable-test/sc-79135 branch from 46d440f to 972a78b Compare March 11, 2024 23:46
Copy link
Member

@justinpark justinpark left a comment

Choose a reason for hiding this comment

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

LGTM

@geido geido merged commit 85d0d88 into apache:master Mar 12, 2024
27 checks passed
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants