From fc24af56b4c4cf59be6adb58f7c5badb19c339a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 8 Aug 2026 12:19:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=B3=E5=AE=9AAI=E6=B8=B8=E6=88=8F=E5=88=9B?= =?UTF-8?q?=E4=BD=9C=E7=95=8C=E9=9D=A2=E5=BC=82=E6=AD=A5=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 等待运行活动投影完成后再断言详情 放宽高负载下预览授权状态的有界等待 保持产品运行与预览行为不变 --- .../appSurface/project-development.suite.ts | 51 +++++++++++-------- 1 file changed, 31 insertions(+), 20 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 7919a671d..628a40d29 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 @@ -6858,23 +6858,29 @@ export function registerProjectSupervisorSurfaceTests() { await driver.submit('生成同 revision 首次验证'); await driver.emitValidation(1, 1000); - await waitFor(() => { - expect( - driver.invoke.mock.calls.filter( - ([command]) => command === 'start_local_game_preview', - ), - ).toHaveLength(1); - expect(driver.readAuthorization()).toBeNull(); - }); + await waitFor( + () => { + expect( + driver.invoke.mock.calls.filter( + ([command]) => command === 'start_local_game_preview', + ), + ).toHaveLength(1); + expect(driver.readAuthorization()).toBeNull(); + }, + { timeout: 3000 }, + ); await driver.submit('同一 Run 新授权后重新验证同一 revision'); - await waitFor(() => { - expect(driver.readAuthorization()).toMatchObject({ - afterRevision: 1, - afterValidatedAt: 1000, - authorizationId: expect.any(String), - }); - }); + await waitFor( + () => { + expect(driver.readAuthorization()).toMatchObject({ + afterRevision: 1, + afterValidatedAt: 1000, + authorizationId: expect.any(String), + }); + }, + { timeout: 3000 }, + ); await driver.emitValidation(1, 2000); expect( await screen.findByLabelText('游戏运行', {}, { timeout: 3000 }), @@ -7149,11 +7155,16 @@ export function registerProjectSupervisorSurfaceTests() { }); expect(screen.queryByText('等待新的运行事件')).toBeNull(); fireEvent.click(screen.getByRole('button', { name: '运行详情' })); - expect( - within(screen.getByLabelText('最近运行活动')).getByText( - /新受理 Run 正在执行/, - ), - ).not.toBeNull(); + await waitFor( + () => { + expect( + within(screen.getByLabelText('最近运行活动')).getByText( + /新受理 Run 正在执行/, + ), + ).not.toBeNull(); + }, + { timeout: 2500 }, + ); harness.setProjectRevision(4); await act(async () => { harness.emitAgentRuntime(