- 고르기: 누름 = 더함 · Shift = 뺌 · Ctrl = 넣고 빼기 · 상자 = 앞 고름 ∪ 상자 · Shift 상자 = 뺌(H4 · H5) · 명령 안 고르기 단계도 누를 때 첫 점 · 스침 강조(ic/selecting.ts) - 그립: 쉴 때만 집음(N7) · 누르고 떼면 대기 → 다음 누름에 놓음 · 끌어 놓기(H3) · 거리 숫자(N8) · 확정 · 읽기 전용 도면은 그립 · Delete 막음(H2) - 직교: F8 = 기준점에서 가로 · 세로 강제 · Shift 누른 동안 뒤집음 · 객체 스냅 점 · 좌표 · 각도 잠금은 안 덮음 · 클릭 사건 snapped 채움(ic/ortho.ts · H8) · 가이드는 F3 와 뗌 · 가이드 잡는 거리 = 화면 픽셀(H9) - 휠: 기본 밂(앞으로 굴리면 확대 · 오토캐드 · 모든 화면 · ☰ 설정 뒤집기 그대로) · 가운데 단추 두 번 = 범위 줌 · ZOOM · ⛶ 앞 화면 기억(ic/zoom-prompt.ts) - 시험: mouse-acad 새로 · 휠 방향 시험 손질(input-wheel · input-prefs-cad · input_prefs · app_settings · 164 · 220_1 · 221_1 · 244_8 기대값 뒤집음 · 266 pull 박음) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Se7ytqbohmBQnfYpwYFnYf
77 lines
2.9 KiB
Python
77 lines
2.9 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""돋보기 휠 배율(계획서 220-1) 회귀검증 — 지름 360 · 켜진 동안 휠 = 배율 ± 0.25(1.5 ~ 6) ·
|
||
그동안 휠 기본 동작(스크롤 · 그래프 줌) 막음 · 꺼지면 그대로 · 다음 켤 때 2배 · 원 아래 배율 글.
|
||
|
||
218-1 헬퍼(`helper_218_1_loupe.cjs`)의 휠 · 배율 글 장면을 판정함.
|
||
"""
|
||
|
||
import json
|
||
import os
|
||
import subprocess
|
||
|
||
import pytest
|
||
|
||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||
ROOT = os.path.dirname(os.path.dirname(HERE))
|
||
|
||
|
||
@pytest.fixture(scope="module")
|
||
def r():
|
||
proc = subprocess.run(
|
||
["node", os.path.join(HERE, "helper_218_1_loupe.cjs")],
|
||
capture_output=True,
|
||
text=True,
|
||
encoding="utf-8",
|
||
timeout=60,
|
||
)
|
||
assert proc.returncode == 0, proc.stderr
|
||
return json.loads(proc.stdout)
|
||
|
||
|
||
def test_지름_360_배율_한도(r):
|
||
c = r["consts"]
|
||
assert c["d"] == 360 and r["capture"]["rootSize"] == ["360px", "360px"]
|
||
assert (c["zoom"], c["zoomMin"], c["zoomMax"], c["zoomStep"]) == (2, 1.5, 6, 0.25)
|
||
|
||
|
||
def test_휠_밂_크게_당김_작게_한도(r): # 337 기본 = 밂 확대
|
||
w = r["wheel"]
|
||
assert w["up"]["zoom"] == 2.25 # 밀어 한 칸
|
||
assert w["down"] == 1.75 # 당겨 두 칸
|
||
assert w["flat"] == 1.75 # 가로 굴림은 그대로
|
||
assert w["max"] == 6 and w["min"] == 1.5
|
||
assert w["pure"] == [2.25, 1.75, 6, 1.5]
|
||
|
||
|
||
def test_켜진_동안_휠_기본_동작_막음(r):
|
||
w = r["wheel"]
|
||
assert w["up"]["prevented"] and w["up"]["stopped"] # 스크롤 · 그래프 휠 줌 안 받음
|
||
assert w["press"] == {"prevented": True, "zoom": ["zoom", 2.25]} # 우클릭 길게 누름도
|
||
assert ["wheel", {"capture": True, "passive": False}] in r["listeners"]
|
||
|
||
|
||
def test_꺼지면_스크롤_그대로(r):
|
||
w = r["wheel"]
|
||
assert w["off"] == {"prevented": False, "stopped": False, "log": 0}
|
||
assert w["afterOff"] == {"prevented": False, "stopped": False, "zoomed": False}
|
||
|
||
|
||
def test_다음_켤_때_2배(r):
|
||
assert r["wheel"]["reopen"] == 2.25 # 1.5 에서 껐다 켜면 2배에서 한 칸
|
||
h = r["hide"]
|
||
assert h["reopenLabel"] == ["×2", False, "translate(-820px, -620px) scale(2)"]
|
||
|
||
|
||
def test_배율_글_원_아래(r):
|
||
lb = r["label"]
|
||
assert lb["cls"] == "ui-loupe__zoom" and lb["ariaHidden"] == "true" and not lb["hidden"]
|
||
assert lb["text"] == "×2"
|
||
# 원(320,220 · 지름 360) 아래 가운데 — 원 끝 580 + 4
|
||
assert lb["at"] == "translate(500px, 584px) translateX(-50%)"
|
||
assert lb["zoom3"] == ["×3", "translate(-1320px, -1020px) scale(3)", "translate(320px, 220px)"]
|
||
assert lb["bottom"] == "translate(500px, 778px) translateX(-50%)" # 화면 아래 끝에서 안 잘림
|
||
assert r["hide"]["labelHidden"]
|
||
with open(os.path.join(ROOT, "ui_template", "ui_template_loupe.css"), encoding="utf-8") as f:
|
||
css = f.read()
|
||
assert ".ui-loupe__zoom" in css and ".ui-loupe__zoom[hidden]" in css
|