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 Unit Tests after upgrade to React Query v5 #11857

Merged
merged 22 commits into from
Jan 11, 2024

Conversation

mlqn
Copy link
Contributor

@mlqn mlqn commented Dec 13, 2023

Description

  • Implemented "negative type" mocks in queriesMock
  • Removed custom queriesMock and moved mocks into unit tests
  • Removed duplicated mock implementations in unit tests
  • Added queriesMock in renderWithProviders of app-development to avoid passing it in every unit tests
  • Fixed several false positives in EditDataModelBindings tests
  • Replaced deprecated toBeCalled methods with toHaveBeenCalled methods
  • Fixed wrong/missing returned types in mutations
  • Merged duplicated types/interfaces (IRepository and Repository, Owner and User, IGiteaOrganisation and Organization)
  • Replaced UserType with userType to be consistent with other json properties
  • Removed duplicated queryClientMock

Related Issue(s)

Verification

@mlqn mlqn linked an issue Dec 13, 2023 that may be closed by this pull request
@github-actions github-actions bot added area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution. labels Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (90956e6) 86.95% compared to head (e92cb14) 86.91%.
Report is 3 commits behind head on master.

Files Patch % Lines
frontend/packages/shared/src/mocks/queriesMock.ts 58.88% 37 Missing ⚠️
...ts/SearchResultReposList/SearchResultReposList.tsx 50.00% 2 Missing ⚠️
...evelopment/hooks/queries/useAppDeploymentsQuery.ts 0.00% 0 Missing and 1 partial ⚠️
...development/hooks/queries/useAppLibVersionQuery.ts 0.00% 1 Missing ⚠️
...ntend/app-development/utils/dateUtils/dateUtils.ts 66.66% 1 Missing ⚠️
...rontend/dashboard/components/RepoList/RepoList.tsx 75.00% 1 Missing ⚠️
...board/hooks/mutations/useSetStarredRepoMutation.ts 0.00% 1 Missing ⚠️
...ard/hooks/mutations/useUnsetStarredRepoMutation.ts 0.00% 1 Missing ⚠️
frontend/dashboard/utils/repoUtils/repoUtils.ts 50.00% 1 Missing ⚠️
frontend/packages/shared/src/api/mutations.ts 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11857      +/-   ##
==========================================
- Coverage   86.95%   86.91%   -0.05%     
==========================================
  Files         935      934       -1     
  Lines       13235    13363     +128     
  Branches     1623     1634      +11     
==========================================
+ Hits        11509    11614     +105     
- Misses       1512     1537      +25     
+ Partials      214      212       -2     

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

@github-actions github-actions bot added area/data-modeling Area: Related to data models - e.g. create, edit, use data models. area/app-deploy Area: Related to deploying apps from Altinn Studio to Altinn Apps. labels Dec 19, 2023
@github-actions github-actions bot added the area/dashboard Area: Related to the dashboard label Dec 20, 2023
@mlqn mlqn marked this pull request as ready for review January 2, 2024 16:07
@mlqn mlqn requested a review from framitdavid January 10, 2024 19:19
@mlqn mlqn merged commit 679a200 into master Jan 11, 2024
15 of 17 checks passed
@mlqn mlqn deleted the 11692-improve-unit-tests-after-upgrade-to-react-query-v5 branch January 11, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/app-deploy Area: Related to deploying apps from Altinn Studio to Altinn Apps. area/dashboard Area: Related to the dashboard area/data-modeling Area: Related to data models - e.g. create, edit, use data models. area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Unit Tests after upgrade to React Query v5
2 participants