/* ! * (c) Copyright 2026 Palantir Technologies Inc. All rights reserved. */ import type * as FloatingUIReact from "@floating-ui/react"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { afterEach, describe, expect, it, vi } from "vitest"; import { Button } from "../../components"; import { PopoverNext } from "./popoverNext"; // vi.hoisted runs before vi.mock, so the spy is available in the factory const { autoUpdateSpy } = vi.hoisted(() => ({ autoUpdateSpy: vi.fn(() => () => { /* cleanup noop */ }), })); vi.mock("@floating-ui/react", async importOriginal => { const actual = await importOriginal(); return { ...actual, autoUpdate: autoUpdateSpy, }; }); describe(" autoUpdateOptions", () => { afterEach(() => { autoUpdateSpy.mockClear(); }); it("calls autoUpdate without options by default", async () => { const user = userEvent.setup(); render(