Fix tests with vitest for Vite#31
Merged
technologic-technologic merged 4 commits into26-migrate-app-from-cra-to-vitefrom Oct 15, 2025
Merged
Fix tests with vitest for Vite#31technologic-technologic merged 4 commits into26-migrate-app-from-cra-to-vitefrom
technologic-technologic merged 4 commits into26-migrate-app-from-cra-to-vitefrom
Conversation
Fixed the bug where multiple calls to the backend where made for no reason ## Key changes - Updated DataProvider - Added exposed component to interact with the one and only DataContext context.
Upgraded the testing configuration to be compatible with vitest new variables, and avoid problems in the future. ## Key changes - Updated gitignore to avoid constantly modifying package lock - Commiting for the last time package-lock changes - Added test parameters in app config to allow smooth testing - Added jsdom dependency to devDependencies -Added globals to frame config to allow testing, easier. Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
Added two more testing files to test the context, to make testing more robust. ## Key changes - Created DataContext.test.tsx - Created SearchContext.test.tsx Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
Testing fixed after the migration from CRA to Vite. For this fix was necessary to strengthen the contexts and all the components that make contact with the Api <- Refactored these files. Added test script to package to allow npm to run the tests. ## Key changes - Fixes InventoryTablePageSelector.test.tsx, InventoryTable.test.tsx, NewProductButton.test.tsx, ProductForm.test.tsx. - Updated DataContext.test.tsx, SearchContext.test.tsx - Refactored for the new context management: - InventoryTable.tsx, - InventoryTableObj.tsx, - InventoryTablePageSelector.tsx - EncoraContent.tsx ## Breaking or pending changes - SearchBar component testing is still pending - Update documentation to the new version Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
PR SummaryWHAT Changed
WHY It Matters
RISKS
TESTS to Add
BREAKING CHANGES
Changed File Paths
|
ba2db4d
into
26-migrate-app-from-cra-to-vite
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing working again
Testing fixed after the migration from CRA to Vite.
For this fix was necessary to strengthen the contexts and all the components that make contact with the Api <- Refactored these files.
Added test script to package to allow npm to run the tests.
Key changes
Breaking or pending changes
More info below