Files
Aislo/resources/tester/test_258_1_table_width_var.py
T
eomsangdonandClaude Sonnet 5.5 c2d3b8ccd9 feat(table): 표 폭 CSS 변수 · 고칠 칸 옅은 테두리 되살림 · 구조물 조합 미지정 회색 (258-1 · 258-2 · 258-3)
- 템플릿 표 인라인 width → --dt-w · css width var(--dt-w) · 거리이정표 표 틀 폭 전체
- 고칠 수 있는 칸 td.is-can-edit outline 1px accent 28% (box-shadow 아님)
- B05 구조물 조합 미지정 = 구조물 리스트 램프 회색
- 시험 기대값 고침(243_1 · 246_1 · 177_1 · ui_data_table) · 새 시험 258_1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015sDZSjFvoiDjdGpgj3muc3
2026-10-11 13:58:29 +09:00

53 lines
2.2 KiB
Python

"""258-1 · 258-2 · 258-3 — 표 폭 CSS 변수 · 입력 칸 테두리 옅게 · 구조물 조합 미지정 회색(소스 시험).
- 템플릿 표 인라인 = `--dt-w`(열 합) · css `width: var(--dt-w)` → 페이지 css 가 width 로 덮음
- 거리이정표 표 = 틀 폭 100%
- 고칠 칸 td.is-can-edit = accent 28% outline · box-shadow 아님
- B05 미지정 = 회색(text-muted)
"""
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
DT_CSS = ROOT / "ui_template" / "ui_template_data_table.css"
DT_TS = ROOT / "ui_template" / "ui_template_data_table.ts"
def _rule(css: str, selector: str) -> str:
m = re.search(re.escape(selector) + r" \{([^}]*)\}", css)
assert m, selector
return m.group(1)
def test_표_폭_인라인_변수_css_width_변수():
ts = DT_TS.read_text("utf-8")
assert '<table class="ui-data-table__table" style="--dt-w:${x}px">' in ts
assert 'style="width:${x}px"' not in ts # 인라인 width 가 페이지 css 를 이기지 않음
body = _rule(DT_CSS.read_text("utf-8"), ".ui-data-table__table")
assert "width: var(--dt-w);" in body
assert "table-layout: fixed;" in body
def test_거리이정표_표_틀_폭_전체():
css = (ROOT / "B08_Quantity" / "B08_Quantity_UI_Milestone.css").read_text("utf-8")
body = _rule(css, ".b08-milestone > .ui-data-table .ui-data-table__table")
assert "width: 100%;" in body # 변수 규칙(0,1,0)보다 선택자가 구체적
def test_입력_칸_테두리_옅게_outline():
css = DT_CSS.read_text("utf-8")
body = _rule(css, ".ui-data-table__table td.is-can-edit")
m = re.search(r"var\(--color-accent\) (\d+)%", body)
assert m and 25 <= int(m.group(1)) <= 30 # 예전 60% → 옅게
assert "outline: 1px solid" in body and "box-shadow" not in body
assert '"is-can-edit"' in DT_TS.read_text("utf-8")
def test_구조물_조합_미지정_회색():
css = (ROOT / "B05_Profile" / "B05_Profile_UI_Style_Structures.css").read_text("utf-8")
body = _rule(css, ".b05-structure__summary-name:not(.is-assigned)")
assert "border-color: var(--color-text-muted);" in body
assert "--color-text-muted" in body.split("background:")[1]
assert "--color-warning" not in body