修复项目切换 manifest 测试竞态

等待 manifest 失效监听注册后再发送失效事件

避免 CI 中测试事件丢失导致超时
This commit is contained in:
2026-08-07 02:55:26 +00:00
parent c3b3b47c9a
commit 9d1f4c1975
@@ -461,6 +461,12 @@ export function registerClientHomeTests() {
});
fireEvent.click(screen.getByRole('button', { name: '打开' }));
await screen.findByLabelText('项目开发工作台');
await waitFor(() => {
expect(runtimeHarness.listen).toHaveBeenCalledWith(
'game-creator-manifest-invalidated',
expect.any(Function),
);
});
holdFirstRefresh = true;
act(() => {
runtimeHarness.emitManifestInvalidated('code-prototype');