feat(ui): polish core component surfaces
This commit is contained in:
@@ -15,12 +15,14 @@ describe("RadioGroup", () => {
|
||||
|
||||
const group = screen.getByRole("radiogroup", { name: "Review lane" });
|
||||
const design = screen.getByRole("radio", { name: "Design" });
|
||||
const designIcon = design.querySelector('[data-slot="icon"]');
|
||||
|
||||
expect(group).toHaveAttribute("data-slot", "root");
|
||||
expect(group).toHaveAttribute("data-orientation", "horizontal");
|
||||
expect(design).toBeChecked();
|
||||
expect(design).toHaveAttribute("data-slot", "control");
|
||||
expect(design).toHaveAttribute("data-state", "checked");
|
||||
expect(designIcon).toHaveAttribute("data-state", "checked");
|
||||
});
|
||||
|
||||
it("supports value change callbacks when a new option is selected", async () => {
|
||||
@@ -36,10 +38,12 @@ describe("RadioGroup", () => {
|
||||
);
|
||||
|
||||
const medium = screen.getByRole("radio", { name: "Medium" });
|
||||
const mediumIcon = medium.querySelector('[data-slot="icon"]');
|
||||
|
||||
await user.click(medium);
|
||||
|
||||
expect(medium).toBeChecked();
|
||||
expect(mediumIcon).toHaveAttribute("data-state", "checked");
|
||||
expect(onValueChange).toHaveBeenLastCalledWith("medium");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user