Commit ba2db4d
authored
Fix tests with vitest for Vite
* Fix multiple Api calls
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.
* Updated testing configuration
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.
* Context testing
Added two more testing files to test the context, to make testing more robust.
## Key changes
- Created DataContext.test.tsx
- Created SearchContext.test.tsx
* 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
- 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>1 parent 715e862 commit ba2db4d
File tree
20 files changed
+1632
-297
lines changed- inventory-manager
- src
- components/page-content
- segment1-search_product/input-bars
- segment2-new_product
- segment3-table
- segment
- segment4-metrics
- context
20 files changed
+1632
-297
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
0 commit comments