- 값 바꿀 때 고름 길(pickAt)을 click · 키보드 초점에도 씀 — 칸 제 동작 뒤 setTimeout - 고름이 폼을 다시 그려 초점 칸이 사라지면 같은 이름 새 칸에 초점 되살림 - 시험 test_191_1_box_press_pick + 흉내 DOM 헬퍼 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3mdb91125mPoC6tpsQx4P
60 lines
1.9 KiB
Python
60 lines
1.9 KiB
Python
"""191-1 B06 좌측 세부 컨테이너 누름 · 초점 = 그 구조물 형상 고름(값 바꿀 때와 같은 길).
|
|
|
|
화면 TS 를 흉내 DOM 에서 돌린 값(`helper_191_1_box_press_pick.cjs`).
|
|
"""
|
|
|
|
import json
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
HELPER = Path(__file__).parent / "helper_191_1_box_press_pick.cjs"
|
|
NODE_MODULES = ROOT / "config" / "node_modules"
|
|
|
|
pytestmark = pytest.mark.skipif(not NODE_MODULES.is_dir(), reason="프론트엔드 의존성 미설치")
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out() -> dict:
|
|
done = subprocess.run( # noqa: S603 — 고정 실행 파일
|
|
["node", str(HELPER)], cwd=str(ROOT), capture_output=True, text=True, encoding="utf-8"
|
|
)
|
|
assert done.returncode == 0, done.stderr
|
|
return json.loads(done.stdout)
|
|
|
|
|
|
def test_빈곳_누름_값바꿈과_같은_결과(out: dict) -> None:
|
|
assert out["change"]["highlight"] == "inlet"
|
|
assert out["pressBox"] == out["change"] # 고름 · 카드 · 넘김(스크롤) 차례까지 같음
|
|
|
|
|
|
def test_제목_누름_고름(out: dict) -> None:
|
|
assert out["pressLegend"]["highlight"] == "inlet"
|
|
assert ["select", 120, "inlet"] in out["pressLegend"]["log"]
|
|
|
|
|
|
def test_입력칸_누름_고름_초점_되살림(out: dict) -> None:
|
|
assert out["pressInput"] == {
|
|
"highlight": "pipe",
|
|
"repainted": True,
|
|
"oldConnected": False,
|
|
"focusSame": True,
|
|
}
|
|
|
|
|
|
def test_키보드_초점_고름_다른상자_바뀜(out: dict) -> None:
|
|
assert out["tab"] == {"highlight": "extra1", "focusSame": True}
|
|
assert out["switched"] == "extra0"
|
|
assert out["switched2"] == "outlet"
|
|
|
|
|
|
def test_누름_초점은_click_뒤(out: dict) -> None:
|
|
assert out["focusBeforeClick"] == {"highlight": None, "connected": True}
|
|
|
|
|
|
def test_단수칸_안고름_거듭누름_한번(out: dict) -> None:
|
|
assert out["tiers"] is None
|
|
assert out["twice"] == 2
|