refactor: comentarii strict functionale, fara referinte PRD/stories
Curatare globala a comentariilor si docstring-urilor (app, tools, teste, scripturi): eliminate referintele la PRD-uri, US-xxx, task-uri istorice si review-uri; pastrata doar informatia functionala, formulata scurt. Regula adaugata in CLAUDE.md (sectiunea Stil). Fara modificari de cod sau comportament. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
"""Teste US-001 + US-002 (PRD 5.3): Light/Dark mode comutator tema.
|
||||
|
||||
TDD: testele se scriu INAINTE de implementare (RED), dupa implementare trec (GREEN).
|
||||
"""
|
||||
"""Light/Dark mode comutator tema."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -52,7 +49,7 @@ def _login(client, email: str, password: str = "parolasecreta") -> None:
|
||||
assert resp.status_code == 303, f"Login esuat: {resp.status_code}"
|
||||
|
||||
|
||||
# ── US-001: Tema light ─────────────────────────────────────────────────────────
|
||||
# ── Tema light ─────────────────────────────────────────────────────────────────
|
||||
|
||||
def test_paleta_light_definita(client):
|
||||
"""HTML de la GET /login contine un selector [data-theme="light"] care redefineste
|
||||
@@ -72,7 +69,7 @@ def test_paleta_light_definita(client):
|
||||
|
||||
def test_dark_ramane_default(client):
|
||||
""":root contine paleta dark exacta: --bg:#0f1218, --card:#181c24, --ink:#e6e9ef.
|
||||
Valorile actualizate la US-013 (PRD 5.10) conform DESIGN.md (accent azur ROMFAST).
|
||||
Conform DESIGN.md (accent azur ROMFAST).
|
||||
"""
|
||||
resp = client.get("/login")
|
||||
assert resp.status_code == 200
|
||||
@@ -98,7 +95,7 @@ def test_suprafete_fara_fundal_hardcodat(client):
|
||||
assert "#16241c" not in style, "Fundalul hardcodat #16241c (flash) inca in <style>"
|
||||
|
||||
|
||||
# ── US-002: Comutator tema + anti-FOUC ────────────────────────────────────────
|
||||
# ── Comutator tema + anti-FOUC ─────────────────────────────────────────────────
|
||||
|
||||
def test_script_antifouc_in_head_inainte_de_style(client):
|
||||
"""<head> contine un <script> care citeste localStorage (cheia 'theme') si seteaza
|
||||
@@ -166,7 +163,7 @@ def test_toggle_pe_login_si_dashboard(client):
|
||||
), "Butonul toggle lipseste pe dashboard"
|
||||
|
||||
|
||||
# ── US-003: Fragmente HTMX fara fundal hardcodat ──────────────────────────────
|
||||
# ── Fragmente HTMX fara fundal hardcodat ───────────────────────────────────────
|
||||
|
||||
def test_fragmente_fara_fundal_hardcodat():
|
||||
"""Niciun fisier _*.html din app/web/templates/ nu contine literalii hex dark-fix
|
||||
@@ -188,7 +185,7 @@ def test_fragmente_fara_fundal_hardcodat():
|
||||
)
|
||||
|
||||
|
||||
# ── US-001 (PRD 5.15): Teme aditive + tokeni --card2/--line2 ──────────────────
|
||||
# ── Teme aditive + tokeni --card2/--line2 ──────────────────────────────────────
|
||||
|
||||
def test_cele_4_teme_definite(client):
|
||||
"""Cele 4 teme noi (grafit/cobalt/cupru/hartie) au blocuri CSS [data-theme="..."]
|
||||
@@ -326,12 +323,12 @@ def test_themes_dry_single_source(client):
|
||||
)
|
||||
|
||||
|
||||
# ── US-008: Test parametrizat robust — token critic in fiecare tema ─────────────
|
||||
# ── Test parametrizat robust — token critic in fiecare tema ────────────────────
|
||||
|
||||
@pytest.mark.parametrize("token", ["--card2", "--line2", "--accent", "--ok", "--err"])
|
||||
@pytest.mark.parametrize("tema", ["light", "dark", "petrol", "grafit", "cobalt", "cupru", "hartie"])
|
||||
def test_token_critic_in_tema_parametrizat(client, tema, token):
|
||||
"""US-008: test parametrizat robust — fiecare token critic e definit in fiecare tema.
|
||||
"""Test parametrizat robust — fiecare token critic e definit in fiecare tema.
|
||||
|
||||
Ancorare pe selectorul CSS [data-theme="X"] {...} (sau :root pentru dark),
|
||||
NU pe felii fixe [idx:idx+N]. Evita false-green-ul din regresia 5.13:
|
||||
@@ -372,24 +369,24 @@ def test_token_critic_in_tema_parametrizat(client, tema, token):
|
||||
)
|
||||
|
||||
|
||||
# ── US-001 PRD 5.16: Stiva font sistem standard web ───────────────────────────
|
||||
# ── Stiva font sistem standard web ─────────────────────────────────────────────
|
||||
|
||||
def test_font_stack_system_in_base(client):
|
||||
"""T-E2 (PRD 5.16): base.html DEFINESTE --font-ui si --font-mono in :root
|
||||
"""base.html DEFINESTE --font-ui si --font-mono in :root
|
||||
si body foloseste var(--font-ui). Niciun @font-face IBM Plex nu mai exista."""
|
||||
resp = client.get("/login")
|
||||
assert resp.status_code == 200
|
||||
html = resp.text
|
||||
|
||||
assert "--font-ui" in html, "Token --font-ui lipseste din :root (US-001 PRD 5.16)"
|
||||
assert "--font-mono" in html, "Token --font-mono lipseste din :root (US-001 PRD 5.16)"
|
||||
assert "var(--font-ui)" in html, "body nu foloseste var(--font-ui) (US-001 PRD 5.16)"
|
||||
assert "--font-ui" in html, "Token --font-ui lipseste din :root"
|
||||
assert "--font-mono" in html, "Token --font-mono lipseste din :root"
|
||||
assert "var(--font-ui)" in html, "body nu foloseste var(--font-ui)"
|
||||
assert "@font-face" not in html, \
|
||||
"@font-face inca prezent in base.html — sterge toate regulile IBM Plex (US-001 PRD 5.16)"
|
||||
"@font-face inca prezent in base.html — sterge toate regulile IBM Plex"
|
||||
|
||||
|
||||
def test_zero_referinte_static_fonts(client):
|
||||
"""T-E1 (PRD 5.16): nicio referinta /static/fonts/ in template-urile randate de app.
|
||||
"""Nicio referinta /static/fonts/ in template-urile randate de app.
|
||||
Toate literalele 'IBM Plex Sans' si 'IBM Plex Mono' sunt eliminate."""
|
||||
resp = client.get("/login")
|
||||
assert resp.status_code == 200
|
||||
@@ -404,24 +401,24 @@ def test_zero_referinte_static_fonts(client):
|
||||
|
||||
|
||||
def test_landing_fara_font_face_ibm_plex():
|
||||
"""T-E1 (PRD 5.16): landing.html nu contine @font-face IBM Plex si niciun
|
||||
"""landing.html nu contine @font-face IBM Plex si niciun
|
||||
literal 'IBM Plex Sans' sau 'IBM Plex Mono' ca font primary."""
|
||||
landing = Path(__file__).parent.parent / "app" / "web" / "templates" / "landing.html"
|
||||
assert landing.exists(), f"landing.html negasit la {landing}"
|
||||
content = landing.read_text(encoding="utf-8")
|
||||
|
||||
assert "@font-face" not in content, \
|
||||
"@font-face inca in landing.html — sterge toate regulile IBM Plex (US-008 PRD 5.16)"
|
||||
"@font-face inca in landing.html — sterge toate regulile IBM Plex"
|
||||
assert "IBM Plex Sans" not in content, \
|
||||
"Literal 'IBM Plex Sans' inca in landing.html — inlocuieste cu var(--font-ui)"
|
||||
assert "IBM Plex Mono" not in content, \
|
||||
"Literal 'IBM Plex Mono' inca in landing.html — inlocuieste cu var(--font-mono)"
|
||||
|
||||
|
||||
# ── US-002 PRD 5.16: Scala tipografica ────────────────────────────────────────
|
||||
# ── Scala tipografica ───────────────────────────────────────────────────────────
|
||||
|
||||
def test_tokeni_scala_fs_definiti(client):
|
||||
"""US-002 (PRD 5.16): tokenurile de scala tipografica --fs-xs..--fs-3xl si
|
||||
"""Tokenurile de scala tipografica --fs-xs..--fs-3xl si
|
||||
--lh-tight/--lh-body sunt definiti in :root."""
|
||||
resp = client.get("/login")
|
||||
assert resp.status_code == 200
|
||||
@@ -433,21 +430,21 @@ def test_tokeni_scala_fs_definiti(client):
|
||||
"--lh-tight", "--lh-body",
|
||||
]
|
||||
for tok in tokeni:
|
||||
assert tok in html, f"Token {tok} lipseste din :root (US-002 PRD 5.16)"
|
||||
assert tok in html, f"Token {tok} lipseste din :root"
|
||||
|
||||
|
||||
# ── US-011 PRD 5.16: Selector tema pill cu eticheta ───────────────────────────
|
||||
# ── Selector tema pill cu eticheta ─────────────────────────────────────────────
|
||||
|
||||
def test_selector_tema_are_eticheta(client):
|
||||
"""US-011 (PRD 5.16): butonul de tema este un pill cu clasa .tema-btn,
|
||||
"""Butonul de tema este un pill cu clasa .tema-btn,
|
||||
contine .tema-icon si #tema-label (eticheta vizibila a temei curente)."""
|
||||
resp = client.get("/login")
|
||||
assert resp.status_code == 200
|
||||
html = resp.text
|
||||
|
||||
assert "tema-btn" in html, \
|
||||
"Clasa .tema-btn lipseste din HTML — butonul de tema nu e pill (US-011 PRD 5.16)"
|
||||
"Clasa .tema-btn lipseste din HTML — butonul de tema nu e pill"
|
||||
assert "tema-icon" in html, \
|
||||
".tema-icon lipseste — iconita temei nu e separat de eticheta (US-011 PRD 5.16)"
|
||||
".tema-icon lipseste — iconita temei nu e separat de eticheta"
|
||||
assert 'id="tema-label"' in html, \
|
||||
'#tema-label lipseste — eticheta temei nu e prezenta in pill (US-011 PRD 5.16)'
|
||||
'#tema-label lipseste — eticheta temei nu e prezenta in pill'
|
||||
|
||||
Reference in New Issue
Block a user