mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-04 02:33:47 +10:00
Replace the achromatic shadcn palette with the Desk & Paper tokens (warm neutrals, one moss accent, danger, warn and info), exposed to Tailwind under their spec names; the previous names resolve to the new tokens until every screen is rebuilt. Hard-coded palette classes become semantic tokens and stage colors follow the spec. Fonts move to Newsreader, Hanken Grotesk and JetBrains Mono. The theme gains a System option that follows the operating system live, applied before first paint, and Base UI now receives the locale's direction. Primitives follow the component spec: button variants primary, secondary, ghost, danger and link with a loading state, accent focus rings on inputs, SwitchRow, semantic badges, segmented and underline tabs, restyled menus, dialogs, sheets, tooltips and command bar, and a single bottom-center toast with an Undo action. New: IconButton, SegmentedControl, RadioGroup and NativeSelect.
24 lines
869 B
TypeScript
24 lines
869 B
TypeScript
import { render, screen } from "@testing-library/react";
|
|
import userEvent from "@testing-library/user-event";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
import { SwitchRow } from "./switch";
|
|
|
|
describe("SwitchRow", () => {
|
|
it("makes the whole row the switch, named by its label and described by its description", async () => {
|
|
const onCheckedChange = vi.fn();
|
|
render(
|
|
<SwitchRow
|
|
label="Visitors can download the PDF"
|
|
description="Download is hidden when this is off."
|
|
onCheckedChange={onCheckedChange}
|
|
/>,
|
|
);
|
|
|
|
const row = screen.getByRole("switch", { name: "Visitors can download the PDF" });
|
|
expect(row).toHaveAccessibleDescription("Download is hidden when this is off.");
|
|
|
|
await userEvent.click(screen.getByText("Visitors can download the PDF"));
|
|
expect(onCheckedChange).toHaveBeenCalledWith(true, expect.anything());
|
|
});
|
|
});
|