feat: add sheet component and docs qa baseline
This commit is contained in:
@@ -3,6 +3,7 @@ import userEvent from "@testing-library/user-event";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { Button } from "./button";
|
||||
import { setReducedMotionPreference } from "../test/a11y";
|
||||
|
||||
describe("Button", () => {
|
||||
it("renders a native button with root and label slots", () => {
|
||||
@@ -49,4 +50,16 @@ describe("Button", () => {
|
||||
expect(link).toHaveAttribute("data-variant", "ghost");
|
||||
expect(link).not.toHaveAttribute("type");
|
||||
});
|
||||
|
||||
it("preserves the loading contract when reduced motion is preferred", () => {
|
||||
setReducedMotionPreference(true);
|
||||
|
||||
render(<Button loading>Saving</Button>);
|
||||
|
||||
const button = screen.getByRole("button", { name: "Saving" });
|
||||
|
||||
expect(button).toBeDisabled();
|
||||
expect(button).toHaveAttribute("data-loading", "");
|
||||
expect(button.querySelector('[data-slot="icon"]')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user