fix(ui): handle optional metrics in Composer component

This commit is contained in:
qqqys 2026-03-17 21:37:02 +08:00
parent 03e59256c4
commit 617874f152
2 changed files with 5 additions and 13 deletions

View file

@ -313,11 +313,7 @@ describe('<LoadingIndicator />', () => {
describe('token display', () => {
it('should display output tokens inline with arrow notation', () => {
const { lastFrame } = renderWithContext(
<LoadingIndicator
{...defaultProps}
promptTokens={1500}
candidatesTokens={847}
/>,
<LoadingIndicator {...defaultProps} candidatesTokens={847} />,
StreamingState.Responding,
);
const output = lastFrame();
@ -329,11 +325,7 @@ describe('<LoadingIndicator />', () => {
it('should not display tokens when output tokens is 0', () => {
const { lastFrame } = renderWithContext(
<LoadingIndicator
{...defaultProps}
promptTokens={1500}
candidatesTokens={0}
/>,
<LoadingIndicator {...defaultProps} candidatesTokens={0} />,
StreamingState.Responding,
);
const output = lastFrame();