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

refactor(src/explore/comp/controls/metricControl): migrate Enzyme test to RTL syntax #29380

Conversation

hainenber
Copy link
Contributor

@hainenber hainenber commented Jun 26, 2024

SUMMARY

refactor(src/explore/comp/controls/metricControl): migrate Enzyme test to RTL syntax

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI checks are passed

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

@dosubot dosubot bot added explore Namespace | Anything related to Explore frontend:refactor Related to refactoring the frontend labels Jun 26, 2024
@rusackas rusackas requested a review from justinpark June 26, 2024 16:54
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @hainenber. I left some suggestions. Could you also convert this file to Typescript? It should be pretty straightforward.

const wrapper = setup({
option: { metric_name: 'a_saved_metric', expression: 'COUNT(*)' },
const renderMetricDefinitionOption = props => {
waitFor(() => {
Copy link
Member

Choose a reason for hiding this comment

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

This waitFor is not necessary as you are already waiting for the elements in your tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in HEAD :D

@hainenber
Copy link
Contributor Author

Thank you for the PR @hainenber. I left some suggestions. Could you also convert this file to Typescript? It should be pretty straightforward.

Converted to *.tsx but not sure if I need to define a proper prop type since it's for testing only 🤔

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 27, 2024
@hainenber
Copy link
Contributor Author

Thanks Michael for your lead, it's very helpful tip!

I committed all of your proposed change :D

@hainenber
Copy link
Contributor Author

Ouch, got a failed test in CI but looks like to be flaky one. I ran it successfully in my local machine

image

@rusackas
Copy link
Member

Re-running it... let's see what happens :)

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR and for addressing the comments @hainenber!

@michael-s-molina michael-s-molina merged commit a3f0d00 into apache:master Jun 28, 2024
34 checks passed
@hainenber hainenber deleted the migrate-to-rtl-for-metrics-def-opts-test branch June 28, 2024 16:22
eschutho pushed a commit that referenced this pull request Jul 24, 2024
…t to RTL syntax (#29380)

Signed-off-by: hainenber <[email protected]>
Co-authored-by: Michael S. Molina <[email protected]>
@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 explore Namespace | Anything related to Explore frontend:refactor Related to refactoring the frontend size/L 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants