feat: add project-aware agent workspace
Generic Container CI/CD / test-build-publish (push) Successful in 2m9s
Frontend CI/CD / build-test-publish-and-deploy (push) Successful in 2m39s

This commit is contained in:
2026-10-22 18:52:18 +08:00
parent c6a0e74e72
commit 2d8506fea0
191 changed files with 12373 additions and 3556 deletions
@@ -1,5 +1,8 @@
import { renderHook } from "@testing-library/react";
import type { Map as MapLibreMap } from "maplibre-gl";
import { describe, expect, it, vi } from "vitest";
import {
useMapInteractions,
clearMapFeatureInteractionState,
isPointOccludedByCityBuilding,
setMapFeatureInteractionState,
@@ -71,3 +74,17 @@ describe("map feature interaction state", () => {
expect(queryRenderedFeatures).not.toHaveBeenCalled();
});
});
it("suspends feature picking while the map is used to look up a place", () => {
const canvas = document.createElement("canvas");
const map = { on: vi.fn(), off: vi.fn(), getLayer: vi.fn(() => ({})), getCanvas: () => canvas };
const props = { enabled: false, mapRef: { current: map as unknown as MapLibreMap },
availableSourceIds: ["pipes"] as const, mapReady: true, onSelectFeature: vi.fn(), selectedFeature: null };
const { rerender } = renderHook(useMapInteractions, { initialProps: props });
expect(map.on).not.toHaveBeenCalled();
rerender({ ...props, enabled: true });
expect(map.on).toHaveBeenCalledWith("click", expect.any(Array), expect.any(Function));
rerender(props);
expect(map.off).toHaveBeenCalledWith("click", expect.any(Array), expect.any(Function));
});