修复试玩快捷键测试监听器清理
使用 try/finally 确保错误报告事件监听器始终移除
This commit is contained in:
+3
@@ -653,12 +653,15 @@ export async function assertPlaytestAndReleaseShortcutFlow(
|
||||
openedErrorReport = true;
|
||||
};
|
||||
window.addEventListener(OPEN_ERROR_REPORT_EVENT, onErrorReportOpen);
|
||||
try {
|
||||
submitChat('/bug-report');
|
||||
expect(
|
||||
await screen.findByText('已打开“报告问题”面板,请填写遇到的问题。'),
|
||||
).not.toBeNull();
|
||||
expect(openedErrorReport).toBe(true);
|
||||
} finally {
|
||||
window.removeEventListener(OPEN_ERROR_REPORT_EVENT, onErrorReportOpen);
|
||||
}
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
|
||||
Reference in New Issue
Block a user