GIS 편집 신규 관로 미리보기 표시 보완

This commit is contained in:
kiminchan
2026-09-16 17:32:02 +09:00
parent 4d685d5a67
commit a8f2c8f41a
6 changed files with 210 additions and 4 deletions
@@ -572,3 +572,53 @@ test("불필요한 HTML 실행 파일은 없고 의도적 공개 barrel은 유
.includes("AuthorityButton"),
);
});
test("통수위험 영역 초기화는 GIS 편집 preview를 제거하지 않음", () => {
const pageSource = fs.readFileSync(
path.resolve(__dirname, "../app/(map-layout)/map/page.tsx"),
"utf8",
);
const areaLayerStart = pageSource.indexOf(
"const ensureWaterRiskAreaLayer = useCallback",
);
const pipeLayerStart = pageSource.indexOf(
"const ensureWaterRiskPipeLayer = useCallback",
areaLayerStart,
);
assert.ok(areaLayerStart >= 0 && pipeLayerStart > areaLayerStart);
const areaLayerBlock = pageSource.slice(areaLayerStart, pipeLayerStart);
assert.match(areaLayerBlock, /WATER_RISK_AREA_LAYER_ID/);
assert.doesNotMatch(areaLayerBlock, /GIS_EDIT_PREVIEW_LAYER_ID/);
assert.match(
areaLayerBlock,
/map\.addLayer\(waterRiskAreaLayerRef\.current\)/,
);
});
test("신규 관로 preview는 재표시되고 상세 패널 밖으로 최초 1회 focus", () => {
const pageSource = fs.readFileSync(
path.resolve(__dirname, "../app/(map-layout)/map/page.tsx"),
"utf8",
);
const previewLayerStart = pageSource.indexOf(
"const ensureGisEditPreviewLayer = useCallback",
);
const previewLayerEnd = pageSource.indexOf(
"const clearGisEditPreviewLayer = useCallback",
previewLayerStart,
);
const previewLayerBlock = pageSource.slice(
previewLayerStart,
previewLayerEnd,
);
assert.match(previewLayerBlock, /setVisible\?\.\(true\)/);
assert.match(
pageSource,
/gisEditAutoFocusedAddChangeIdRef\.current === focusedChange\.changeId/,
);
assert.match(
pageSource,
/focusGisEditChangeOnMap\(focusedChange\.changeId\)/,
);
});