From e2627c1aa40c6339edab727670556fb8d2d78376 Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Mon, 6 Jul 2026 13:50:33 +0000 Subject: [PATCH] test(web): actualizeaza 4 teste pentru meniul grupat + pagina Setari MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- tests/test_web_badge.py | 5 +++-- tests/test_web_mapari_meniu.py | 3 ++- tests/test_web_mapari_ui.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_web_badge.py b/tests/test_web_badge.py index 8c92849..f2f93e4 100644 --- a/tests/test_web_badge.py +++ b/tests/test_web_badge.py @@ -118,7 +118,8 @@ def test_badge_zero_ascuns(client): resp = client.get("/") 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): @@ -129,4 +130,4 @@ def test_badge_scoped_pe_cont(client): _login(client, "bs2@test.com") 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 diff --git a/tests/test_web_mapari_meniu.py b/tests/test_web_mapari_meniu.py index a54fdff..8193c60 100644 --- a/tests/test_web_mapari_meniu.py +++ b/tests/test_web_mapari_meniu.py @@ -88,7 +88,8 @@ def test_meniu_contine_mapari(client): idx = html.find('href="/?tab=mapari"') assert idx != -1 # 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, ( f"Textul 'Mapari' trebuie sa apara langa href=/?tab=mapari: ...{window}..." ) diff --git a/tests/test_web_mapari_ui.py b/tests/test_web_mapari_ui.py index 1d101fb..1b4070a 100644 --- a/tests/test_web_mapari_ui.py +++ b/tests/test_web_mapari_ui.py @@ -111,6 +111,6 @@ def test_cont_fara_mapari(client): html = resp.text assert "Mapari operatii salvate" not in html assert "Formate de coloane salvate" not in html - # Cont contine doar cheie API + creds RAR - assert "Cheia mea API" in html + # Setari contine sub-taburile cheie API + creds RAR + assert "Cheie API" in html assert "Credentiale RAR" in html