Fix : Resolved the test issues in the current main branch#364
Fix : Resolved the test issues in the current main branch#364Aryan0699 wants to merge 2 commits intoshopstr-eng:mainfrom
Conversation
|
@Aryan0699 is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes failing tests on main by updating test mocks to align with recent component behavior changes.
Changes:
- Updated the mocked NextUI
Switchinshopstr-switch.test.tsxto useonValueChangeandisSelectedinstead ofonClick. - Added a global
fetchmock inprofile-dropdown.test.tsxto satisfy a newuseEffectfetch call in the component.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| components/utility-components/profile/tests/profile-dropdown.test.tsx | Adds a fetch mock so tests don’t fail after component started calling fetch in useEffect. |
| components/utility-components/tests/shopstr-switch.test.tsx | Updates the NextUI Switch mock to trigger onValueChange for the new component contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Will resolve this in some time . Thank you ! |
|
Done ! |
|
can u solve the conflicts? |
|
Apologies for the delayed reply — I was asleep earlier. |
can u elaborate ? |
|
The app is constantly auto-reloading on its own, and the npm run dev process randomly terminates/crashes without a clear error trace -- same as mentioned by @Youknowme on discord |
|
@ Gautam these were fixes meant for earlier state of main and things might have changed so its better to merge a current test and lint resolving pr i think #398 |
Description
Fixed tests by updating mocks to match current component behavior:
Fixed :
shopstr-switch.test.tsxmock was usingonClick, but the component now usesonValueChange. Updated the mock to callonValueChange(!isSelected)sosetWotFilteris triggered correctly.profile-dropdown.test.tsxthe component now runsfetchinsideuseEffect,tests did not include afetchmock. Added a simple globalfetchmock returning empty JSON.Affirmation