Redirect user to homepage after login or signup#44
Redirect user to homepage after login or signup#44kirontoo wants to merge 3 commits intoteam-hack:mainfrom
Conversation
ShelbsH
left a comment
There was a problem hiding this comment.
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.
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.
vijayxtreme
left a comment
There was a problem hiding this comment.
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.