-
Notifications
You must be signed in to change notification settings - Fork 4
Redirect user to homepage after login or signup #44
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
base: main
Are you sure you want to change the base?
Conversation
ShelbsH
left a comment
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.
Good work 👍 Just a small change.
| test("pages renders correctly", () => { | ||
| const {queryByLabelText, queryByRole} = render(<Signup/>); | ||
| expect(queryByLabelText("Email")).toBeTruthy(); | ||
| expect(queryByLabelText("Password")).toBeTruthy(); | ||
| expect(queryByRole("button")).toBeVisible(); | ||
| //TODO: check if button is rendered. | ||
| }); |
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.
If you're just testing if elements are rendered into the DOM, you can use the same methods from screen. This avoids having to keep using destructuring queries from render(...). Kent Dodds talks about it here.
Since you're using jest-dom, you could change .toBeTruthy() to be toBeInTheDocument(), since it's a little more accurate in stating that those elements are rendered. The same for the button as well.
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.
:+1 @shelbyhurns
vijayxtreme
left a comment
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.
Looking good -- just be sure to add more test coverage. Please run npx jest --coverage on any of your work
|
Please use "squash and merge" when you are finished so we can roll all these updates into one commit. |
No description provided.