fix(hosts): expose controls for overflowing editor tabs (#1537)

* fix(hosts): expose controls for overflowing editor tabs

* test(hosts): mock resize observation in admin panel tests
This commit is contained in:
ZacharyZcR authored and GitHub committed 2026-10-03 21:00:55 +08:00
1 parent 021670ca1d
commit bd0858b5a2
4 files changed
+162 -9

No files matched your search

@@ -1,5 +1,5 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
import { cleanup, render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { AdminUserManagePanel } from "../../sidebar/AdminUserManagePanel";
@@ -71,7 +71,20 @@ function renderPanel(
);
}
afterEach(() => {
cleanup();
vi.unstubAllGlobals();
});
beforeEach(() => {
vi.stubGlobal(
"ResizeObserver",
class {
observe() {}
unobserve() {}
disconnect() {}
},
);
for (const fn of Object.values(api)) fn.mockClear();
});