import { expect, it, vi } from "vitest"; import { render, screen } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; import { StatsOverview } from "../../../src/features/stats/StatsOverview"; import { SectionInfo } from "../../../src/features/stats/SectionInfo"; vi.mock("../../../src/features/stats/ScopesTab", async () => { const { SectionInfo } = await import("../../../src/features/stats/SectionInfo"); return { ScopesTab: () =>
}; }); it("shows a section's info beside the section chooser", () => { render(); const tip = screen.getByRole("button", { name: /About scopes/ }); expect(tip.closest("[data-section-info]")).toBeInTheDocument(); expect(screen.getByRole("main")).not.toContainElement(tip); }); it("keeps the info in place outside the analytics bar", () => { render(
); expect(screen.getByRole("main")).toContainElement(screen.getByRole("button", { name: /Standalone/ })); });