From 286d91912929f9fb6e0d01591286ecd318b3eb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Thu, 24 Sep 2026 13:02:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9A=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=BB=88=E6=80=81=E7=94=A8=E4=BE=8B=E6=96=AD=E8=A8=80=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E5=90=8E=E7=9A=84=E6=96=87=E6=A1=88=E4=B8=8D=E8=90=BD?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 断言原来查的是命令 Err 的原始文本,而这条文本永远不会被渲染(前端先用 projectRuntimeVisibleError 映射成通用可见文案,再走头部状态行的横幅),因此断言空过、盖不住"命令通道又写一条聊天文案"这个回归。 改成在 `陶泥儿消息` 列表里查映射后的文案(横幅不在这个列表里),并用一次变异验证:在 catch 里补一条 appendLocalMessage 后该用例变红,撤掉即绿。 --- .../tests/appSurface/chat-composer.suite.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts b/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts index e2283ab9e..ed3a94467 100644 --- a/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts +++ b/apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts @@ -598,10 +598,13 @@ export function registerChatComposerControlTests() { expect( within(surface).getByRole('button', { name: '发送' }), ).not.toBeNull(); - // 命令返回那条通道只负责横幅:它不写第二条聊天文案。 + // 命令返回那条通道只负责横幅:它不写第二条聊天文案。真失败时 `runTurn` 会先把原始错误 + // 映射成通用可见文案再走横幅(横幅在头部的状态行,不在会话列表里),所以这里查映射后的 + // 文案有没有出现在会话列表里,而不是那条永远不会被渲染的原始错误文本。 + const conversation = within(surface).getByLabelText('陶泥儿消息'); expect( - within(surface).queryAllByText( - '模拟宿主失败:错误只走终态事件,命令只回报失败', + within(conversation).queryAllByText( + '陶泥儿智能创作 执行失败,请稍后重试', ), ).toHaveLength(0); });