Files
Aislo/resources/tester/test_220_1_loupe_wheel.py
T
eomsangdonandClaude Opus 5.5 b1e8d6cb7f feat(설정): 332-1 휠 확대 방향 읽기 층 — input_prefs · 모든 휠 화면 한 설정(기본 당김) · 핀치는 늘 벌리면 확대
- 새 A00_Common/input_prefs.ts(INPUT_PREFS_KEY · DEFAULT_INPUT_PREFS · inputPrefs · wheelIn · wheelEventIn · 의존 없음)
- 등록표 input-prefs(pref · global) 한 줄
- touch_bridge wheelZoomsIn · b_svg_zoom_pan · B04 3D 카메라 · M02 DF 그림 · M02 노무 그림 · 돋보기 · 시트 배선
- M02 그림 · 시트 · 돋보기 기본 방향 = 당김(지금과 반대)
- 시험: test_input_prefs 새로 · 돋보기 · 266 · 244-8 헬퍼가 읽기 층을 불러옴 · 돋보기 부호 당김 기본

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
2026-10-15 12:36:04 +09:00

77 lines
2.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- 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): # 332 기본 = 당김 확대
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