fix(test): add missing metrics and model fields to Footer test mock

useStatusLine hook accesses sessionStats.metrics.tools.totalCalls,
sessionStats.metrics.files.totalLinesAdded, and currentModel which
were missing from the mock UIState, causing a TypeError crash during
render and making 4 Footer tests fail in CI.
This commit is contained in:
wenshao 2026-04-08 18:28:40 +08:00
parent 24a28d5fb0
commit c36953816c

View file

@ -34,7 +34,22 @@ const createMockUIState = (overrides: Partial<UIState> = {}): UIState =>
({
sessionStats: {
lastPromptTokenCount: 100,
sessionId: 'test-session',
metrics: {
models: {},
tools: {
totalCalls: 0,
totalSuccess: 0,
totalFail: 0,
totalDurationMs: 0,
totalDecisions: { accept: 0, reject: 0, modify: 0, auto_accept: 0 },
byName: {},
},
files: { totalLinesAdded: 0, totalLinesRemoved: 0 },
},
},
currentModel: 'gemini-pro',
branchName: undefined,
geminiMdFileCount: 0,
contextFileNames: [],
showToolDescriptions: false,