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

Redirect user to homepage after login or signup #44

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kirontoo
Copy link
Contributor

No description provided.

@kirontoo kirontoo requested a review from ShelbsH July 16, 2021 02:48
Copy link
Contributor

@ShelbsH ShelbsH left a 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.

Comment on lines +6 to +12
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.
});
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

:+1 @shelbyhurns

Copy link
Contributor

@vijayxtreme vijayxtreme left a 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

@vijayxtreme
Copy link
Contributor

Please use "squash and merge" when you are finished so we can roll all these updates into one commit.

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