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