Skeleton, Breadcrumbs, Link, Button, Image, Meter, NumberField Floating components: Tooltip (hover/focus), Popover (click, with focus trap and dismiss), HoverCard (hover with safe area). Simple components: Alert (role=alert), Badge (role=status), Skeleton (loading placeholder with data attributes). Navigation: Breadcrumbs (nav>ol>li with separators), Link (accessible anchor with disabled), Button (with disabled click suppression). Data/Form: Image (Img+Fallback with loading status), Meter (like Progress for known ranges), NumberField (spinbutton with inc/dec). 302 tests across 46 files, typecheck clean, build produces 176 files.
23 lines
665 B
TypeScript
23 lines
665 B
TypeScript
import { render, screen } from "@solidjs/testing-library";
|
|
import { describe, expect, it } from "vitest";
|
|
import { Alert } from "../../../src/components/alert/index";
|
|
|
|
describe("Alert", () => {
|
|
it("has role=alert", () => {
|
|
render(() => <Alert>Warning!</Alert>);
|
|
expect(screen.getByRole("alert")).toBeTruthy();
|
|
});
|
|
it("renders children", () => {
|
|
render(() => <Alert>Important message</Alert>);
|
|
expect(screen.getByText("Important message")).toBeTruthy();
|
|
});
|
|
it("spreads props", () => {
|
|
render(() => (
|
|
<Alert data-testid="a" class="custom">
|
|
Text
|
|
</Alert>
|
|
));
|
|
expect(screen.getByTestId("a").getAttribute("class")).toBe("custom");
|
|
});
|
|
});
|