import assert from "node:assert/strict";
import test from "node:test";
import { renderWorker } from "../helpers/render-worker.mjs";

test("renders the proofreading route and its client workspace loading state", async () => {
  const response = await renderWorker("/books/book-1/edit");
  assert.equal(response.status, 200);
  const html = await response.text();
  assert.match(html, /校对与整理/);
  assert.match(html, /正在准备校对页/);
  assert.match(html, /立即收听/);
  assert.match(html, /公式和表格默认跳过/);
  assert.match(html, /Proofreader-[A-Za-z0-9_-]+\.js/);
});
