-
-
Save gasserkl/a9be2c5b48aab84846c45b5efff33153 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("renders a login form", () => { | |
// when | |
render(<App />); | |
// then: the login-form elements should be rendered | |
const loginForm = screen.getByRole("form"); | |
const usernameInput = within(loginForm).getByPlaceholderText("Username"); | |
const passwordInput = within(loginForm).getByPlaceholderText("Password"); | |
const loginButton = within(loginForm).getByRole("button"); | |
expect(loginForm).toBeInTheDocument(); | |
expect(usernameInput).toBeInTheDocument(); | |
expect(passwordInput).toBeInTheDocument(); | |
expect(loginButton).toBeInTheDocument(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment