Skip to content

Commit

Permalink
test: add select multiple combo box values test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellmueller committed May 9, 2024
1 parent 9282658 commit 809b074
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,30 @@ describe("RJSF MultiSelectWidget", () => {
expect(screen.getByRole("button", { name: "Option 3" })).toBeVisible();
});

it("should allow selecting multiple combo box values", async () => {
render(
<FormBase
schema={multiSelectFieldSchema}
uiSchema={multiSelectFieldUiSchema}
/>,
);

const openMultiSelectButton = screen.getByRole("button", { name: "Open" });
await userEvent.click(openMultiSelectButton);

const option1 = screen.getByText("Option 1");
const option3 = screen.getByText("Option 3");

await userEvent.click(option1);

await userEvent.click(openMultiSelectButton);

await userEvent.click(option3);

expect(screen.getByText("Option 1")).toBeVisible();
expect(screen.getByText("Option 3")).toBeVisible();
});

it("should allow typing a combo box value", async () => {
render(
<FormBase
Expand Down

0 comments on commit 809b074

Please sign in to comment.