fix: hide unavailable GeoServer layers

This commit is contained in:
2026-09-11 16:40:24 +08:00
parent f9c71cc076
commit cf699d6207
15 changed files with 683 additions and 60 deletions
@@ -34,6 +34,25 @@ describe("workbench supply layer controls", () => {
]);
});
it("omits data-dependent controls when their GeoServer layers are empty", () => {
const items = createLayerControlItems(INITIAL_LAYER_VISIBILITY, [
"pipes",
"junctions",
"valves",
"reservoirs",
"scada"
]);
expect(items.map((item) => item.id)).toEqual([
"pipes",
"junctions",
"valves",
"reservoirs",
"scada",
"simulation"
]);
});
it("shows only current visible business icons in the legend", () => {
expect(MAP_LEGEND_ITEMS.map((item) => item.id)).toEqual([
"major-pipe",