|
|
@@ -12,12 +12,14 @@ import type {
|
|
|
import type { ConversationRootProps } from '../src/client/skeleton/ConversationRoot.tsx'
|
|
|
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'
|
|
|
import { makeTranslate } from '@deepseek-ai/dsh-client-test-runtime'
|
|
|
+import { en as commonEn } from '@deepseek-ai/dsh-client-locale/src/locales/en.ts'
|
|
|
import { zh as commonZh } from '@deepseek-ai/dsh-client-locale/src/locales/zh.ts'
|
|
|
import { createChatStore } from '../src/client/stores.ts'
|
|
|
import { SessionInputShell } from '../src/client/input/facade.ts'
|
|
|
-import { zh } from '../src/client/locales.ts'
|
|
|
+import { en, zh } from '../src/client/locales.ts'
|
|
|
import { ConversationRoot } from '../src/client/skeleton/ConversationRoot.tsx'
|
|
|
import { ConversationSession } from '../src/client/skeleton/ConversationSession.tsx'
|
|
|
+import { HeroShell } from '../src/client/skeleton/EmptyHero.tsx'
|
|
|
import { InputBar } from '../src/client/skeleton/InputBar.tsx'
|
|
|
import type { InputBarProps } from '../src/client/skeleton/InputBar.tsx'
|
|
|
import type {
|
|
|
@@ -213,6 +215,14 @@ function mount(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+describe('Hero chrome', () => {
|
|
|
+ it('renders the English preview badge through the hero locale seat', () => {
|
|
|
+ const view = render(<HeroShell t={makeTranslate(en, commonEn)} />)
|
|
|
+ expect(view.getByText('Let\'s start building')).toBeTruthy()
|
|
|
+ expect(view.getByText('Preview')).toBeTruthy()
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
describe('ConversationRoot resident composer', () => {
|
|
|
it('keeps composer text in the machine, mirrors to the chat store, and submits through the sink', () => {
|
|
|
const b = mount(conversationSnapshot())
|
|
|
@@ -273,6 +283,7 @@ describe('ConversationRoot resident composer', () => {
|
|
|
expect(host).not.toBeNull()
|
|
|
expect(header?.getAttribute('aria-hidden')).toBe('true')
|
|
|
expect(b.view.getByText('开始构建吧')).toBeTruthy()
|
|
|
+ expect(b.view.getByText('预览版')).toBeTruthy()
|
|
|
expect(b.view.queryByTestId('view-chat')).toBeNull()
|
|
|
// The same machine-backed textarea is live in the hero, and the
|
|
|
// persistence mirror stays bound (ConversationSession mounts chrome-hidden
|