test(ui): unmount MCP help dialog fixtures

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-08-21 01:55:23 +00:00
1 parent 3a7a378011
commit 2456d98963
1 file changed
+5 -1
@@ -64,21 +64,25 @@ function promptTextarea(): HTMLTextAreaElement | undefined {
*/
describe("Paste a config — MCP config help", () => {
let container: HTMLDivElement;
let root: ReturnType<typeof createRoot> | null;
beforeEach(() => {
container = document.createElement("div");
document.body.appendChild(container);
root = null;
copyTextToClipboardMock.mockResolvedValue(undefined);
});
afterEach(() => {
flushSync(() => root?.unmount());
root = null;
document.body.removeChild(container);
document.body.innerHTML = "";
vi.clearAllMocks();
});
async function render() {
const root = createRoot(container);
root = createRoot(container);
const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } });
await act(async () => {
root.render(