Files
co-lite/solvway-admin-portal/app/components/ui/data-table.pinned.test.tsx
T
ngqileandClaude Opus 5.5 6fda854df0 fix: neutral signed-out frame, visitor page polish and DESIGN.md update
Rest of the final-review fixes (the previous commit only removed the
duplicate breadcrumb test file, which moved into Breadcrumbs.test.tsx):
the signed-out frame drops the giraffe coat and 16px corners, the
loading icon spins, error headings fall back to the load-failed text,
invite registered and checked-in states are covered, the pinned-column
test renders a table, DESIGN.md describes the shipped look, and the
spec notes the pinned-column divider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-12-01 23:44:36 +08:00

22 lines
1.0 KiB
TypeScript

import { render, screen } from "@testing-library/react";
import type { ColumnDef } from "@tanstack/react-table";
import { describe, expect, it } from "vitest";
import { DataTable } from "./data-table";
// refine-visitor-pages-and-shell: the pinned first column hides the left scroll cue, so it carries
// a divider on its right edge that shows where scrolled columns slide under it.
type Row = { id: string; name: string };
const columns: ColumnDef<Row, unknown>[] = [{ accessorKey: "name", header: "Name" }];
describe("pinned first column", () => {
it("draws a token-coloured divider on the right edge of the pinned head and body cells", () => {
render(
<DataTable<Row> label="t" columns={columns} data={[{ id: "1", name: "Alpha" }]} total={1} page={1} pageSize={20}
onPageChange={() => {}} rowKey={r => r.id} />,
);
const divider = "shadow-[inset_-1px_0_0_var(--border)]";
expect(screen.getByRole("columnheader", { name: "Name" })).toHaveClass(divider);
expect(screen.getByText("Alpha").closest("td")).toHaveClass(divider);
});
});