diff --git a/packages/cli/src/ui/components/ContextSummaryDisplay.test.tsx b/packages/cli/src/ui/components/ContextSummaryDisplay.test.tsx index fd066d5534..0766e6f6da 100644 --- a/packages/cli/src/ui/components/ContextSummaryDisplay.test.tsx +++ b/packages/cli/src/ui/components/ContextSummaryDisplay.test.tsx @@ -31,14 +31,14 @@ describe('', () => { mcpServers: { 'test-server': { command: 'test' } }, ideContext: { workspaceState: { - openFiles: [{ path: '/a/b/c' }], + openFiles: [{ path: '/a/b/c', timestamp: Date.now() }], }, }, }; it('should render on a single line on a wide screen', () => { const { lastFrame } = renderWithWidth(120, baseProps); - const output = lastFrame(); + const output = lastFrame()!; expect(output).toContain( 'Using: 1 open file (ctrl+g to view) | 1 GEMINI.md file | 1 MCP server', ); @@ -48,7 +48,7 @@ describe('', () => { it('should render on multiple lines on a narrow screen', () => { const { lastFrame } = renderWithWidth(60, baseProps); - const output = lastFrame(); + const output = lastFrame()!; const expectedLines = [ ' Using:', ' - 1 open file (ctrl+g to view)', @@ -62,12 +62,12 @@ describe('', () => { it('should switch layout at the 80-column breakpoint', () => { // At 80 columns, should be on one line const { lastFrame: wideFrame } = renderWithWidth(80, baseProps); - expect(wideFrame().includes('\n')).toBe(false); + expect(wideFrame()!.includes('\n')).toBe(false); // At 79 columns, should be on multiple lines const { lastFrame: narrowFrame } = renderWithWidth(79, baseProps); - expect(narrowFrame().includes('\n')).toBe(true); - expect(narrowFrame().split('\n').length).toBe(4); + expect(narrowFrame()!.includes('\n')).toBe(true); + expect(narrowFrame()!.split('\n').length).toBe(4); }); it('should not render empty parts', () => { @@ -79,7 +79,7 @@ describe('', () => { }; const { lastFrame } = renderWithWidth(60, props); const expectedLines = [' Using:', ' - 1 open file (ctrl+g to view)']; - const actualLines = lastFrame().split('\n'); + const actualLines = lastFrame()!.split('\n'); expect(actualLines).toEqual(expectedLines); }); }); diff --git a/packages/cli/src/ui/components/Footer.test.tsx b/packages/cli/src/ui/components/Footer.test.tsx index 5d7df49610..a27f6b26d1 100644 --- a/packages/cli/src/ui/components/Footer.test.tsx +++ b/packages/cli/src/ui/components/Footer.test.tsx @@ -9,7 +9,8 @@ import { createMockSettings, } from '../../test-utils/render.js'; import { Footer } from './Footer.js'; -import { tildeifyPath } from '@google/gemini-cli-core'; +import { tildeifyPath, ToolCallDecision } from '@google/gemini-cli-core'; +import type { SessionStatsState } from '../contexts/SessionContext.js'; vi.mock('@google/gemini-cli-core', async (importOriginal) => { const original = @@ -32,15 +33,41 @@ const defaultProps = { branchName: 'main', }; -const sessionStats = { - sessionStats: { lastPromptTokenCount: 0, lastResponseTokenCount: 0 }, +const mockSessionStats: SessionStatsState = { + sessionId: 'test-session', + sessionStartTime: new Date(), + lastPromptTokenCount: 0, + promptCount: 0, + metrics: { + models: {}, + tools: { + totalCalls: 0, + totalSuccess: 0, + totalFail: 0, + totalDurationMs: 0, + totalDecisions: { + accept: 0, + reject: 0, + modify: 0, + [ToolCallDecision.AUTO_ACCEPT]: 0, + }, + byName: {}, + }, + files: { + totalLinesAdded: 0, + totalLinesRemoved: 0, + }, + }, }; describe('