import { describe, expect, test } from "bun:test"; import { renderToStaticMarkup } from "react-dom/server"; import { TranslatePanel, translateStatusText } from "../src/components/TranslatePanel"; // D-WS4b: the panel's copy, before any worker exists (static render). const danish = { text: "Det er ikke noget med at vi skal på ferie.", chunks: [] }; function render(downloaded: string[] = [], hint?: string) { return renderToStaticMarkup( {}} exportName="talk.m4a" disabled={false} />, ); } describe("TranslatePanel", () => { test("is a secondary disclosure named in plain words", () => { const html = render(); expect(html).toContain(" { const html = render(); expect(html).toContain("Downloads a translation model once (~113 MB)"); expect(html).toContain("never leaves"); }); test("says it works offline once the model is cached", () => { expect(render(["Xenova/opus-mt-da-en"])).toContain("Translation model downloaded — works offline"); }); test("defaults the direction from the transcript's language", () => { expect(render()).toMatch(/