Pin phone sheets to the visible viewport, and let people correct login and organizer errors.
This commit is contained in:
1 parent
27d74e510c
commit
39807ef452
17 files changed
+236
-16
No files matched your search
@@ -95,4 +95,53 @@ describe("AskOrganizerInquiryModal", () => {
|
||||
screen.getByRole("button", { name: /send question/i }),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows field hints for an invalid email and a short question, then clears them on edit", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderWithProviders(
|
||||
<AskOrganizerInquiryModal isOpen onClose={vi.fn()} />,
|
||||
);
|
||||
|
||||
await user.type(
|
||||
screen.getByRole("textbox", { name: /email address/i }),
|
||||
"not-an-email",
|
||||
);
|
||||
await user.type(
|
||||
screen.getByRole("textbox", { name: /your question/i }),
|
||||
"Too short",
|
||||
);
|
||||
await user.click(screen.getByRole("button", { name: /send question/i }));
|
||||
|
||||
expect(
|
||||
await screen.findByText("Enter an email address like name@example.org."),
|
||||
).toBeInTheDocument();
|
||||
expect(fetchMock).not.toHaveBeenCalled();
|
||||
|
||||
await user.type(
|
||||
screen.getByRole("textbox", { name: /email address/i }),
|
||||
"@example.org",
|
||||
);
|
||||
expect(
|
||||
screen.queryByText("Enter an email address like name@example.org."),
|
||||
).not.toBeInTheDocument();
|
||||
|
||||
await user.clear(screen.getByRole("textbox", { name: /email address/i }));
|
||||
await user.type(
|
||||
screen.getByRole("textbox", { name: /email address/i }),
|
||||
"rosa@example.org",
|
||||
);
|
||||
await user.click(screen.getByRole("button", { name: /send question/i }));
|
||||
|
||||
expect(
|
||||
await screen.findByText("Please enter at least 10 characters."),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await user.type(
|
||||
screen.getByRole("textbox", { name: /your question/i }),
|
||||
" more",
|
||||
);
|
||||
expect(
|
||||
screen.queryByText("Please enter at least 10 characters."),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user