fix(site-finder): 5 дефектов из фидбека analyze (#1736-1740) #1748

Merged
lekss361 merged 6 commits from fix/sf-feedback-batch into main 2026-06-18 07:06:47 +00:00
Showing only changes of commit 0f9babb7ff - Show all commits

View file

@ -1,3 +1,4 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { render, screen, waitFor } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
@ -39,9 +40,23 @@ const FIXTURE: ParcelAnalyzeResponse = {
nspd_red_lines: [],
};
// MiniMap calls useConnectionPoints (useQuery) since #1736 — needs a QueryClient
// in context. retry:false so the (unmocked) query fails fast into idle/error
// state without affecting these layout-only assertions.
function renderMiniMap() {
const client = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
return render(
<QueryClientProvider client={client}>
<MiniMap data={FIXTURE} />
</QueryClientProvider>,
);
}
describe("MiniMap (#1218)", () => {
it("passes mapHeight=280 to SiteMap (compact tile, controls flow below)", async () => {
render(<MiniMap data={FIXTURE} />);
renderMiniMap();
// SiteMap is dynamically imported (ssr:false) — wait until our stub renders.
await waitFor(() =>
expect(screen.getByTestId("sitemap-stub")).toBeInTheDocument(),
@ -50,7 +65,7 @@ describe("MiniMap (#1218)", () => {
});
it("wrapper does NOT clip overflow — layer controls must remain visible", async () => {
const { container } = render(<MiniMap data={FIXTURE} />);
const { container } = renderMiniMap();
await waitFor(() =>
expect(screen.getByTestId("sitemap-stub")).toBeInTheDocument(),
);