feat: add sheet component and docs qa baseline

This commit is contained in:
2026-03-19 18:46:20 +08:00
parent 71ebb010b9
commit f318f94c9a
28 changed files with 1799 additions and 91 deletions
@@ -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();
});
});