Skip to content

Fix : Resolved the test issues in the current main branch#364

Open
Aryan0699 wants to merge 2 commits intoshopstr-eng:mainfrom
Aryan0699:fix/main_test
Open

Fix : Resolved the test issues in the current main branch#364
Aryan0699 wants to merge 2 commits intoshopstr-eng:mainfrom
Aryan0699:fix/main_test

Conversation

@Aryan0699
Copy link
Copy Markdown
Contributor

Description

Fixed tests by updating mocks to match current component behavior:

Fixed :
shopstr-switch.test.tsx mock was using onClick, but the component now uses onValueChange. Updated the mock to call onValueChange(!isSelected) so setWotFilter is triggered correctly.

profile-dropdown.test.tsx the component now runs fetch inside useEffect ,tests did not include a fetch mock. Added a simple global fetch mock returning empty JSON.

Affirmation

Copilot AI review requested due to automatic review settings April 7, 2026 08:33
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

@Aryan0699 is attempting to deploy a commit to the shopstr-eng Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Switch in shopstr-switch.test.tsx to use onValueChange and isSelected instead of onClick.
  • Added a global fetch mock in profile-dropdown.test.tsx to satisfy a new useEffect fetch 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.

Comment thread components/utility-components/profile/__tests__/profile-dropdown.test.tsx Outdated
Comment thread components/utility-components/__tests__/shopstr-switch.test.tsx Outdated
Comment thread components/utility-components/__tests__/shopstr-switch.test.tsx Outdated
@Aryan0699
Copy link
Copy Markdown
Contributor Author

Will resolve this in some time . Thank you !

@Aryan0699
Copy link
Copy Markdown
Contributor Author

Done !

@Aryan0699 Aryan0699 changed the title fix:resolved the test issues in the current main branch Fix : Resolved the test issues in the current main branch Apr 9, 2026
@GautamBytes
Copy link
Copy Markdown
Contributor

can u solve the conflicts?

@Aryan0699
Copy link
Copy Markdown
Contributor Author

Apologies for the delayed reply — I was asleep earlier.
@Gautam, the current main branch seems to have an issue (though unrelated to this). Should I still rebase onto it?

@GautamBytes
Copy link
Copy Markdown
Contributor

the current main branch seems to have an issue

can u elaborate ?

@Aryan0699
Copy link
Copy Markdown
Contributor Author

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

@Aryan0699
Copy link
Copy Markdown
Contributor Author

@ 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants