import { expect, test } from "bun:test"; import { renderToString } from "react-dom/server"; import { ConvertPanelView, ReadOnlyView } from "../src/ui/ConvertPanel"; const noop = () => {}; test("the owner sees the action and what it does", () => { const html = renderToString(); expect(html).toContain("Make editable in the studio"); expect(html).toContain("same id"); expect(html).toContain("progress and notes"); expect(html).toContain("outside git"); expect(html).toContain(" { const running = renderToString(); expect(running).toContain('role="progressbar"'); expect(running).toContain('aria-valuenow="40"'); expect(running).toContain("Checksumming media/a.mp4"); expect(running).toContain("disabled"); const failed = renderToString(); expect(failed).toContain('role="alert"'); expect(failed).toContain("the imported manifest is invalid"); expect(failed).toContain("Try again"); }); test("read-only view: imported for the owner offers the action; for others explains who can", () => { const owner = renderToString(); expect(owner).toContain("Make editable in the studio"); expect(owner).not.toContain("/d/courses/imp"); const author = renderToString(); expect(author).not.toContain("); expect(outside).toContain("/repos/o"); expect(outside).not.toContain("