import assert from "node:assert/strict";
import {readFileSync} from "node:fs";
import test from "node:test";
import {fileURLToPath} from "node:url";
import {dirname, join} from "node:path";

const root = join(dirname(fileURLToPath(import.meta.url)), "..");
const config = readFileSync(join(root, "observablehq.config.js"), "utf8");
const indexMd = readFileSync(join(root, "src/index.md"), "utf8");

test("dashboard navigation uses workplan labels", () => {
  assert.match(config, /name: "Workplans"/);
  assert.doesNotMatch(config, /name: "Workstreams"/);
});

test("overview page uses workplan-first user-facing copy", () => {
  assert.match(indexMd, /## Workplans by Repository/);
  assert.match(indexMd, /Active Workplans/);
  assert.doesNotMatch(indexMd, /No active workstreams\./);
  assert.doesNotMatch(indexMd, /Active Workstreams/);
});