修复游戏创作清单事件测试时序
先等待 manifest 失效事件监听完成后再记录调用基线。 避免把打开项目后的最近项目复检误判为 Runtime 事件重新打开。
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user