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: Fix async tests in SaveDatasetModal and complete overwrite screen test #21020

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

lyndsiWilliams
Copy link
Member

@lyndsiWilliams lyndsiWilliams commented Aug 9, 2022

SUMMARY

This PR fixes the final test in SaveDatasetModal.test.tsx. Initially the test for the overwrite screen buttons had to be squashed into the previous test because creating another test after this test would always render incorrectly and fail. The problem was that timers used by the component were being fired after the test ran. The solution was to use jest.useFakeTimers() at the top of the file, so that the timers run in the test environment. I also completed testing on the overwrite screen and cleaned up some arbitrary act wrappers.

TESTING INSTRUCTIONS

  • In your terminal, cd into superset-frontend
  • Run the command npm run test superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx
  • Observe that all tests pass with no act errors

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

@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Merging #21020 (e543449) into master (e350823) will decrease coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #21020      +/-   ##
==========================================
- Coverage   66.34%   66.28%   -0.07%     
==========================================
  Files        1767     1767              
  Lines       67281    68032     +751     
  Branches     7139     7398     +259     
==========================================
+ Hits        44639    45093     +454     
- Misses      20815    21063     +248     
- Partials     1827     1876      +49     
Flag Coverage Δ
hive 53.14% <ø> (ø)
javascript 52.17% <ø> (+0.06%) ⬆️
mysql 80.92% <ø> (ø)
postgres 80.99% <ø> (ø)
presto 53.04% <ø> (ø)
python 81.47% <ø> (ø)
sqlite 79.58% <ø> (ø)
unit 50.47% <ø> (ø)

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

Impacted Files Coverage Δ
...frontend/src/explore/actions/datasourcesActions.ts 100.00% <0.00%> (ø)
.../src/views/CRUD/data/dataset/DatasetPage/index.tsx 0.00% <0.00%> (ø)
...set-ui-core/src/ui-overrides/ExtensionsRegistry.ts 100.00% <0.00%> (ø)
...c/views/CRUD/data/database/DatabaseModal/styles.ts 76.78% <0.00%> (+0.31%) ⬆️
...t-frontend/src/explore/actions/saveModalActions.js 98.75% <0.00%> (+0.41%) ⬆️
...set-frontend/src/explore/actions/exploreActions.ts 59.52% <0.00%> (+1.19%) ⬆️
...s/CRUD/data/database/DatabaseModal/ModalHeader.tsx 68.57% <0.00%> (+1.90%) ⬆️
...et-frontend/src/explore/reducers/exploreReducer.js 43.00% <0.00%> (+3.00%) ⬆️
.../explore/components/ExploreViewContainer/index.jsx 55.36% <0.00%> (+3.16%) ⬆️
...c/views/CRUD/data/database/DatabaseModal/index.tsx 34.94% <0.00%> (+3.19%) ⬆️
... and 5 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@lyndsiWilliams lyndsiWilliams merged commit 1ffa567 into master Aug 18, 2022
@lyndsiWilliams lyndsiWilliams deleted the lyndsi/fix-sdm-test branch August 24, 2022 02:27
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants