@@ -311,7 +311,7 @@ describe("AiCommandBar", () => {
311311 it ( "shows a quiet thinking status while AI is running" , ( ) => {
312312 render (
313313 < AiCommandBar
314- language = "zh-CN "
314+ language = "en "
315315 open
316316 prompt = "rewrite"
317317 submitting
@@ -323,9 +323,9 @@ describe("AiCommandBar", () => {
323323
324324 const status = screen . getByRole ( "status" ) ;
325325
326- expect ( status ) . toHaveTextContent ( / ^ 正 在 思 考 $ / ) ;
326+ expect ( status ) . toHaveTextContent ( / ^ T h i n k i n g $ / ) ;
327327 expect ( status ) . toHaveClass ( "text-(--text-secondary)" ) ;
328- expect ( screen . getByText ( "正在思考 " ) ) . toHaveClass ( "ai-command-thinking-text" ) ;
328+ expect ( screen . getByText ( "Thinking " ) ) . toHaveClass ( "ai-command-thinking-text" ) ;
329329 expect ( screen . queryByText ( "Reading context" ) ) . not . toBeInTheDocument ( ) ;
330330 expect ( screen . queryByText ( "Generating suggestion" ) ) . not . toBeInTheDocument ( ) ;
331331 } ) ;
@@ -334,23 +334,23 @@ describe("AiCommandBar", () => {
334334 render (
335335 < AiCommandBar
336336 externalActionPending
337- language = "zh-CN "
337+ language = "en "
338338 open
339- prompt = "润色 "
339+ prompt = "Polish "
340340 submitting = { false }
341341 onClose = { vi . fn ( ) }
342342 onPromptChange = { vi . fn ( ) }
343343 onSubmit = { vi . fn ( ) }
344344 />
345345 ) ;
346346
347- const input = screen . getByRole ( "textbox" , { name : "AI 命令 " } ) ;
347+ const input = screen . getByRole ( "textbox" , { name : "AI command " } ) ;
348348 const status = screen . getByRole ( "status" ) ;
349349 const commandBox = input . closest ( ".ai-command-box" ) ;
350350
351351 expect ( input ) . toHaveAttribute ( "readonly" ) ;
352352 expect ( input ) . toHaveAttribute ( "aria-busy" , "true" ) ;
353- expect ( status ) . toHaveTextContent ( / ^ 正 在 思 考 $ / ) ;
353+ expect ( status ) . toHaveTextContent ( / ^ T h i n k i n g $ / ) ;
354354 expect ( commandBox ) . toHaveClass ( "min-h-21" , "rounded-lg" , "border-(--ai-command-expanded-border)" ) ;
355355 expect ( commandBox ) . not . toHaveClass ( "h-14" , "rounded-xl" ) ;
356356 } ) ;
@@ -383,17 +383,17 @@ describe("AiCommandBar", () => {
383383
384384 render (
385385 < AiCommandBar
386- language = "zh-CN "
386+ language = "en "
387387 open
388- prompt = "都有什么ai "
388+ prompt = "Which AI models are available? "
389389 submitting = { false }
390390 onClose = { vi . fn ( ) }
391391 onPromptChange = { onPromptChange }
392392 onSubmit = { onSubmit }
393393 />
394394 ) ;
395395
396- const input = screen . getByRole ( "textbox" , { name : "AI 命令 " } ) ;
396+ const input = screen . getByRole ( "textbox" , { name : "AI command " } ) ;
397397 fireEvent . compositionStart ( input ) ;
398398 fireEvent . keyDown ( input , { key : "Enter" , nativeEvent : { isComposing : true , keyCode : 229 } } ) ;
399399 fireEvent . compositionEnd ( input ) ;
@@ -537,7 +537,7 @@ describe("AiCommandBar", () => {
537537
538538 render (
539539 < AiCommandBar
540- language = "zh-CN "
540+ language = "en "
541541 open
542542 prompt = ""
543543 submitting = { false }
@@ -547,26 +547,26 @@ describe("AiCommandBar", () => {
547547 />
548548 ) ;
549549
550- fireEvent . click ( screen . getByRole ( "textbox" , { name : "AI 命令 " } ) ) ;
551- fireEvent . click ( await screen . findByRole ( "button" , { name : "翻译 " } ) ) ;
550+ fireEvent . click ( screen . getByRole ( "textbox" , { name : "AI command " } ) ) ;
551+ fireEvent . click ( await screen . findByRole ( "button" , { name : "Translate " } ) ) ;
552552
553553 expect ( onPromptChange ) . toHaveBeenCalledWith (
554- defaultAiQuickActionPrompt ( "translate" , "Simplified Chinese " )
554+ defaultAiQuickActionPrompt ( "translate" , "English " )
555555 ) ;
556556 expect ( onSubmit ) . toHaveBeenCalledWith (
557- defaultAiQuickActionPrompt ( "translate" , "Simplified Chinese " ) ,
557+ defaultAiQuickActionPrompt ( "translate" , "English " ) ,
558558 "translate"
559559 ) ;
560560 } ) ;
561561
562562 it ( "keeps quick action generation in the compact input style" , async ( ) => {
563563 const onPromptChange = vi . fn ( ) ;
564564 const onSubmit = vi . fn ( ) ;
565- const chinesePolishPrompt = defaultAiQuickActionPrompt ( "polish" , "Simplified Chinese " ) ;
565+ const englishPolishPrompt = defaultAiQuickActionPrompt ( "polish" , "English " ) ;
566566
567567 const { rerender } = render (
568568 < AiCommandBar
569- language = "zh-CN "
569+ language = "en "
570570 open
571571 prompt = ""
572572 submitting = { false }
@@ -576,14 +576,14 @@ describe("AiCommandBar", () => {
576576 />
577577 ) ;
578578
579- fireEvent . click ( screen . getByRole ( "textbox" , { name : "AI 命令 " } ) ) ;
580- fireEvent . click ( await screen . findByRole ( "button" , { name : "润色 " } ) ) ;
579+ fireEvent . click ( screen . getByRole ( "textbox" , { name : "AI command " } ) ) ;
580+ fireEvent . click ( await screen . findByRole ( "button" , { name : "Polish " } ) ) ;
581581
582582 rerender (
583583 < AiCommandBar
584- language = "zh-CN "
584+ language = "en "
585585 open
586- prompt = { chinesePolishPrompt }
586+ prompt = { englishPolishPrompt }
587587 submitting
588588 onClose = { vi . fn ( ) }
589589 onInterrupt = { vi . fn ( ) }
@@ -595,14 +595,14 @@ describe("AiCommandBar", () => {
595595 const status = screen . getByRole ( "status" ) ;
596596 const commandBox = status . closest ( ".ai-command-box" ) ;
597597
598- expect ( onPromptChange ) . toHaveBeenCalledWith ( chinesePolishPrompt ) ;
599- expect ( onSubmit ) . toHaveBeenCalledWith ( chinesePolishPrompt , "polish" ) ;
600- expect ( status ) . toHaveTextContent ( "润色中…… " ) ;
601- expect ( screen . getByText ( "润色中…… " ) ) . toHaveClass ( "ai-command-inline-loading-text" ) ;
598+ expect ( onPromptChange ) . toHaveBeenCalledWith ( englishPolishPrompt ) ;
599+ expect ( onSubmit ) . toHaveBeenCalledWith ( englishPolishPrompt , "polish" ) ;
600+ expect ( status ) . toHaveTextContent ( "Polishing... " ) ;
601+ expect ( screen . getByText ( "Polishing... " ) ) . toHaveClass ( "ai-command-inline-loading-text" ) ;
602602 expect ( commandBox ) . toHaveClass ( "h-14" , "rounded-xl" , "border-(--border-default)" ) ;
603603 expect ( commandBox ) . not . toHaveClass ( "min-h-21" , "border-(--ai-command-expanded-border)" ) ;
604- expect ( screen . queryByRole ( "combobox" , { name : "AI 模型 " } ) ) . not . toBeInTheDocument ( ) ;
605- expect ( screen . getByRole ( "button" , { name : "中断 AI 命令 " } ) ) . toBeInTheDocument ( ) ;
604+ expect ( screen . queryByRole ( "combobox" , { name : "AI model " } ) ) . not . toBeInTheDocument ( ) ;
605+ expect ( screen . getByRole ( "button" , { name : "Stop AI command " } ) ) . toBeInTheDocument ( ) ;
606606 } ) ;
607607
608608 it ( "keeps the compact command input vertically centered" , ( ) => {
@@ -680,9 +680,9 @@ describe("AiCommandBar", () => {
680680
681681 render (
682682 < AiCommandBar
683- language = "zh-CN "
683+ language = "en "
684684 open
685- prompt = "润色 "
685+ prompt = "Polish "
686686 selectedProviderId = "deepseek"
687687 submitting = { false }
688688 supportsThinking
@@ -692,12 +692,12 @@ describe("AiCommandBar", () => {
692692 />
693693 ) ;
694694
695- const input = screen . getByRole ( "textbox" , { name : "AI 命令 " } ) ;
695+ const input = screen . getByRole ( "textbox" , { name : "AI command " } ) ;
696696 fireEvent . click ( input ) ;
697- fireEvent . click ( screen . getByRole ( "button" , { name : "深度思考 " } ) ) ;
697+ fireEvent . click ( screen . getByRole ( "button" , { name : "Deep thinking " } ) ) ;
698698 fireEvent . keyDown ( input , { key : "Enter" } ) ;
699699
700- expect ( screen . getByRole ( "button" , { name : "深度思考 " } ) ) . toHaveAttribute ( "aria-pressed" , "true" ) ;
700+ expect ( screen . getByRole ( "button" , { name : "Deep thinking " } ) ) . toHaveAttribute ( "aria-pressed" , "true" ) ;
701701 expect ( onSubmit ) . toHaveBeenCalledWith ( undefined , "custom" , { thinkingEnabled : true } ) ;
702702 } ) ;
703703} ) ;
0 commit comments