From 0a7f4a5008d899847decc57d03e3168f03502cbb Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 14 Sep 2026 09:30:59 +0900 Subject: [PATCH] =?UTF-8?q?test(b05):=20=ED=8F=BC=20=EC=86=8C=EC=8A=A4=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=EC=9D=84=20=EC=83=88=20=EA=B7=9C=EC=B9=99?= =?UTF-8?q?=EC=97=90=20=EB=A7=9E=EC=B6=A4=20=E2=80=94=20=EA=B3=A0=EB=A5=B4?= =?UTF-8?q?=EA=B8=B0=20=EC=B9=B8=EC=9D=80=20=EB=8A=98=20=EB=B9=88=20?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=C2=B7=20=EA=B8=B0=EB=B3=B8=EA=B0=92?= =?UTF-8?q?=EC=9D=80=20=EC=A0=9C=EC=95=88=EC=9C=BC=EB=A1=9C=EB=A7=8C(?= =?UTF-8?q?=ED=8F=BC=20=E2=91=A0=E2=91=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 옛 「기본값 있는 칸은 첫 보기」(2026-08-17)를 확인하던 줄을 브레인 판정(2026-09-14)대로 뒤집음 - 칸 만들기가 `_Structures_Fields.optionControl` 로 옮겨간 자리를 봄 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq --- .../tester/test_b05_empty_means_select.py | 25 +++++++++++-------- resources/tester/test_b06_detail_options.py | 9 ++++--- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/resources/tester/test_b05_empty_means_select.py b/resources/tester/test_b05_empty_means_select.py index 54a0a7e6..99e781a7 100644 --- a/resources/tester/test_b05_empty_means_select.py +++ b/resources/tester/test_b05_empty_means_select.py @@ -24,6 +24,9 @@ if str(ROOT) not in sys.path: from B08_Quantity.B08_Quantity_Engine_UnitQuantity import build_table # noqa: E402 PANEL = (ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Panel.ts").read_text(encoding="utf-8") +#: 2026-09-14 칸 만들기가 `_Structures_Fields.optionControl` 로 옮겨감(브레인 판정 ①② — 고르기 칸은 +#: 늘 빈 보기 · 기본값은 제안으로만). +FIELDS = (ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Fields.ts").read_text(encoding="utf-8") API = (ROOT / "B05_Profile" / "B05_Profile_Api_Structures.ts").read_text(encoding="utf-8") COMMIT = (ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Panel_Commit.ts").read_text( encoding="utf-8" @@ -39,22 +42,24 @@ def _registry_options(type_id: str) -> dict[str, dict]: def test_폼이_empty_means_를_보고_빈_보기를_둔다() -> None: - """소스 검사 — 빈 보기와 초기값이 **같은 판정**(`keepEmpty`)을 쓴다.""" - assert "option.empty_means" in PANEL - assert "const keepEmpty = mustPick || meansEmpty;" in PANEL - assert 'if (keepEmpty) choices.unshift(["", mustPick ? "— 선택 —" : "— 안 정함 —"]);' in PANEL - # 빈 보기만 넣고 초기값을 첫 보기로 두면 화면은 「안 정함」인데 값은 첫 보기가 된다. - assert 'String(preset || (keepEmpty ? "" : (option.choices[0] ?? "")))' in PANEL + """소스 검사 — 고르기 칸은 **늘** 빈 보기를 두고, 초기값은 저장된 값뿐(첫 보기를 안 박음).""" + assert "optionControl(option, values[option.key])" in PANEL + assert 'select([["", blank], ...option.choices' in FIELDS + # 초기값은 저장된 값만 — 첫 보기·기본값으로 채우지 않음. + assert "element.value = value;" in FIELDS + assert "option.choices[0]" not in PANEL # 클라이언트 옵션 타입에 칸이 있어야 서버 응답의 `empty_means` 가 살아 온다. assert "empty_means?: string | null;" in API # 빈 칸은 아예 안 실린다 — 이 규칙이 있어야 「안 정함」이 정본에 안 박힌다. assert "if (input.isEmpty()) return;" in COMMIT -def test_기본값_있는_칸은_빈_보기를_안_둔다() -> None: - """`empty_means` 가 적혀 있어도 **기본값이 있으면** 그 값이 뜬다(2026-08-17 지시 유지).""" +def test_기본값_있는_칸도_빈_보기에_제안으로만_보인다() -> None: + """⭐ 2026-09-14 브레인 판정으로 뒤집힘 — 기본값이 **있어도** 칸에 채우지 않고 빈 보기 이름에 + 「제안 …」으로만 보임(옛 2026-08-17 「첫 보기가 곧 기본값」 걷음). 저장 한 번에 기본값이 + 확정으로 굳던 뿌리였음.""" options = _registry_options("masonry_wet") - # 버림 콘크리트 — empty_means 가 있으나 기본이 「넣음」이다. + # 버림 콘크리트 — empty_means 가 있고 기본이 「넣음」. assert options["blinding_concrete"]["empty_means"] assert options["blinding_concrete"]["default"] == "넣음" # 채움 강도·야면석 계수 — 기본이 없어 빈 보기가 서야 하는 칸. @@ -62,7 +67,7 @@ def test_기본값_있는_칸은_빈_보기를_안_둔다() -> None: assert options[key]["empty_means"], key assert options[key]["default"] is None, key assert options[key]["required"] is False, key - assert '(option.default ?? "") === ""' in PANEL # 기본값 있으면 빈 보기를 안 둠 + assert "`— 안 정함 (제안 ${suggested}) —`" in FIELDS def _wall(**options) -> dict: diff --git a/resources/tester/test_b06_detail_options.py b/resources/tester/test_b06_detail_options.py index 29fb04a1..9de4c45f 100644 --- a/resources/tester/test_b06_detail_options.py +++ b/resources/tester/test_b06_detail_options.py @@ -39,10 +39,13 @@ def test_B05_는_종전대로_유무_종류_위치만(): def test_기본값_없는_필수_항목은_빈_칸으로_연다(): """첫 항목을 슬쩍 고르면 **근거 없는 값**(뒷길이 25㎝ 같은)이 수량·단가로 흘러간다.""" panel = _PANEL.read_text(encoding="utf-8") - # 2026-09-13 — 빈 보기를 두는 까닭이 둘이 되어(필수 + `empty_means`) 한 줄로 합쳐졌다. + fields = (PROJECT_ROOT / "B05_Profile" / "B05_Profile_UI_Structures_Fields.ts").read_text( + encoding="utf-8" + ) + # 2026-09-14 — 칸 만들기가 `optionControl` 로 옮겨감 · 고르기 칸은 **늘** 빈 보기(브레인 판정 ①). # 필수 칸의 글자는 그대로 「— 선택 —」이다. - assert 'choices.unshift(["", mustPick ? "— 선택 —" : "— 안 정함 —"])' in panel - assert 'option.required === true && (option.default ?? "") === ""' in panel + assert "optionControl(option, values[option.key])" in panel + assert '? "— 선택 —"' in fields and 'select([["", blank]' in fields def test_큰돌쌓기에_메_찰_구분이_있다():