Files
ThothII/frontend/src/viewers/PreviewGrid.test.tsx
T
Codex d8a29bfbdd Add full shell, replaceable Omics adapter and bilingual interaction
Implement approved specification #32 and tickets #33-#37. Keep host authentication server-verified and pin session interaction language. Compile scoped base selectors for browser compatibility and retain full gutters during CSS pruning.
2026-09-13 14:26:39 +02:00

25 lines
964 B
TypeScript

import { act, render, screen } from "@testing-library/react";
import { PreviewGrid } from "./PreviewGrid";
import { setLocale } from "../i18n";
afterEach(() => setLocale("en"));
test("the grid's built-in empty state follows a language change", async () => {
render(<PreviewGrid columns={["patient_id"]} rows={[]} />);
expect(await screen.findByText("No Rows To Show")).toBeInTheDocument();
act(() => setLocale("it"));
expect(await screen.findByText("Nessuna riga da mostrare")).toBeInTheDocument();
expect(screen.getByText("patient_id")).toBeInTheDocument();
});
test("renders grid cells for the given columns and rows", () => {
render(
<PreviewGrid columns={["name", "age"]} rows={[["Alice", 30], ["Bob", 25]]} />
);
expect(screen.getByText("Alice")).toBeInTheDocument();
expect(screen.getByText("Bob")).toBeInTheDocument();
expect(screen.getByText("30")).toBeInTheDocument();
expect(screen.getByText("25")).toBeInTheDocument();
});