Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
63 lines
2.4 KiB
Python
63 lines
2.4 KiB
Python
"""279 B08 · B09 보조 탭 단추 높이 한 꼴.
|
|
|
|
- 테마 토큰 `--subtab-height` = 24px(B09 단가산출근거 박스보기 때 잰 값)
|
|
- 공용 양식 `.ui-subtabs`(가운데 맞춤 · 단추 높이 = 토큰) · `.ui-subtabs__tools`(높이 = 토큰 · 줄 높이 안 바꿈)
|
|
- B09 아래 줄 · 도구 · B08 보조 탭 줄 모두(빈 줄 자리 포함)가 씀 · 위 탭 줄은 안 씀
|
|
- `ui-btn--sm` 전체는 그대로
|
|
"""
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def _read(rel: str) -> str:
|
|
return (ROOT / rel).read_text(encoding="utf-8")
|
|
|
|
|
|
def _block(css: str, selector: str) -> str:
|
|
m = re.search(re.escape(selector) + r"\s*\{([^}]*)\}", css)
|
|
assert m, selector
|
|
return m.group(1)
|
|
|
|
|
|
def test_token_is_box_view_height():
|
|
theme = _read("ui_template/ui_template_theme.css")
|
|
assert re.search(r"--subtab-height:\s*24px;", theme)
|
|
|
|
|
|
def test_shared_class_centers_and_fixes_height():
|
|
css = _read("ui_template/ui_template_general_layout.css")
|
|
assert "align-items: center" in _block(css, ".ui-subtabs")
|
|
assert "height: var(--subtab-height)" in _block(css, ".ui-subtabs > .ui-btn")
|
|
tools = _block(css, ".ui-subtabs__tools")
|
|
assert "align-items: center" in tools
|
|
assert "height: var(--subtab-height)" in tools
|
|
|
|
|
|
def test_sm_button_untouched():
|
|
styles = _read("ui_template/ui_template_elements_styles.ts")
|
|
assert "height" not in _block(styles, ".ui-btn--sm")
|
|
|
|
|
|
def test_b09_sub_row_and_tools_use_shared_class():
|
|
bar = _read("B09_Estimation/B09_Estimation_UI_TabBar.ts")
|
|
assert 'sub.className = "b09-estimation__tabs ui-subtabs"' in bar
|
|
assert 'tools.className = "b09-estimation__tools ui-subtabs__tools"' in bar
|
|
assert 'top.className = "b09-estimation__tabs"' in bar # 위 탭은 그대로
|
|
|
|
|
|
def test_b08_sub_rows_use_shared_class():
|
|
sub_rows = {
|
|
"B08_Quantity/B08_Quantity_UI_Page.ts": 2, # 자재 보조 탭 · 구조물 집계표 빈 줄 자리
|
|
"B08_Quantity/B08_Quantity_UI_Earthwork.ts": 1,
|
|
"B08_Quantity/B08_Quantity_UI_Hydro.ts": 1,
|
|
"B08_Quantity/B08_Quantity_UI_Milestone.ts": 1,
|
|
}
|
|
for rel, n in sub_rows.items():
|
|
src = _read(rel)
|
|
assert src.count('"b08-quantity__tabs ui-subtabs') == n, rel
|
|
page = _read("B08_Quantity/B08_Quantity_UI_Page.ts")
|
|
assert 'tabBar.className = "b08-quantity__tabs";' in page # 위 탭은 그대로
|