GIS 편집 신규 관로 미리보기 표시 보완
This commit is contained in:
@@ -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\)/,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user