Issue #59 fixes
This commit is contained in:
@@ -54,7 +54,10 @@ describe("Footer (behavioral tests)", () => {
|
||||
screen.getAllByRole("link", { name: "Follow us on Bluesky" }).length,
|
||||
).toBeGreaterThan(0);
|
||||
expect(
|
||||
screen.getAllByRole("link", { name: "Follow us on GitLab" }).length,
|
||||
screen.getAllByRole("link", { name: "View source on Gitea" }).length,
|
||||
).toBeGreaterThan(0);
|
||||
expect(
|
||||
screen.getAllByRole("link", { name: "Follow us on Mastodon" }).length,
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
@@ -74,7 +77,7 @@ describe("Footer (behavioral tests)", () => {
|
||||
it("renders navigation links with baseline width-fit focus targets", () => {
|
||||
render(<Footer />);
|
||||
const useCases = screen.getAllByRole("link", { name: "Use cases" })[0];
|
||||
expect(useCases).toHaveClass("w-fit", "self-start");
|
||||
expect(useCases).toHaveClass("w-fit", "self-start", "md:self-end");
|
||||
expect(useCases).not.toHaveClass("w-full");
|
||||
});
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ type IconProps = React.ComponentProps<typeof Icon>;
|
||||
|
||||
const baseProps: IconProps = {
|
||||
icon: <div data-testid="test-icon">Icon</div>,
|
||||
title: "Worker's cooperatives",
|
||||
title: "Worker cooperatives",
|
||||
description:
|
||||
"Employee-owned businesses often need to clarify how power is shared",
|
||||
};
|
||||
@@ -89,12 +89,12 @@ describe("Icon (behavioral tests)", () => {
|
||||
render(
|
||||
<Icon
|
||||
icon={<div data-testid="icon">Icon</div>}
|
||||
title="Worker's cooperatives"
|
||||
title="Worker cooperatives"
|
||||
description="Employee-owned businesses"
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByTestId("icon")).toBeInTheDocument();
|
||||
expect(screen.getByText("Worker's cooperatives")).toBeInTheDocument();
|
||||
expect(screen.getByText("Worker cooperatives")).toBeInTheDocument();
|
||||
expect(screen.getByText("Employee-owned businesses")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
|
||||
@@ -166,6 +166,30 @@ describe("MultiSelect – behaviour specifics", () => {
|
||||
expect(handleConfirm).toHaveBeenCalledWith("custom-1", "NewOption");
|
||||
});
|
||||
|
||||
it("allows spaces in custom chip labels", async () => {
|
||||
const handleConfirm = vi.fn();
|
||||
const customOptions = [
|
||||
{ id: "custom-1", label: "", state: "custom" as const },
|
||||
];
|
||||
render(
|
||||
<MultiSelect
|
||||
options={customOptions}
|
||||
onCustomChipConfirm={handleConfirm}
|
||||
/>,
|
||||
);
|
||||
|
||||
const input = screen.getByPlaceholderText("Type to add");
|
||||
await userEvent.type(input, "Mutual aid network");
|
||||
|
||||
const checkButton = screen.getByRole("button", { name: "Confirm" });
|
||||
await userEvent.click(checkButton);
|
||||
|
||||
expect(handleConfirm).toHaveBeenCalledWith(
|
||||
"custom-1",
|
||||
"Mutual aid network",
|
||||
);
|
||||
});
|
||||
|
||||
it("handles custom chip close", async () => {
|
||||
const handleClose = vi.fn();
|
||||
const customOptions = [
|
||||
|
||||
Reference in New Issue
Block a user