Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/packages/swarm-ui/test/detail-sections.test.mjs
iris 2eaa02e892 swarm-ui: the agents page is one column of cards that open in place
The roster loses its second column and its table view. Selecting a card opens
its details under it as four folded sections: overview, settings, accounts and
the terminal. The status, message and wanted rows, which the card header
already shows, are gone from the details. The terminal page's details dialog
keeps the flat list.
2026-11-01 01:21:43 +01:00

30 lines
887 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 overview, settings and accounts, then the terminal", () => {
assert.deepEqual(sectionsFor(true), [
"overview",
"settings",
"accounts",
"terminal",
]);
});
test("a page beside a terminal leaves the terminal out", () => {
assert.deepEqual(sectionsFor(false), ["overview", "settings", "accounts"]);
});
test("only the overview starts open", () => {
assert.deepEqual(sectionsFor(true).filter(startsOpen), ["overview"]);
});
test("every section has a header", () => {
for (const s of sectionsFor(true)) assert.ok(SECTION_TITLE[s], s);
});