-
Notifications
You must be signed in to change notification settings - Fork 14.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
refactor(src/explore/comp/controls/metricControl): migrate Enzyme test to RTL syntax #29380
refactor(src/explore/comp/controls/metricControl): migrate Enzyme test to RTL syntax #29380
Conversation
…t to RTL Signed-off-by: hainenber <[email protected]>
Signed-off-by: hainenber <[email protected]>
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.
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(() => { |
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 waitFor
is not necessary as you are already waiting for the elements in your tests.
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.
Removed in HEAD :D
superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.jsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.jsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.jsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael S. Molina <[email protected]>
Signed-off-by: hainenber <[email protected]>
Converted to |
superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael S. Molina <[email protected]>
Thanks Michael for your lead, it's very helpful tip! I committed all of your proposed change :D |
Re-running it... let's see what happens :) |
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.
LGTM. Thanks for the PR and for addressing the comments @hainenber!
…t to RTL syntax (#29380) Signed-off-by: hainenber <[email protected]> Co-authored-by: Michael S. Molina <[email protected]>
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