test(editor): reduce flaky in turbo renderer test (#11973)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Improved test resource cleanup for the viewport turbo renderer, ensuring proper teardown after each test for more reliable and isolated test execution. - Enhanced stability by preventing errors during cleanup when certain elements or editors are absent. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -129,13 +129,13 @@ export async function setupEditor(
|
||||
const appElement = await createEditor(collection, mode, extensions);
|
||||
|
||||
return () => {
|
||||
appElement.remove();
|
||||
appElement?.remove();
|
||||
cleanup();
|
||||
};
|
||||
}
|
||||
|
||||
export function cleanup() {
|
||||
window.editor.remove();
|
||||
window.editor?.remove();
|
||||
|
||||
delete (window as any).collection;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user