fix: stabilize v03 live web entry
This commit is contained in:
@@ -3,6 +3,7 @@ import test from "node:test";
|
||||
|
||||
import type { ApiResult, HwpodNodeOpsResponse, HwpodSpecsResponse, LiveProbePayload, LiveSurface } from "../src/types/index.ts";
|
||||
import { summarizeBuilds, summarizeHwpodNodeOps, summarizeProbeRows } from "../src/stores/workbench-live.ts";
|
||||
import { liveCall } from "../src/stores/workbench.ts";
|
||||
|
||||
test("R3 probe summary exposes React WorkbenchProbe rows", () => {
|
||||
const summary = summarizeProbeRows(liveSurface());
|
||||
@@ -33,6 +34,19 @@ test("R3 HWPOD summary combines specs availability, node-ops and blocker stream"
|
||||
assert.ok(summary.streamLines.some((line) => line.includes("op_01_workspace_ls workspace.ls hwpod_node_unavailable")));
|
||||
});
|
||||
|
||||
test("R3 live refresh keeps partial evidence when one endpoint throws", async () => {
|
||||
const failed = await liveCall("live builds", async () => {
|
||||
throw new Error("network edge reset");
|
||||
});
|
||||
assert.equal(failed.ok, false);
|
||||
assert.equal(failed.status, 0);
|
||||
assert.match(failed.error ?? "", /live builds: network edge reset/);
|
||||
|
||||
const passed = await liveCall("health/live", async () => ok<LiveProbePayload>({ status: "ok", revision: "155530d8d9355887a23a08e341291994cc312f54" }));
|
||||
assert.equal(passed.ok, true);
|
||||
assert.equal(passed.data?.revision, "155530d8d9355887a23a08e341291994cc312f54");
|
||||
});
|
||||
|
||||
function liveSurface(): LiveSurface {
|
||||
const liveProbe = ok<LiveProbePayload>({ serviceId: "hwlab-cloud-api", environment: "v03", status: "ok", ready: true, revision: "c0cbdbb38de77f1ecc9d1222438a13294d81d4dd", observedAt: "2026-06-13T17:59:15.000Z" });
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user