refactor(ui): revamp exit stats display (#2771)

This commit is contained in:
Abhi
2025-06-30 20:28:49 -04:00
committed by GitHub
parent 3587054d32
commit f91927569c
9 changed files with 123 additions and 424 deletions

View File

@@ -33,7 +33,7 @@ const renderWithMockedStats = (metrics: SessionMetrics) => {
};
describe('<SessionSummaryDisplay />', () => {
it('correctly sums and displays stats from multiple models', () => {
it('renders the summary display with a title', () => {
const metrics: SessionMetrics = {
models: {
'gemini-2.5-pro': {
@@ -47,17 +47,6 @@ describe('<SessionSummaryDisplay />', () => {
tool: 200,
},
},
'gemini-2.5-flash': {
api: { totalRequests: 5, totalErrors: 0, totalLatencyMs: 12345 },
tokens: {
prompt: 500,
candidates: 1000,
total: 1500,
cached: 100,
thoughts: 50,
tool: 20,
},
},
},
tools: {
totalCalls: 0,
@@ -72,25 +61,7 @@ describe('<SessionSummaryDisplay />', () => {
const { lastFrame } = renderWithMockedStats(metrics);
const output = lastFrame();
// Verify totals are summed correctly
expect(output).toContain('Cumulative Stats (15 API calls)');
expect(output).toContain('Agent powering down. Goodbye!');
expect(output).toMatchSnapshot();
});
it('renders zero state correctly', () => {
const zeroMetrics: SessionMetrics = {
models: {},
tools: {
totalCalls: 0,
totalSuccess: 0,
totalFail: 0,
totalDurationMs: 0,
totalDecisions: { accept: 0, reject: 0, modify: 0 },
byName: {},
},
};
const { lastFrame } = renderWithMockedStats(zeroMetrics);
expect(lastFrame()).toMatchSnapshot();
});
});