Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
// @vitest-environment jsdom
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("react-router", () => ({
|
||||
useNavigation: () => ({ state: "loading", location: { pathname: "/acme/projects" } }),
|
||||
}));
|
||||
|
||||
vi.mock("spin-delay", () => ({ useSpinDelay: () => true }));
|
||||
vi.mock("@headlessui/react", () => ({ Transition: ({ children }: { children: React.ReactNode }) => children }));
|
||||
vi.mock("react-i18next", () => ({ useTranslation: () => ({ t: (key: string) => key }) }));
|
||||
vi.mock("~/ui/components/Loader", () => ({ Loader: () => <span data-testid="loader" /> }));
|
||||
|
||||
import FloatingLoader from "./FloatingLoader";
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe("FloatingLoader", () => {
|
||||
it("renders navigation progress without starting an unused update timer", () => {
|
||||
const setIntervalSpy = vi.spyOn(globalThis, "setInterval");
|
||||
|
||||
render(<FloatingLoader />);
|
||||
|
||||
expect(screen.getByTestId("loader")).toBeTruthy();
|
||||
expect(document.body.textContent).toContain("/acme/projects");
|
||||
expect(setIntervalSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user