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

fix: AlertReportCronScheduler tests #19288

Merged

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

Tests for the AlertReportCronScheduler component were skipped when the component was rewritten.
This PR introduces tests for the component using the react testing library, plus some optimizations in the component.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

None (other than the test execution results)

TESTING INSTRUCTIONS

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

@diegomedina248 diegomedina248 changed the title fix/alert report cron scheduler tests fix: AlertReportCronScheduler tests Mar 21, 2022
@diegomedina248 diegomedina248 force-pushed the fix/alert-report-cron-scheduler-tests branch from 91a95df to 36ddb37 Compare March 21, 2022 16:38
@codecov
Copy link

codecov bot commented Mar 21, 2022

Codecov Report

Merging #19288 (e3a790c) into master (1b4d8dd) will increase coverage by 0.00%.
The diff coverage is 83.33%.

❗ Current head e3a790c differs from pull request most recent head 380abe3. Consider uploading reports for the commit 380abe3 to get more accurate results

@@           Coverage Diff           @@
##           master   #19288   +/-   ##
=======================================
  Coverage   66.59%   66.60%           
=======================================
  Files        1682     1682           
  Lines       64314    64317    +3     
  Branches     6559     6559           
=======================================
+ Hits        42832    42837    +5     
+ Misses      19781    19779    -2     
  Partials     1701     1701           
Flag Coverage Δ
javascript 51.37% <83.33%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...CRUD/alert/components/AlertReportCronScheduler.tsx 87.50% <83.33%> (+10.57%) ⬆️
...-frontend/src/components/CronPicker/CronPicker.tsx 100.00% <0.00%> (+14.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b4d8dd...380abe3. Read the comment docs.

@diegomedina248 diegomedina248 force-pushed the fix/alert-report-cron-scheduler-tests branch from 36ddb37 to b6a472b Compare March 21, 2022 19:09
@diegomedina248 diegomedina248 force-pushed the fix/alert-report-cron-scheduler-tests branch from b6a472b to 380abe3 Compare April 6, 2022 00:04
@rusackas
Copy link
Member

@eschutho would love to get feedback from someone closer to this feature, in case there's any risk I'm not spotting here.


const handlePressEnter = useCallback(() => {
onChange(inputRef.current?.input.value || '');
}, [onChange]);
Copy link
Member

Choose a reason for hiding this comment

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

@diegomedina248 do you think we need useCallback for simple Input component props?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't hurt nor improve in this case, but I believe it's cleaner

Copy link
Member

Choose a reason for hiding this comment

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

It's a bit more code and a bit more computation imo, which is my only concern with not much performance impact, but it's not a big deal. I'll cc @rusackas if he has any opinions.

Copy link
Member

Choose a reason for hiding this comment

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

but to your comment of it being cleaner, @diegomedina248 I meant to also ask in what way?

@eschutho
Copy link
Member

@eschutho would love to get feedback from someone closer to this feature, in case there's any risk I'm not spotting here.

Looks great.. thanks for the tests @diegomedina248!

@rusackas rusackas merged commit 7f22edf into apache:master Apr 20, 2022
hughhhh pushed a commit to hve-labs/superset that referenced this pull request May 11, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 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 Preset-Patch size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants