mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
refactor(ui): revamp exit stats display (#2771)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user