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(); 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( ); expect(screen.getByText("Alice")).toBeInTheDocument(); expect(screen.getByText("Bob")).toBeInTheDocument(); expect(screen.getByText("30")).toBeInTheDocument(); expect(screen.getByText("25")).toBeInTheDocument(); });