Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions js/radio/Radio.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,21 @@ describe("Events", () => {
expect(change).toHaveBeenCalledTimes(1);
});

test("input and select emitted on user click", async () => {
const { listen, getAllByRole } = await render(Radio, default_props);

const input = listen("input");
const select = listen("select");
const radios = getAllByRole("radio") as HTMLInputElement[];

await event.click(radios[2]);

await waitFor(() => {
expect(input).toHaveBeenCalledTimes(1);
expect(select).toHaveBeenCalledTimes(1);
expect(select).toHaveBeenCalledWith({ value: "turtle", index: 2 });
});
});
test("custom_button_click emitted when custom button is clicked", async () => {
const { listen, getByLabelText } = await render(Radio, {
...default_props,
Expand Down
Loading