33 lines
910 B
JavaScript
33 lines
910 B
JavaScript
// The sections an opened agent card holds. Run by `npm test`, which Node runs
|
|
// with its built-in test runner and type stripping.
|
|
import assert from "node:assert/strict";
|
|
import { test } from "node:test";
|
|
import {
|
|
SECTION_TITLE,
|
|
sectionsFor,
|
|
startsOpen,
|
|
} from "../src/agent/detail/sections.ts";
|
|
|
|
test("a card holds status, terminal, subagents, then settings", () => {
|
|
assert.deepEqual(sectionsFor(true), [
|
|
"status",
|
|
"terminal",
|
|
"subagents",
|
|
"settings",
|
|
]);
|
|
});
|
|
|
|
test("a page beside a terminal leaves the terminal and subagents out", () => {
|
|
assert.deepEqual(sectionsFor(false), ["status", "settings"]);
|
|
});
|
|
|
|
test("the status and the terminal start open", () => {
|
|
assert.deepEqual(sectionsFor(true).filter(startsOpen), [
|
|
"status",
|
|
"terminal",
|
|
]);
|
|
});
|
|
|
|
test("every section has a header", () => {
|
|
for (const s of sectionsFor(true)) assert.ok(SECTION_TITLE[s], s);
|
|
});
|