| 12 | import { SetupPage } from "./SetupPage"; |
| 13 | |
| 14 | const fillForm = async ({ |
| 15 | email = "someone@coder.com", |
| 16 | password = "password", |
| 17 | }: { |
| 18 | username?: string; |
| 19 | email?: string; |
| 20 | password?: string; |
| 21 | } = {}) => { |
| 22 | const emailField = screen.getByLabelText("Email"); |
| 23 | const passwordField = screen.getByLabelText("Password"); |
| 24 | await userEvent.type(emailField, email); |
| 25 | await userEvent.type(passwordField, password); |
| 26 | const submitButton = screen.getByRole("button", { |
| 27 | name: "Continue", |
| 28 | }); |
| 29 | await userEvent.click(submitButton); |
| 30 | }; |
| 31 | |
| 32 | describe("Setup Page", () => { |
| 33 | beforeEach(() => { |