-
Notifications
You must be signed in to change notification settings - Fork 165
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
refactor : using msw instead of jest.mock of useUserData hook in tests. #764
base: develop
Are you sure you want to change the base?
refactor : using msw instead of jest.mock of useUserData hook in tests. #764
Conversation
@Shah-Arsalan is attempting to deploy a commit to the RDS-Team Team on Vercel. A member of the Team first needs to authorize it. |
@@ -124,7 +122,8 @@ describe('Task card', () => { | |||
expect(queryByTestId('task-card')).toBeInTheDocument(); | |||
}); | |||
|
|||
test('should show edit button when ALT key is long pressed', () => { | |||
test('should show edit button when ALT key is long pressed', async () => { | |||
server.use(...adminUserHandler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using aminUserHandler here when we are not doing any testing related to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beacuse the code is written as {isUserAuthorized && showEditButton && <EditButton />}
. So to get the isUserAuthorized values as true we need to use adminUserHandler. The long press of ALT key is just turning the boolean showEditButton from false to true.
…rsalan/website-status into refactor/useUserData_test
Issue: Employ msw instead of jest.mock of useUserData hook in tests.
Description: In certain test files userUserData hook was being mocked to get some test value. The task is to employ msw in place of jest.mock.
Dev Tested:
Images/video of the change:
3 files needed change in total wrt to employing msw