Skip to content

Commit

Permalink
fix: update story to fix a11y test
Browse files Browse the repository at this point in the history
  • Loading branch information
benlister-okta committed Apr 24, 2024
1 parent 6518de5 commit 63c0e62
Showing 1 changed file with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,26 +243,10 @@ export const ControlledRadioGroupWithRadioHints: StoryObj<typeof RadioGroup> = {
);
return (
<RadioGroup {...{ ...props, value, onChange }}>
<Radio label="Light Speed" value="Light Speed" hint="Hint text" />
<Radio label="Warp Speed" value="Warp Speed" hint="Hint text" />
<Radio
label="Ludicrous Speed"
value="Ludicrous Speed"
hint="Hint text"
/>
<Radio label="Snail Speed" value="Snail Speed" hint="Hint text" />
<Radio label="Turtle Speed" value="Turtle Speed" hint="Hint text" />
<Radio label="Rabbit Speed" value="Rabbit Speed" hint="Hint text" />
</RadioGroup>
);
},
play: async ({ canvasElement, step }) => {
await step("select uncontrolled radio button", async () => {
const canvas = within(canvasElement);
const radiogroup = canvas.getByRole("radiogroup") as HTMLInputElement;
const radio = canvas.getByLabelText("Warp Speed") as HTMLInputElement;
if (radiogroup && radio) {
await userEvent.click(radio);
}
await expect(radio).toBeChecked();
await axeRun("select uncontrolled radio button");
});
},
};

0 comments on commit 63c0e62

Please sign in to comment.