- 흐림 판 [업데이트] 아래 관 표지가 있으면 setPointerCapture 로 단추가 click 못 받던 것 - 시험 test_369_3_update_press(가짜 표지 + pointer 사건 차례) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""369-3 배수유역 흐림 판 [업데이트] 진짜 누름 — 아래 관 표지가 있어도 단추가 click 을 받음.
|
|
|
|
- 단추 위 pointerdown = viewport 집기 · 사로잡기 · 유역 고르기 안 함 → click = 계산 시작 1회.
|
|
- 지도(캔버스) 위 좌클릭 = 관 표지 집기 그대로 · 가운데 버튼 = 팬 그대로.
|
|
Node 헬퍼(`helper_369_3_update_press.cjs`)가 Interact.ts 를 그 자리에서 돌린다.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
|
|
import pytest
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def r():
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_369_3_update_press.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=60,
|
|
encoding="utf-8",
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def test_단추_누름은_계산_시작_한_번(r):
|
|
assert r["button"] == {
|
|
"live": 1,
|
|
"grabs": 0,
|
|
"picks": 0,
|
|
"captured": None,
|
|
"offset": {"x": 0, "y": 0},
|
|
}
|
|
|
|
|
|
def test_지도_누름은_관_표지_집기_가운데는_팬(r):
|
|
assert r["map"] == {"live": 0, "grabs": 1, "picks": 0, "captured": 1}
|
|
assert r["pan"] == {"captured": 2, "offset": {"x": 30, "y": 40}}
|