From 452ba583d2ba533a37f5e4086333bc7c9f7191b4 Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Fri, 31 Jul 2026 10:54:36 +0800 Subject: [PATCH] test(client-ui-conversation): pass locale seat to web-card GenericToolCard/DetailsPanel renders master's locale rollout made `t` a required prop on GenericToolCardProps and the details slot; the web-card spec predates it. Supply the makeTranslate seat the sibling suites use. --- .../client/ui-conversation/tests/web-card.spec.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/client/ui-conversation/tests/web-card.spec.tsx b/packages/client/ui-conversation/tests/web-card.spec.tsx index e92612c810..69df3e5fbf 100644 --- a/packages/client/ui-conversation/tests/web-card.spec.tsx +++ b/packages/client/ui-conversation/tests/web-card.spec.tsx @@ -20,11 +20,17 @@ import { createChatStore } from '../src/client/stores.ts' import { GenericToolCard } from '../src/client/chat/GenericToolCard.tsx' import { DetailsPanel } from '../src/client/skeleton/DetailsPanel.tsx' import { WebRow, webToolview } from '../src/client/toolviews/web-row.tsx' +import { makeTranslate } from '@deepseek-ai/dsh-client-test-runtime' +import { zh as commonZh } from '@deepseek-ai/dsh-client-locale/src/locales/zh.ts' +import { zh } from '../src/client/locales.ts' afterEach(cleanup) const SID = 's1' as SessionId +/** Locale seat for the card render sites (GenericToolCard, DetailsPanel), as the sibling suites build it. */ +const t = makeTranslate(zh, commonZh) + const SEARCH_ARGS = '{"query":"deepseek harness"}' const FETCH_ARGS = '{"url":"https://example.com/page"}' @@ -164,7 +170,7 @@ describe('chat row web body', () => { // card is resident there too. const view = render() + }), 'fx-web')} t={t} />) expect(view.getByText('Titled')).toBeTruthy() expect(view.container.querySelector('[data-web="search"]')).not.toBeNull() }) @@ -172,7 +178,7 @@ describe('chat row web body', () => { it('the GenericToolCard fallback keeps the plain row for a non-web call', () => { const view = render() + }), 'echo')} t={t} />) expect(view.container.querySelector('[data-web]')).toBeNull() }) }) @@ -199,6 +205,7 @@ describe('DetailsPanel web Output section', () => { useStore={bindSnapshotSelector(chat)} actions={chat.actions} closeDetails={vi.fn()} + t={t} />, ) }