The domain column showed a dash unless a hive had a dashboard but sorted and filtered on the domain alone, so rows looked mis-sorted. It now shows the domain as text when there is no dashboard to link. An empty hive roster says so. The schedule form's agent names reload with the schedules and the form says when that load failed.
31 lines
858 B
JavaScript
31 lines
858 B
JavaScript
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { domainCell } from "../src/pages/hive-domain.ts";
|
|
|
|
test("domainCell: a domain with a dashboard links to it", () => {
|
|
assert.deepEqual(
|
|
domainCell({ domain: "a.example", dashboard: "d.a.example" }),
|
|
{
|
|
text: "a.example",
|
|
href: "https://d.a.example/",
|
|
},
|
|
);
|
|
});
|
|
|
|
test("domainCell: a domain without a dashboard still shows as text", () => {
|
|
assert.deepEqual(domainCell({ domain: "a.example", dashboard: null }), {
|
|
text: "a.example",
|
|
href: null,
|
|
});
|
|
});
|
|
|
|
test("domainCell: no domain is empty text and no link", () => {
|
|
assert.deepEqual(domainCell({ domain: null, dashboard: "d.a.example" }), {
|
|
text: "",
|
|
href: null,
|
|
});
|
|
assert.deepEqual(domainCell({ domain: null, dashboard: null }), {
|
|
text: "",
|
|
href: null,
|
|
});
|
|
});
|