Skip to content
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

[UI] Add tests for LoginRedirect component #93

Open
Samy-33 opened this issue Jun 26, 2022 · 5 comments
Open

[UI] Add tests for LoginRedirect component #93

Samy-33 opened this issue Jun 26, 2022 · 5 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed UI to label tasks requiring change in UI

Comments

@Samy-33
Copy link
Member

Samy-33 commented Jun 26, 2022

To get an idea how to write tests look at the following PR: #88

@Samy-33 Samy-33 added good first issue Good for newcomers UI to label tasks requiring change in UI labels Jun 26, 2022
@Samy-33 Samy-33 added this to Gymkhana Jun 26, 2022
@Samy-33 Samy-33 moved this to Todo in Gymkhana Jun 26, 2022
@Samy-33 Samy-33 added the help wanted Extra attention is needed label Jun 27, 2022
@PranshuNayak
Copy link
Contributor

@Samy-33 there are many things in PR #88 totally new to me . Any learning resource you may suggest . I have found some videos on YouTube but don't know how useful they will be ....

@Samy-33
Copy link
Member Author

Samy-33 commented Jul 2, 2022

https://reactjs.org/docs/testing.html should help. Read about general topics for testing like mocks, spies, difference between unit tests and integration tests.

Let me know if you want a walkthrough of these tests.

@PranshuNayak PranshuNayak self-assigned this Jul 19, 2022
@PranshuNayak
Copy link
Contributor

https://reactjs.org/docs/testing.html should help. Read about general topics for testing like mocks, spies, difference between unit tests and integration tests.

Let me know if you want a walkthrough of these tests.

I have some doubts in Login.test.tsx if you are available

@PranshuNayak
Copy link
Contributor

From LoginRedirect/index.tsx
`const errQuery = new URLSearchParams({error: 'Please try again later!'});
const code = new URLSearchParams(window.location.search).get('code');

if (!code) {
  return navigate('/');
} `
If there is not code still redirecting to home('/') ?

@Samy-33
Copy link
Member Author

Samy-33 commented Jul 23, 2022

Should redirect to /login with appropriate error message :)

Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed UI to label tasks requiring change in UI
Projects
Status: Todo
Development

No branches or pull requests

2 participants