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(