
























@@ -9,67 +9,60 @@ import {
99createStatusCommandOverviewRowsParams,
1010} from "./status.test-support.ts";
111112+function findRowValue(rows: Array<{ Item: string; Value: string }>, item: string) {
13+return rows.find((row) => row.Item === item)?.Value;
14+}
15+1216describe("status-overview-rows", () => {
1317it("builds command overview rows from the shared surface", () => {
14-expect(buildStatusCommandOverviewRows(createStatusCommandOverviewRowsParams())).toEqual(
15-expect.arrayContaining([
16-{ Item: "OS", Value: `macOS · node ${process.versions.node}` },
17-{
18-Item: "Memory",
19-Value:
20-"1 files · 2 chunks · plugin memory · ok(vector ready) · warn(fts ready) · muted(cache warm)",
21-},
22-{ Item: "Plugin compatibility", Value: "warn(1 notice · 1 plugin)" },
23-{ Item: "Sessions", Value: "2 active · default gpt-5.5 (12k ctx) · store.json" },
24-]),
18+const rows = buildStatusCommandOverviewRows(createStatusCommandOverviewRowsParams());
19+20+expect(findRowValue(rows, "OS")).toBe(`macOS · node ${process.versions.node}`);
21+expect(findRowValue(rows, "Memory")).toBe(
22+"1 files · 2 chunks · plugin memory · ok(vector ready) · warn(fts ready) · muted(cache warm)",
23+);
24+expect(findRowValue(rows, "Plugin compatibility")).toBe("warn(1 notice · 1 plugin)");
25+expect(findRowValue(rows, "Sessions")).toBe(
26+"2 active · default gpt-5.5 (12k ctx) · store.json",
2527);
2628});
27292830it("marks skipped memory inspection as not checked in fast status output", () => {
29-expect(
30-buildStatusCommandOverviewRows(
31-createStatusCommandOverviewRowsParams({
32-memory: null,
33-memoryPlugin: { enabled: true, slot: "memory-lancedb-pro" },
34-}),
35-),
36-).toEqual(
37-expect.arrayContaining([
38-{
39-Item: "Memory",
40-Value: "muted(enabled (plugin memory-lancedb-pro) · not checked)",
41-},
42-]),
31+const rows = buildStatusCommandOverviewRows(
32+createStatusCommandOverviewRowsParams({
33+memory: null,
34+memoryPlugin: { enabled: true, slot: "memory-lancedb-pro" },
35+}),
36+);
37+38+expect(findRowValue(rows, "Memory")).toBe(
39+"muted(enabled (plugin memory-lancedb-pro) · not checked)",
4340);
4441});
45424643it("builds status-all overview rows from the shared surface", () => {
47-expect(
48-buildStatusAllOverviewRows({
49-surface: {
50- ...baseStatusOverviewSurface,
51-tailscaleMode: "off",
52-tailscaleHttpsUrl: null,
53-gatewayConnection: { url: "wss://gateway.example.com", urlSource: "config" },
54-},
55-osLabel: "macOS",
56-configPath: "/tmp/openclaw.json",
57-secretDiagnosticsCount: 2,
58-agentStatus: {
59-bootstrapPendingCount: 1,
60-totalSessions: 2,
61-agents: [{ id: "main", lastActiveAgeMs: 60_000 }],
62-},
63-tailscaleBackendState: "Running",
64-}),
65-).toEqual(
66-expect.arrayContaining([
67-{ Item: "Version", Value: VERSION },
68-{ Item: "OS", Value: "macOS" },
69-{ Item: "Config", Value: "/tmp/openclaw.json" },
70-{ Item: "Security", Value: "Run: openclaw security audit --deep" },
71-{ Item: "Secrets", Value: "2 diagnostics" },
72-]),
73-);
44+const rows = buildStatusAllOverviewRows({
45+surface: {
46+ ...baseStatusOverviewSurface,
47+tailscaleMode: "off",
48+tailscaleHttpsUrl: null,
49+gatewayConnection: { url: "wss://gateway.example.com", urlSource: "config" },
50+},
51+osLabel: "macOS",
52+configPath: "/tmp/openclaw.json",
53+secretDiagnosticsCount: 2,
54+agentStatus: {
55+bootstrapPendingCount: 1,
56+totalSessions: 2,
57+agents: [{ id: "main", lastActiveAgeMs: 60_000 }],
58+},
59+tailscaleBackendState: "Running",
60+});
61+62+expect(findRowValue(rows, "Version")).toBe(VERSION);
63+expect(findRowValue(rows, "OS")).toBe("macOS");
64+expect(findRowValue(rows, "Config")).toBe("/tmp/openclaw.json");
65+expect(findRowValue(rows, "Security")).toBe("Run: openclaw security audit --deep");
66+expect(findRowValue(rows, "Secrets")).toBe("2 diagnostics");
7467});
7568});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。