- A01~A05 hero 다섯 벌 · 구역 제목 복제 CSS 걷고 공개 화면 틀 한 벌(wide 옵션 · 구역 제목 가운데 · 머리 아랫줄은 자리 안 먹는 그림자) - 카드 = 카드 부품(로그인 · 가입 · 지원 · 약관 · 기능 카드 · 소식 줄 · B11 단계 카드) · 지원 성공 · B10 안내 = 띠 알림 · 태그 = 배지 - A07 약관 날 체크 · 날 details = 체크 + 접이 부품 · A08 날 textarea = 입력 여러 줄 · 빈 소식 = 빈 상태 - 죽은 A07_Register_UI_Page · 쓰이지 않는 CSS 걷음 · 띠 알림 hidden 받음 - 지킴 시험 test_553_7_public_pages Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
118 lines
4.2 KiB
Python
118 lines
4.2 KiB
Python
"""553-7 공개 화면(A01~A09) · 로그인 · B10 · B11 부품 옮김 지킴 시험 — 서버 · 화면 없이 소스로.
|
|
|
|
· A01~A05 = 공개 화면 틀(createPublicFrame) 한 벌 — 페이지마다 hero · section 복제 CSS 없음
|
|
· 카드 = createCard · 알림 = createBanner · 배지 = createBadge · 여러 줄 = createInputField(multiline)
|
|
· 페이지 CSS 에 날 색(#hex · rgb · 옛 보라 이름) 없음 · 죽은 A07_Register_UI_Page 없음
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
PUBLIC_PAGES = {
|
|
"A01_Home/A01_Home_UI_Page.ts": ("A01_Home/A01_Home_UI_Style.css", "a01"),
|
|
"A02_ProgDetail/A02_ProgDetail_UI_Page.ts": (
|
|
"A02_ProgDetail/A02_ProgDetail_UI_Style.css",
|
|
"a02",
|
|
),
|
|
"A03_CompDetail/A03_CompDetail_UI_Page.ts": (
|
|
"A03_CompDetail/A03_CompDetail_UI_Style.css",
|
|
"a03",
|
|
),
|
|
"A04_NewsHistory/A04_NewsHistory_UI_Page.ts": (
|
|
"A04_NewsHistory/A04_NewsHistory_UI_Style.css",
|
|
"a04",
|
|
),
|
|
"A05_EduDetail/A05_EduDetail_UI_Page.ts": ("A05_EduDetail/A05_EduDetail_UI_Style.css", "a05"),
|
|
}
|
|
CARD_PAGES = [
|
|
"A06_Login/A06_Login_UI_Auth_Page.ts",
|
|
"A07_Register/A07_Register_UI_Auth_Page.ts",
|
|
"A08_Support/A08_Support_UI_Page.ts",
|
|
"A09_Security/A09_Security_UI_Page.ts",
|
|
]
|
|
CSS_FILES = [css for css, _ in PUBLIC_PAGES.values()] + [
|
|
"A06_Login/A06_Login_UI_Style.css",
|
|
"A07_Register/A07_Register_UI_Style.css",
|
|
"A08_Support/A08_Support_UI_Style.css",
|
|
"A09_Security/A09_Security_UI_Style.css",
|
|
"B10_Payment/B10_Payment_UI_Style.css",
|
|
"B11_Status/B11_Status_UI_Style.css",
|
|
]
|
|
RAW_COLOR = re.compile(
|
|
r"#[0-9a-fA-F]{3,8}\b|rgba?\(|hsla?\(|var\(--(?:b01|draw)-|"
|
|
r"var\(--color-(?:deep-iris|mist-violet|slate|charcoal|ash|plum-velvet)\)"
|
|
)
|
|
|
|
|
|
def _text(rel: str) -> str:
|
|
return (ROOT / rel).read_text(encoding="utf-8")
|
|
|
|
|
|
def _no_comments(css: str) -> str:
|
|
return re.sub(r"/\*.*?\*/", "", css, flags=re.S)
|
|
|
|
|
|
@pytest.mark.parametrize("page", PUBLIC_PAGES)
|
|
def test_public_page_uses_frame(page: str) -> None:
|
|
src = _text(page)
|
|
assert "createPublicFrame" in src
|
|
for tag in ("hero", "__inner", "__subtitle", "__ctas"):
|
|
assert tag not in src, f"{page}: 손 hero 조각 {tag} 남음"
|
|
|
|
|
|
@pytest.mark.parametrize("page", PUBLIC_PAGES)
|
|
def test_public_css_has_no_hero_copy(page: str) -> None:
|
|
css = _no_comments(_text(PUBLIC_PAGES[page][0]))
|
|
prefix = PUBLIC_PAGES[page][1]
|
|
assert f".{prefix}-hero" not in css
|
|
assert f".{prefix}-section" not in css
|
|
|
|
|
|
@pytest.mark.parametrize("page", CARD_PAGES)
|
|
def test_card_pages_use_card_part(page: str) -> None:
|
|
assert "createCard" in _text(page)
|
|
|
|
|
|
@pytest.mark.parametrize("css", CSS_FILES)
|
|
def test_page_css_no_raw_color(css: str) -> None:
|
|
assert not RAW_COLOR.search(_no_comments(_text(css)))
|
|
|
|
|
|
def test_a07_agreement_uses_checkbox_and_collapsible() -> None:
|
|
src = _text("A07_Register/A07_Register_UI_Auth_Page.ts")
|
|
assert "createCheckbox" in src and "attachCollapsible" in src
|
|
assert "<details" not in src and 'createElement("details")' not in src
|
|
assert 'type = "checkbox"' not in src
|
|
|
|
|
|
def test_a08_uses_banner_and_multiline_input() -> None:
|
|
src = _text("A08_Support/A08_Support_UI_Page.ts")
|
|
assert "createBanner" in src and "multiline" in src
|
|
assert "createTextAreaField" not in src and 'createElement("textarea")' not in src
|
|
|
|
|
|
def test_b10_b11_use_parts() -> None:
|
|
b10 = _text("B10_Payment/B10_Payment_UI_Page.ts")
|
|
b11 = _text("B11_Status/B11_Status_UI_Page.ts")
|
|
assert "createBanner" in b10 and "createBadge" in b10 and "createTag" not in b10
|
|
assert "createCard" in b11 and "createBadge" in b11 and "createTag" not in b11
|
|
assert ".b10-payment__note" not in _text("B10_Payment/B10_Payment_UI_Style.css")
|
|
assert ".b11-status__step {" not in _text("B11_Status/B11_Status_UI_Style.css")
|
|
|
|
|
|
def test_dead_register_page_gone() -> None:
|
|
assert not (ROOT / "A07_Register/A07_Register_UI_Page.ts").exists()
|
|
|
|
|
|
def test_public_frame_wide_option() -> None:
|
|
ts = _text("ui_template/ui_template_public_layout.ts")
|
|
css = _text("ui_template/ui_template_public_layout.css")
|
|
assert "wide?: boolean" in ts
|
|
assert "[data-wide] .ui-public-frame__title" in css
|