fix(status): refresh typed status test fixtures

This commit is contained in:
Vincent Koc
2026-04-12 04:02:48 +01:00
parent df2de5c777
commit 5c7d6f55c2
2 changed files with 58 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ describe("buildStatusCommandReportData", () => {
...baseParams.summary.sessions,
recent: [
{
...baseParams.summary.sessions.recent[0],
key: "session-key",
kind: "direct",
updatedAt: 1,

View File

@@ -93,7 +93,21 @@ export const baseStatusSummary = {
count: 2,
paths: ["store.json"],
defaults: { model: "gpt-5.4", contextTokens: 12_000 },
recent: [{ key: "session-key", kind: "direct", updatedAt: 1, age: 5_000, model: "gpt-5.4" }],
recent: [
{
key: "session-key",
kind: "direct",
updatedAt: 1,
age: 5_000,
model: "gpt-5.4",
totalTokens: 12_000,
totalTokensFresh: true,
remainingTokens: 4_000,
percentUsed: 75,
contextTokens: 16_000,
flags: [],
},
],
byAgent: [],
},
} as unknown as StatusSummary;
@@ -126,7 +140,7 @@ export const baseStatusPluginCompatibility = [
export function createStatusLastHeartbeat(): HeartbeatEventPayload {
return {
ts: Date.now() - 30_000,
status: "ok",
status: "ok-token",
channel: "discord",
accountId: "acct",
};
@@ -172,7 +186,22 @@ export function createStatusCommandOverviewRowsParams(
surface: baseStatusOverviewSurface,
osLabel: "macOS",
summary: baseStatusSummary,
health: { durationMs: 42 },
health: {
ok: true,
ts: Date.now(),
durationMs: 42,
channels: {},
channelOrder: [],
channelLabels: {},
heartbeatSeconds: 60,
defaultAgentId: "main",
agents: [],
sessions: {
path: "store.json",
count: 2,
recent: [{ key: "session-key", updatedAt: 1, age: 5_000 }],
},
},
lastHeartbeat: createStatusLastHeartbeat(),
agentStatus: baseStatusAgentStatus,
memory: baseStatusMemory,
@@ -195,10 +224,33 @@ export function createStatusCommandReportDataParams(
osSummary: { label: "macOS" } as never,
summary: baseStatusSummary,
securityAudit: {
ts: Date.now(),
summary: { critical: 0, warn: 1, info: 0 },
findings: [{ severity: "warn", title: "Warn first", detail: "warn detail" }],
findings: [
{
checkId: "warn-first",
severity: "warn",
title: "Warn first",
detail: "warn detail",
},
],
},
health: {
ok: true,
ts: Date.now(),
durationMs: 42,
channels: {},
channelOrder: [],
channelLabels: {},
heartbeatSeconds: 60,
defaultAgentId: "main",
agents: [],
sessions: {
path: "store.json",
count: 2,
recent: [{ key: "session-key", updatedAt: 1, age: 5_000 }],
},
},
health: { durationMs: 42 },
usageLines: ["usage line"],
lastHeartbeat: createStatusLastHeartbeat(),
agentStatus: baseStatusAgentStatus,