Files
qwen-code/packages/web-shell/client/utils/formatTokenCount.test.ts
Shaojin Wen c6c276b05c feat(web-shell): improve composer and context usage presentation (#11509)
* feat(web-shell): improve composer and context usage presentation

* fix(web-shell): address context presentation review feedback

* test(web-shell): align brand fixtures with startup and layout

* fix(web-shell): improve context readability and availability
2026-09-11 03:01:33 +00:00

12 lines
426 B
TypeScript

import { describe, expect, it } from 'vitest';
import { formatContextTokens } from './formatTokenCount';
describe('formatContextTokens', () => {
it('renders k/M units with one decimal', () => {
expect(formatContextTokens(512)).toBe('512');
expect(formatContextTokens(47_851)).toBe('47.9k');
expect(formatContextTokens(1_000_000)).toBe('1.0M');
expect(formatContextTokens(1_234_567)).toBe('1.2M');
});
});