// @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 { TELEPHONY_INTERIM_VISUAL_SCREENS, TelephonyInterimVisualFixture } from "./telephony-interim.visual-fixture"; vi.mock("react-i18next", () => ({ useTranslation: () => ({ t: (key: string, values?: Record) => (values ? `${key}:${Object.values(values).join("/")}` : key), i18n: { language: "de" }, }), })); vi.mock("~/locale/format", () => ({ useLocaleFormatters: () => ({ number: (value: number) => String(value), date: (value: string) => value, dateTime: (value: string) => `date:${value}`, }), })); describe("AK-P15a telephony interim visual baseline", () => { it("renders the settings, call list, detail, and click-to-call surfaces from ~/ui", () => { render(
{TELEPHONY_INTERIM_VISUAL_SCREENS.map((screen) => ( ))}
, ); expect(document.querySelectorAll("[data-ui-id='ui.telephony.settings.page']")).toHaveLength(1); expect(document.querySelectorAll("[data-ui-id='ui.telephony.calls.page']")).toHaveLength(1); expect(document.querySelectorAll("[data-ui-id='ui.telephony.callDetail.page']")).toHaveLength(1); expect(document.querySelectorAll("[data-ui-id='ui.telephony.clickToCall.dialog']")).toHaveLength(1); const stableMarkup = document.body.innerHTML.replace(/]*>[\s\S]*?<\/svg>/gu, ''); expect(stableMarkup).toMatchSnapshot(); }); });