修复游戏创作清单事件测试时序
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 3m27s
Project CI / Native shell tests (pull_request) Successful in 15m41s

先等待 manifest 失效事件监听完成后再记录调用基线。
避免把打开项目后的最近项目复检误判为 Runtime 事件重新打开。
This commit is contained in:
2026-08-08 16:16:56 +08:00
parent fac9cf0f50
commit 68e879907a
@@ -296,6 +296,12 @@ export function registerClientHomeTests() {
expect(
screen.queryByRole('button', { name: /runtime-live-hero\.png/ }),
).toBeNull();
await waitFor(() => {
expect(runtimeHarness.listen).toHaveBeenCalledWith(
'game-creator-manifest-invalidated',
expect.any(Function),
);
});
const manifestReadsBeforeEvent = invoke.mock.calls.filter(
([command]) => command === 'get_local_game_manifest',
).length;
@@ -303,12 +309,6 @@ export function registerClientHomeTests() {
([command]) => command === 'inspect_local_project_directory',
).length;
await waitFor(() => {
expect(runtimeHarness.listen).toHaveBeenCalledWith(
'game-creator-manifest-invalidated',
expect.any(Function),
);
});
manifestChanged = true;
act(() => {
runtimeHarness.emitManifestInvalidated('art-asset-plan');