Offer the engine's five size bands as exclusive ranges, so a count of 100 has one home and a group cannot continue without a size.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
821690201e
commit
db278ab67d
11 files changed
+184
-61
No files matched your search
@@ -1,8 +1,17 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { renderWithProviders as render, screen } from "../utils/test-utils";
|
||||
import "@testing-library/jest-dom/vitest";
|
||||
import { CommunitySizeSelectScreen } from "../../app/(app)/create/screens/select/CommunitySizeSelectScreen";
|
||||
|
||||
const BANDS = [
|
||||
"One member",
|
||||
"2 to 5",
|
||||
"6 to 12",
|
||||
"13 to 100",
|
||||
"More than 100",
|
||||
] as const;
|
||||
|
||||
describe("CommunitySizeSelectScreen", () => {
|
||||
it("renders HeaderLockup title", () => {
|
||||
render(<CommunitySizeSelectScreen />);
|
||||
@@ -13,19 +22,44 @@ describe("CommunitySizeSelectScreen", () => {
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders preset size chips", () => {
|
||||
it("asks groups to count people who have a say", () => {
|
||||
render(<CommunitySizeSelectScreen />);
|
||||
expect(screen.getByText("1 member")).toBeInTheDocument();
|
||||
expect(screen.getByText("2-5 members")).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText(
|
||||
"Count the people who have a say in your big decisions. If others take part without a vote, you can say so later in setup.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("gives size chips Select/Deselect accessible names", () => {
|
||||
it("renders the five size bands", () => {
|
||||
render(<CommunitySizeSelectScreen />);
|
||||
for (const label of BANDS) {
|
||||
expect(
|
||||
screen.getByRole("button", { name: `Select ${label}` }),
|
||||
).toBeInTheDocument();
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps a single band selected", async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<CommunitySizeSelectScreen />);
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "Select 13 to 100" }));
|
||||
expect(
|
||||
screen.getByRole("button", { name: "Select 1 member" }),
|
||||
screen.getByRole("button", { name: "Deselect 13 to 100" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("button", { name: "Select 2-5 members" }),
|
||||
screen.getByRole("button", { name: "Select More than 100" }),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: "Select More than 100" }),
|
||||
);
|
||||
expect(
|
||||
screen.getByRole("button", { name: "Deselect More than 100" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("button", { name: "Select 13 to 100" }),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user