// @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 { CHAT_INTERIM_VISUAL_SCREENS, ChatInterimVisualFixture } from "./chat-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}`, relativeDate: (value: string) => `relative:${value}`, }), })); describe("AK-P15b team chat interim visual baseline", () => { it("renders the channel index and detail surfaces from ~/ui", () => { render(
{CHAT_INTERIM_VISUAL_SCREENS.map((screen) => ( ))}
); expect(document.querySelectorAll("[data-ui-id='ui.chat.channelList']")).toHaveLength(1); expect(document.querySelectorAll("[data-ui-id='ui.chat.channelDetail']")).toHaveLength(1); const stableMarkup = document.body.innerHTML.replace(/]*>[\s\S]*?<\/svg>/gu, ''); expect(stableMarkup).toMatchSnapshot(); }); });