// @vitest-environment jsdom import "@testing-library/jest-dom/vitest"; import React from "react"; import { render } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; import { P9_OPERATIONS_INTERIM_VISUAL_SCREENS, P9OperationsInterimVisualFixture } from "./p9-operations-interim.visual-fixture"; vi.mock("react-i18next", () => ({ useTranslation: () => ({ t: (key: string, values?: Record) => (values ? `${key}:${Object.values(values).join("/")}` : key), i18n: { language: "de" }, }), })); describe("R-P9 operations interim visual baseline", () => { it("renders the plantafel, acceptance list, and sub-areas surfaces from ~/ui", () => { render(
{P9_OPERATIONS_INTERIM_VISUAL_SCREENS.map((screen) => ( ))}
, ); expect(document.querySelectorAll("[data-ui-id='ui.projects.plantafel']")).toHaveLength(1); expect(document.querySelectorAll("[data-ui-id='ui.projects.acceptance.list']")).toHaveLength(1); expect(document.querySelectorAll("[data-ui-id='ui.projects.operations']")).toHaveLength(1); const stableMarkup = document.body.innerHTML.replace(/]*>[\s\S]*?<\/svg>/gu, ''); expect(stableMarkup).toMatchSnapshot(); }); });