From 32a1b283e5e6f7fec9779985e0c2cea863892687 Mon Sep 17 00:00:00 2001 From: Linghong Date: Wed, 16 Sep 2026 06:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E7=95=8C=E9=9D=A2=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E6=B5=8B=E8=AF=95=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将旧回合过程标识迁移到当前工具组测试标识。 处理资源路径重复渲染时的多元素断言。 --- .../appSurface/project-development.suite.ts | 40 +++++++++++-------- .../tests/appSurface/tool-call-group.suite.ts | 2 +- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts b/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts index c1fa4e352..58d784dd4 100644 --- a/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts +++ b/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts @@ -7806,9 +7806,9 @@ export function registerProjectSupervisorSurfaceTests() { ); await waitFor(() => expect( - within(within(supervisorSurface).getByTestId('turn-process')).getByText( - '需求已接收', - ), + within( + within(supervisorSurface).getByTestId('agent-tool-call-group'), + ).getByText('需求已接收'), ).not.toBeNull(), ); const directMessageList = @@ -7818,8 +7818,9 @@ export function registerProjectSupervisorSurfaceTests() { scrollHeight: { configurable: true, value: 640 }, scrollTop: { configurable: true, value: 0, writable: true }, }); - const waitingProcessCard = - within(directMessageList).getByTestId('turn-process'); + const waitingProcessCard = within(directMessageList).getByTestId( + 'agent-tool-call-group', + ); expect(waitingProcessCard.parentElement).toBe(directMessageList); expect( within(waitingProcessCard).getByText('正在等待陶泥儿开始'), @@ -7871,8 +7872,9 @@ export function registerProjectSupervisorSurfaceTests() { }, }); }); - const thinkingProcessCard = - within(directMessageList).getByTestId('turn-process'); + const thinkingProcessCard = within(directMessageList).getByTestId( + 'agent-tool-call-group', + ); expect(within(thinkingProcessCard).getByText('任务执行中')).not.toBeNull(); expect( within(thinkingProcessCard).getByLabelText('陶泥儿正在执行的内容') @@ -7891,8 +7893,9 @@ export function registerProjectSupervisorSurfaceTests() { }, }); }); - const runningProcessCard = - within(directMessageList).getByTestId('turn-process'); + const runningProcessCard = within(directMessageList).getByTestId( + 'agent-tool-call-group', + ); expect(within(runningProcessCard).getByText('任务执行中')).not.toBeNull(); expect( within(runningProcessCard).getByRole('button', { name: '展开' }), @@ -7947,8 +7950,9 @@ export function registerProjectSupervisorSurfaceTests() { }); supervisorHarness.emitProgress('direct', '旧 fallback 不能覆盖精确事件'); }); - const streamingProcessCard = - within(directMessageList).getByTestId('turn-process'); + const streamingProcessCard = within(directMessageList).getByTestId( + 'agent-tool-call-group', + ); expect(within(streamingProcessCard).getByText('回复生成中')).not.toBeNull(); expect( within(streamingProcessCard).getByLabelText('陶泥儿正在执行的内容') @@ -8065,7 +8069,7 @@ export function registerProjectSupervisorSurfaceTests() { ), ).toBeNull(); expect( - within(directMessageList).queryByTestId('turn-process'), + within(directMessageList).queryByTestId('agent-tool-call-group'), ).toBeNull(); }); await waitFor(() => { @@ -8122,8 +8126,9 @@ export function registerProjectSupervisorSurfaceTests() { }, }); }); - const failedTurnProcessCard = - within(directMessageList).getByTestId('turn-process'); + const failedTurnProcessCard = within(directMessageList).getByTestId( + 'agent-tool-call-group', + ); expect( within(failedTurnProcessCard).getByText('回复生成中'), ).not.toBeNull(); @@ -8150,8 +8155,9 @@ export function registerProjectSupervisorSurfaceTests() { expect( within(supervisorSurface).queryByLabelText('陶泥儿实时回复'), ).toBeNull(); - const failedStatusProcessCard = - within(directMessageList).getByTestId('turn-process'); + const failedStatusProcessCard = within(directMessageList).getByTestId( + 'agent-tool-call-group', + ); expect( within(failedStatusProcessCard).getByText('处理失败'), ).not.toBeNull(); @@ -8167,7 +8173,7 @@ export function registerProjectSupervisorSurfaceTests() { within(supervisorSurface).queryByLabelText('陶泥儿实时回复'), ).toBeNull(); expect( - within(directMessageList).queryByTestId('turn-process'), + within(directMessageList).queryByTestId('agent-tool-call-group'), ).toBeNull(); expect( ( diff --git a/apps/ai-game-creator-shell/tests/appSurface/tool-call-group.suite.ts b/apps/ai-game-creator-shell/tests/appSurface/tool-call-group.suite.ts index de4d266cc..1ffd98dc2 100644 --- a/apps/ai-game-creator-shell/tests/appSurface/tool-call-group.suite.ts +++ b/apps/ai-game-creator-shell/tests/appSurface/tool-call-group.suite.ts @@ -209,7 +209,7 @@ export function registerToolCallGroupTests() { `#${fileHead.getAttribute('aria-controls')}`, ); expect( - within(fileDetail as HTMLElement).getByText('game/src/hero.ts'), + within(fileDetail as HTMLElement).getAllByText('game/src/hero.ts')[0], ).not.toBeNull(); expect(within(fileDetail as HTMLElement).getByText('新增')).not.toBeNull();