Replace the hand-rolled Tailwind/shadcn look with Sakani UI across the editorial area, the admin area and all signed-out pages. - AppShell (Sakani Sidebar + TopBar) for /redaktion and /admin, with a mobile drawer, theme toggle, sign-out, legal links and a "Was ist neu" button; PublicShell for login, registration, password, 2FA and errors. - Shared primitives (Button, Card, Input, PageHeader) now render Sakani; components/ui/sakani.tsx is the client boundary for Server Components (Sakani ships no "use client") and adds FormSelect (native form value) and DataTable (element cells from the server). - Legacy CSS variables map onto Sakani tokens; globals.css shrinks from ~2200 to ~700 lines. Geist replaces Inter. recharts/lucide-react dropped (charts via Sakani BarChart). - Release notes popup per area, shown once per version (localStorage) and reopenable from the sidebar; native <dialog> for focus trapping. - Fixes found while testing: TOTP field reused the typed password in clear text, modal dialogs sat top-left, invisible unchecked checkboxes in dark mode. - Parallel run: compose.parallel.yaml, AUTO_RULE_SYNC_DISABLED switch and docs/operations.md §8 (start, rollback, cutover). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
921 B
TypeScript
25 lines
921 B
TypeScript
// @vitest-environment jsdom
|
|
|
|
import { cleanup, render, screen } from "@testing-library/react";
|
|
import { afterEach, expect, test } from "vitest";
|
|
|
|
import { DataTable, FormSelect } from "./sakani";
|
|
|
|
afterEach(cleanup);
|
|
|
|
test("DataTable renders element cells instead of stringifying them", () => {
|
|
render(<DataTable columns={[{ key: "name", header: "Name" }]} rows={[{ name: <a href="/x">Kicker</a> }]} />);
|
|
expect(screen.getByRole("link", { name: "Kicker" }).getAttribute("href")).toBe("/x");
|
|
expect(screen.queryByText("[object Object]")).toBeNull();
|
|
});
|
|
|
|
test("FormSelect submits its value through a named hidden input", () => {
|
|
const { container } = render(
|
|
<form>
|
|
<FormSelect name="format" label="Format" defaultValue="quer" options={[{ label: "Quer", value: "quer" }]} />
|
|
</form>,
|
|
);
|
|
const data = new FormData(container.querySelector("form")!);
|
|
expect(data.get("format")).toBe("quer");
|
|
});
|