The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(desktop): assert locale-aware counts and timeline precision
brooklyn!cc0388e236be
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.tsindex 0fae0351473..ec180750861 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts@@ -463,9 +463,11 @@ describe('renderRpcResult', () => {})describe('session.usage', () => {- it('formats calls / input / output / total with thousands separators', () => {+ it('formats all usage counters in the host locale', () => {+ const format = new Intl.NumberFormat().format+expect(renderRpcResult({ calls: 12, input: 1_234_567, output: 89_012, total: 1_323_579 }, 'usage')).toBe(- 'Usage: 12 calls · 1,234,567 in / 89,012 out · 1,323,579 total'+ `Usage: ${format(12)} calls · ${format(1_234_567)} in / ${format(89_012)} out · ${format(1_323_579)} total`)})@@ -482,8 +484,7 @@ describe('renderRpcResult', () => {'usage')- expect(body.split('\n')).toEqual([- 'Usage: 1 calls · 10 in / 20 out · 30 total',+ expect(body.split('\n').slice(1)).toEqual(['📈 Account limits','Provider: openai-codex (Plus)','Weekly: 12% used',diff --git a/apps/desktop/src/components/assistant-ui/thread/timestamp.test.ts b/apps/desktop/src/components/assistant-ui/thread/timestamp.test.tsindex 511a41bd2ac..eb4f0b0622b 100644--- a/apps/desktop/src/components/assistant-ui/thread/timestamp.test.ts+++ b/apps/desktop/src/components/assistant-ui/thread/timestamp.test.ts@@ -40,10 +40,14 @@ describe('precise timeline timestamps', () => {const local = new Date(2026, 4, 1, 13, 2, 3, 456)const formatted = formatTimelineTimestamp(local.getTime() / 1000)- expect(formatted).toMatch(/13|1/)- expect(formatted).toContain('02')- expect(formatted).toContain('03')- expect(formatted).toContain('456')+ const expected = new Intl.DateTimeFormat(undefined, {+ fractionalSecondDigits: 3,+ hour: 'numeric',+ minute: '2-digit',+ second: '2-digit'+ }).format(local)++ expect(formatted).toBe(expected)})it('returns an empty string for invalid timeline values', () => {diff --git a/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.ts b/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.tsindex 2222ca917be..3c04f0ed320 100644--- a/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.ts+++ b/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.ts@@ -476,7 +476,7 @@ describe('clampForDisplay', () => {expect(clamped.length).toBeLessThan(oversized.length)expect(clamped.startsWith('x'.repeat(MAX_TOOL_RENDER_CHARS))).toBe(true)- expect(clamped).toContain('5,000 more characters truncated')+ expect(clamped).toContain(`${new Intl.NumberFormat().format(5_000)} more characters truncated`)})})