Issue #59 fixes

This commit is contained in:
adilallo
2026-05-25 22:05:00 -06:00
parent bd536a407f
commit 6b45a2e5d0
39 changed files with 167 additions and 124 deletions
+24
View File
@@ -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 = [