bug: only show tool tokens if > 0 (#985)
This commit is contained in:
parent
6bb3f27f6c
commit
32da693b91
|
@ -66,6 +66,17 @@ describe('<StatsColumn />', () => {
|
|||
);
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('hides the tool use row when there are no tool use tokens', () => {
|
||||
const statsWithNoToolUse: FormattedStats = {
|
||||
...mockStats,
|
||||
toolUseTokens: 0,
|
||||
};
|
||||
const { lastFrame } = render(
|
||||
<StatsColumn title="Test Stats" stats={statsWithNoToolUse} />,
|
||||
);
|
||||
expect(lastFrame()).not.toContain('Tool Use Tokens');
|
||||
});
|
||||
});
|
||||
|
||||
describe('<DurationColumn />', () => {
|
||||
|
|
|
@ -66,10 +66,12 @@ export const StatsColumn: React.FC<{
|
|||
label="Output Tokens"
|
||||
value={stats.outputTokens.toLocaleString()}
|
||||
/>
|
||||
<StatRow
|
||||
label="Tool Use Tokens"
|
||||
value={stats.toolUseTokens.toLocaleString()}
|
||||
/>
|
||||
{stats.toolUseTokens > 0 && (
|
||||
<StatRow
|
||||
label="Tool Use Tokens"
|
||||
value={stats.toolUseTokens.toLocaleString()}
|
||||
/>
|
||||
)}
|
||||
<StatRow
|
||||
label="Thoughts Tokens"
|
||||
value={stats.thoughtsTokens.toLocaleString()}
|
||||
|
|
|
@ -32,7 +32,6 @@ exports[`<SessionSummaryDisplay /> > renders zero state correctly 1`] = `
|
|||
│ │
|
||||
│ Input Tokens 0 │
|
||||
│ Output Tokens 0 │
|
||||
│ Tool Use Tokens 0 │
|
||||
│ Thoughts Tokens 0 │
|
||||
│ Cached Tokens 0 │
|
||||
│ ────────────────────────── │
|
||||
|
|
|
@ -30,7 +30,6 @@ exports[`<StatsDisplay /> > renders zero state correctly 1`] = `
|
|||
│ │
|
||||
│ Input Tokens 0 Input Tokens 0 │
|
||||
│ Output Tokens 0 Output Tokens 0 │
|
||||
│ Tool Use Tokens 0 Tool Use Tokens 0 │
|
||||
│ Thoughts Tokens 0 Thoughts Tokens 0 │
|
||||
│ Cached Tokens 0 Cached Tokens 0 │
|
||||
│ ───────────────────────────────────────────── ───────────────────────────────────────────── │
|
||||
|
|
Loading…
Reference in New Issue