test(web): actualizeaza 4 teste pentru meniul grupat + pagina Setari

- badge: cauta elementul randat (class="tab-badge"), nu substringul brut —
  CSS-ul nou din base.html contine mereu selectorul .tab-badge
- meniu mapari: fereastra de context largita — iconita SVG sta intre href si text
- setari: eticheta sub-tabului e "Cheie API", nu "Cheia mea API"

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-07-06 13:50:33 +00:00
parent 44f261e269
commit e2627c1aa4
3 changed files with 7 additions and 5 deletions

View File

@@ -118,7 +118,8 @@ def test_badge_zero_ascuns(client):
resp = client.get("/") resp = client.get("/")
assert resp.status_code == 200 assert resp.status_code == 200
assert "tab-badge" not in resp.text # cauta elementul randat, nu substringul brut (CSS-ul din base.html contine ".tab-badge")
assert 'class="tab-badge"' not in resp.text
def test_badge_scoped_pe_cont(client): def test_badge_scoped_pe_cont(client):
@@ -129,4 +130,4 @@ def test_badge_scoped_pe_cont(client):
_login(client, "bs2@test.com") _login(client, "bs2@test.com")
resp = client.get("/") resp = client.get("/")
assert "tab-badge" not in resp.text # contul 2 nu are nimic assert 'class="tab-badge"' not in resp.text # contul 2 nu are nimic

View File

@@ -88,7 +88,8 @@ def test_meniu_contine_mapari(client):
idx = html.find('href="/?tab=mapari"') idx = html.find('href="/?tab=mapari"')
assert idx != -1 assert idx != -1
# Cauta "Mapari" in fereastra contextului link-ului # Cauta "Mapari" in fereastra contextului link-ului
window = html[max(0, idx - 50):idx + 100] # fereastra larga: intre href si text sta iconita SVG a intrarii de meniu
window = html[max(0, idx - 50):idx + 400]
assert "Mapari" in window, ( assert "Mapari" in window, (
f"Textul 'Mapari' trebuie sa apara langa href=/?tab=mapari: ...{window}..." f"Textul 'Mapari' trebuie sa apara langa href=/?tab=mapari: ...{window}..."
) )

View File

@@ -111,6 +111,6 @@ def test_cont_fara_mapari(client):
html = resp.text html = resp.text
assert "Mapari operatii salvate" not in html assert "Mapari operatii salvate" not in html
assert "Formate de coloane salvate" not in html assert "Formate de coloane salvate" not in html
# Cont contine doar cheie API + creds RAR # Setari contine sub-taburile cheie API + creds RAR
assert "Cheia mea API" in html assert "Cheie API" in html
assert "Credentiale RAR" in html assert "Credentiale RAR" in html