I want to test that only 1 radiobutton is clicked after fireEvent.click on a radiobutton.
So far I have tried to get all radiobuttons & looking for code to check how to count if only radiobutton is checked.
it("should click on text", () => {
const handleChange = jest.fn();
const { container } = render(<Radiogroup onClick={handleChange} />);
const dialogContainer = getAllByRole(container, "radio");
dialogContainer[0].setAttribute("aria-checked", "true");
dialogContainer.forEach(key => {
//
// Code to check if only 1 radiobutton was clicked
//
});
});
Aucun commentaire:
Enregistrer un commentaire