дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 01:57:13 +02:00
test(vcs): close the blame popup inside act in teardown (#8300)
closeBlamePopup renders null into the popup's React root; called outside act in afterEach, React sometimes ran that work after the test environment was torn down, failing the Frontend job with an unhandled window-is-not-defined error. Both blame test files now close it inside act.
Цей коміт міститься в:
1 джерело
ca6efe197c
коміт
7abf1d2ac7
2 files changed
+5
-2
No files matched your search
@@ -94,7 +94,8 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
closeBlamePopup();
|
||||
// Inside act: the popup's root renders the close now, not after the test environment is gone.
|
||||
act(() => closeBlamePopup());
|
||||
view?.destroy();
|
||||
view = undefined;
|
||||
vi.useRealTimers();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
// change) is crates/ide-svn/tests/ij_history.rs.
|
||||
import { EditorState } from "@codemirror/state";
|
||||
import { EditorView } from "@codemirror/view";
|
||||
import { act } from "@testing-library/react";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { BlameLine } from "@/bindings";
|
||||
import { useI18n } from "@/platform/i18n";
|
||||
@@ -78,7 +79,8 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
closeBlamePopup();
|
||||
// Inside act: the popup's root renders the close now, not after the test environment is gone.
|
||||
act(() => closeBlamePopup());
|
||||
view?.destroy();
|
||||
view = undefined;
|
||||
vi.useRealTimers();
|
||||
|
||||
Reference in new issue
Заблокувати користувача