fix(b06): 구조물 종류를 여러 번 바꾸면 앞 종류 제원이 남아 겹치던 것 — 미리 뜬 횡단은 다시 쓰므로 얹기 전에 관 계열 제원을 비움 (317-3 · 요구 214)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C6BNBFXFndbqYxu6sZuknK
This commit is contained in:
@@ -124,6 +124,11 @@ function decorate(
|
||||
const own = pipes.filter((pipe) =>
|
||||
fresh.some((section) => near(section.chainage_m, pipe.chainage_m)),
|
||||
);
|
||||
// 미리 뜬 횡단은 한 벌을 기억해 다시 씀 — 얹기 전에 관 계열 제원을 비움(앞 종류 제원이 남아
|
||||
// 겹치던 것 · 서버가 얹어 온 저장분 종류도 · 열쇠 = `Section_Store` FACILITY_KEYS 와 같음 · 317-3)
|
||||
for (const section of fresh as unknown as Array<Record<string, unknown>>) {
|
||||
for (const key of ["culvert", "ford", "box", "ford_pavement"]) delete section[key];
|
||||
}
|
||||
attachCulvertSets(
|
||||
fresh as unknown as Array<Record<string, unknown>>,
|
||||
buildCulvertSets(own, registry),
|
||||
|
||||
@@ -71,6 +71,17 @@ const snap = () => ({
|
||||
state.draftPipes = [{ chainage_m: 50, facility: "ford_pavement" }];
|
||||
await withDraftStations(detail, "p1", 1);
|
||||
out.back_to_saved = snap();
|
||||
// 여러 번 바꿈 — 앞 종류 제원이 남아 겹치지 않음(317-3 · 미리 뜬 횡단은 한 벌을 다시 씀)
|
||||
const facilityKeys = () =>
|
||||
Object.keys(at50() ?? {})
|
||||
.filter((key) => ["culvert", "ford", "box", "ford_pavement"].includes(key))
|
||||
.sort();
|
||||
state.draftPipes = [{ chainage_m: 50, facility: "box_culvert" }];
|
||||
await withDraftStations(detail, "p1", 1);
|
||||
out.first_switch = facilityKeys();
|
||||
state.draftPipes = [{ chainage_m: 50, facility: "ford_bridge" }];
|
||||
await withDraftStations(detail, "p1", 1);
|
||||
out.second_switch = facilityKeys();
|
||||
forgetDraftStations("p1");
|
||||
process.stdout.write(JSON.stringify(out));
|
||||
})().catch((error) => {
|
||||
|
||||
@@ -47,3 +47,9 @@ def test_changed_kind_starts_from_fresh_section(result: dict) -> None:
|
||||
|
||||
def test_back_to_saved_kind_restores_saved_section(result: dict) -> None:
|
||||
assert result["back_to_saved"] == {"count": 2, "fresh": False, "old": True, "preview": False}
|
||||
|
||||
|
||||
def test_repeated_switch_leaves_no_old_kind(result: dict) -> None:
|
||||
# 박스 → 세월교 — 앞 종류(박스) 제원이 남아 겹치지 않음(317-3)
|
||||
assert result["first_switch"] == ["box"]
|
||||
assert result["second_switch"] == ["ford"]
|
||||
|
||||
Reference in New Issue
Block a user