feat(web): UI compact Trimiteri + bara bulk contextuala + fix buton "+" editor (PRD 5.22)
Trimiteri desktop = tabel grid cu header, un rand per trimitere: status = bulina cu tooltip, mediu = litera T/P, multi-cod = primul cod + badge +N, sub-linie de eroare cu textul brut RAR doar pe error/needs_data. Mobil: 2 linii prin grid-areas, fara header. Actiunile bulk apar doar la selectie (bara contextuala cu contor + texte explicite). Mapari: exemplu concret in loc de descriere la Reguli automate. Fix buton "+" chips (nu facea nimic, fara eroare): hx-disabled-elt="find button" mostenit de la form-ul parinte crapa htmx inainte de request -> hx-disabled-elt="this" explicit pe butoanele chips; separat, no-op-urile silentioase din post_form_chips au acum mesaje (cod invalid/duplicat) si confirmare cu chip evidentiat la succes. Suita: 1622 passed. Verify E2E in browser (desktop 1280 + mobil 390). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,3 +46,39 @@ def test_eticheta_lunga_ramane_pentru_subtext():
|
||||
assert isinstance(css_class, str) and css_class, (
|
||||
f"eticheta_stare({status!r}) trebuie sa aiba css_class non-vida la pozitia 3"
|
||||
)
|
||||
|
||||
|
||||
def test_eroare_bruta_prefera_cauza_tehnica():
|
||||
import json
|
||||
from app.web.labels import eroare_bruta
|
||||
rar_error = json.dumps({
|
||||
"cod": "RAR_EROARE_SERVER",
|
||||
"problema": "RAR a esuat la inregistrarea prezentarii",
|
||||
"cauza": "ORA-12899: value too large for column PRESTATII.COD",
|
||||
"fix": "…",
|
||||
"field": None,
|
||||
"message": "ORA-12899: value too large for column PRESTATII.COD",
|
||||
})
|
||||
assert eroare_bruta("error", rar_error) == (
|
||||
"ORA-12899: value too large for column PRESTATII.COD"
|
||||
)
|
||||
|
||||
|
||||
def test_eroare_bruta_goala_pe_needs_mapping_si_stari_ok():
|
||||
from app.web.labels import eroare_bruta
|
||||
assert eroare_bruta("needs_mapping", '{"unmapped": [{"cod_op_service": "X"}]}') == ""
|
||||
assert eroare_bruta("sent", "orice") == ""
|
||||
assert eroare_bruta("queued", None) == ""
|
||||
|
||||
|
||||
def test_eroare_bruta_validare_needs_data():
|
||||
import json
|
||||
from app.web.labels import eroare_bruta
|
||||
rar_error = json.dumps([{"field": "vin", "message": "VIN invalid (17 caractere)"}])
|
||||
assert eroare_bruta("needs_data", rar_error) == "VIN invalid (17 caractere)"
|
||||
|
||||
|
||||
def test_eroare_bruta_nu_arunca_pe_json_corupt():
|
||||
from app.web.labels import eroare_bruta
|
||||
assert eroare_bruta("error", "{corupt") == "{corupt"
|
||||
assert eroare_bruta("error", None) == ""
|
||||
|
||||
@@ -212,3 +212,23 @@ def test_fara_operatie_service_cand_lipseste():
|
||||
d4 = prezentare_din_payload("nu-e-json")
|
||||
assert d4["op_service_cod"] == ""
|
||||
assert d4["op_service_denumire"] == ""
|
||||
|
||||
|
||||
def test_coduri_rar_lista_ordonata_dedup():
|
||||
from app.payload_view import prezentare_din_payload
|
||||
p = prezentare_din_payload({
|
||||
"vin": "WVWZZZ1JZXW000111",
|
||||
"prestatii": [
|
||||
{"cod_prestatie": "OE-1", "cod_op_service": "A"},
|
||||
{"cod_prestatie": "oe-2", "cod_op_service": "B"},
|
||||
{"cod_prestatie": "OE-1", "cod_op_service": "C"}, # duplicat
|
||||
{"cod_op_service": "D"}, # nemapat, fara cod
|
||||
],
|
||||
})
|
||||
assert p["coduri_rar"] == ["OE-1", "OE-2"]
|
||||
|
||||
|
||||
def test_coduri_rar_gol_fara_prestatii():
|
||||
from app.payload_view import prezentare_din_payload
|
||||
assert prezentare_din_payload({"vin": "X"})["coduri_rar"] == []
|
||||
assert prezentare_din_payload(None)["coduri_rar"] == []
|
||||
|
||||
@@ -246,3 +246,34 @@ def test_bulk_scoped_cont(client):
|
||||
# Randul lui B NEATINS
|
||||
assert _get_status(sid_b) == "needs_mapping", \
|
||||
"Randul contului B a fost modificat de contul A — INCALCARE SCOPE!"
|
||||
|
||||
|
||||
def test_bara_bulk_ascunsa_implicit(client):
|
||||
"""Controalele bulk stau intr-o bara contextuala ascunsa implicit (fara selectie)."""
|
||||
acct = _create_account_user("bara.hidden@test.com")
|
||||
_insert_submission(acct)
|
||||
_login(client, "bara.hidden@test.com")
|
||||
|
||||
html = client.get("/_fragments/submissions").text
|
||||
assert 'id="bulk-bar"' in html, "Bara contextuala bulk lipseste"
|
||||
m = re.search(r'id="bulk-bar"[^>]*class="([^"]*)"', html) or \
|
||||
re.search(r'class="([^"]*)"[^>]*id="bulk-bar"', html)
|
||||
assert m and "bulk-bar" in m.group(1) and "activ" not in m.group(1), (
|
||||
f"Bara bulk trebuie randata inactiva (ascunsa prin CSS): {m.group(0) if m else 'fara clasa'}"
|
||||
)
|
||||
# butonul vechi permanent 'Aplica cod' (fara context) a disparut
|
||||
assert ">\n Aplica cod\n </button>" not in html
|
||||
|
||||
|
||||
def test_bara_bulk_texte_explicite(client):
|
||||
"""Bara contine contor, buton explicit 'Aplica acest cod la N randuri',
|
||||
stergere cu N, 'Deselecteaza' si hint-ul cu ce face actiunea."""
|
||||
acct = _create_account_user("bara.texte@test.com")
|
||||
_insert_submission(acct)
|
||||
_login(client, "bara.texte@test.com")
|
||||
|
||||
html = client.get("/_fragments/submissions").text
|
||||
assert "selectate" in html
|
||||
assert "Aplica acest cod la" in html
|
||||
assert "Deselecteaza" in html
|
||||
assert "operatiilor fara cod" in html, "Hint-ul explicativ lipseste"
|
||||
|
||||
@@ -799,3 +799,128 @@ def test_add_extra_semnal_vizibil_cod_invalid(client):
|
||||
assert "chips-extra-error" in resp.text, (
|
||||
f"Semnalul 'chips-extra-error' lipsa pentru cod invalid: {resp.text[:300]}"
|
||||
)
|
||||
|
||||
|
||||
def test_add_per_op_cod_invalid_afiseaza_mesaj(client):
|
||||
"""Actiunea 'add' (picker per operatie) cu cod invalid da semnal vizibil."""
|
||||
_create_account_user("add.op.err@test.com")
|
||||
_login(client, "add.op.err@test.com")
|
||||
_seed_cod("OE-1", "Schimb ulei")
|
||||
csrf = _csrf(client)
|
||||
|
||||
resp = client.post(
|
||||
"/form-chips",
|
||||
data={
|
||||
"csrf_token": csrf,
|
||||
"cod_prestatie": [""],
|
||||
"chip_op_service": ["SchimbUlei"],
|
||||
"chip_denumire": ["Schimb ulei"],
|
||||
"chips_action": "add",
|
||||
"chips_add_op_index": "0",
|
||||
"chips_add_cod_0": "XX-99", # cod inexistent
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert "chips-extra-error" in resp.text, (
|
||||
f"Semnal de eroare lipsa la add cu cod invalid: {resp.text[:300]}"
|
||||
)
|
||||
|
||||
|
||||
def test_add_flat_cod_invalid_afiseaza_mesaj(client):
|
||||
"""Actiunea 'add_flat' cu cod invalid da semnal vizibil (nu no-op silentios)."""
|
||||
_create_account_user("add.flat.err@test.com")
|
||||
_login(client, "add.flat.err@test.com")
|
||||
_seed_cod("OE-1", "Schimb ulei")
|
||||
csrf = _csrf(client)
|
||||
|
||||
resp = client.post(
|
||||
"/form-chips",
|
||||
data={
|
||||
"csrf_token": csrf,
|
||||
"cod_prestatie": ["OE-1"],
|
||||
"chip_op_service": [""],
|
||||
"chip_denumire": [""],
|
||||
"chips_action": "add_flat",
|
||||
"chips_add_cod_flat": "XX-99",
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert "chips-extra-error" in resp.text, (
|
||||
f"Semnal de eroare lipsa la add_flat cu cod invalid: {resp.text[:300]}"
|
||||
)
|
||||
|
||||
|
||||
def test_add_flat_duplicat_afiseaza_mesaj(client):
|
||||
"""add_flat cu un cod deja prezent NU dubleaza chip-ul si afiseaza mesaj."""
|
||||
_create_account_user("add.flat.dup@test.com")
|
||||
_login(client, "add.flat.dup@test.com")
|
||||
_seed_cod("OE-1", "Schimb ulei")
|
||||
csrf = _csrf(client)
|
||||
|
||||
resp = client.post(
|
||||
"/form-chips",
|
||||
data={
|
||||
"csrf_token": csrf,
|
||||
"cod_prestatie": ["OE-1"],
|
||||
"chip_op_service": [""],
|
||||
"chip_denumire": [""],
|
||||
"chips_action": "add_flat",
|
||||
"chips_add_cod_flat": "OE-1", # deja in lista
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
import re as _re
|
||||
hidden = _re.findall(r'<input[^>]+name="cod_prestatie"[^>]+value="OE-1"', resp.text)
|
||||
assert len(hidden) == 1, f"Chip OE-1 duplicat: {len(hidden)} aparitii"
|
||||
assert "deja in lista" in resp.text, (
|
||||
f"Mesaj de duplicat lipsa la add_flat: {resp.text[:300]}"
|
||||
)
|
||||
|
||||
|
||||
def test_add_extra_duplicat_afiseaza_mesaj(client):
|
||||
"""add_extra cu chip extra identic existent afiseaza mesaj (nu no-op)."""
|
||||
_create_account_user("add.extra.dup@test.com")
|
||||
_login(client, "add.extra.dup@test.com")
|
||||
_seed_cod("OE-1", "Schimb ulei")
|
||||
_seed_cod("FRN1", "Franare")
|
||||
csrf = _csrf(client)
|
||||
|
||||
resp = client.post(
|
||||
"/form-chips",
|
||||
data={
|
||||
"csrf_token": csrf,
|
||||
"cod_prestatie": ["OE-1", "FRN1"],
|
||||
"chip_op_service": ["SchimbUlei", ""],
|
||||
"chip_denumire": ["Schimb ulei", ""],
|
||||
"chips_action": "add_extra",
|
||||
"chips_add_cod_flat": "FRN1", # chip extra identic deja existent
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert "deja in lista" in resp.text, (
|
||||
f"Mesaj de duplicat lipsa la add_extra: {resp.text[:300]}"
|
||||
)
|
||||
|
||||
|
||||
def test_add_reusit_marcheaza_chip_nou(client):
|
||||
"""Adaugare reusita: chip-ul nou e evidentiat (chip-nou) + mesaj de confirmare."""
|
||||
_create_account_user("add.ok.nou@test.com")
|
||||
_login(client, "add.ok.nou@test.com")
|
||||
_seed_cod("OE-1", "Schimb ulei")
|
||||
_seed_cod("FRN1", "Franare")
|
||||
csrf = _csrf(client)
|
||||
|
||||
resp = client.post(
|
||||
"/form-chips",
|
||||
data={
|
||||
"csrf_token": csrf,
|
||||
"cod_prestatie": ["OE-1"],
|
||||
"chip_op_service": ["SchimbUlei"],
|
||||
"chip_denumire": ["Schimb ulei"],
|
||||
"chips_action": "add_extra",
|
||||
"chips_add_cod_flat": "FRN1",
|
||||
},
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert "chip-nou" in resp.text, f"Chip nou neevidentiat: {resp.text[:300]}"
|
||||
assert "adaugat" in resp.text, f"Mesaj de confirmare lipsa: {resp.text[:300]}"
|
||||
|
||||
@@ -198,3 +198,20 @@ def test_cod_invalid_respins(client):
|
||||
assert resp.status_code == 200
|
||||
assert "necunoscut" in resp.text.lower()
|
||||
assert _text_rules(acct) == []
|
||||
|
||||
|
||||
def test_sectiune_reguli_afiseaza_exemplu_nu_descriere(client):
|
||||
"""Capul sectiunii = un exemplu concret de regula, nu paragraf descriptiv."""
|
||||
_create_account_user("exemplu.regula@test.com")
|
||||
_login(client, "exemplu.regula@test.com")
|
||||
|
||||
resp = client.get("/?tab=mapari")
|
||||
assert resp.status_code == 200
|
||||
html = resp.text
|
||||
|
||||
# Exemplul concret e prezent (pattern + cod, formatate)
|
||||
assert "regula-exemplu" in html, "Blocul de exemplu (regula-exemplu) lipseste"
|
||||
assert "verificare" in html
|
||||
assert "OE-2" in html
|
||||
# Paragraful descriptiv vechi a disparut
|
||||
assert "nu egal, ci substring" not in html, "Descrierea veche inca prezenta"
|
||||
|
||||
@@ -539,7 +539,7 @@ def test_clasa_contor_card(client):
|
||||
|
||||
def test_clasa_lista_slim(client):
|
||||
""".lista-trimiteri-slim + .trimitere-slim: separator --line2, padding, tinta min-height:44px.
|
||||
Sub-elemente: .slim-vin (mono) si .slim-meta (muted 11px).
|
||||
Sub-elemente: .slim-vin (mono) si .c-meta (celulele cod/operatie/data).
|
||||
"""
|
||||
_create_account_user("ls2@test.com")
|
||||
_login(client, "ls2@test.com")
|
||||
@@ -552,8 +552,8 @@ def test_clasa_lista_slim(client):
|
||||
assert "var(--line2)" in bloc, ".trimitere-slim nu foloseste var(--line2) ca separator"
|
||||
assert "min-height:44px" in bloc, ".trimitere-slim nu are tinta min-height:44px"
|
||||
assert ".slim-vin" in bloc, ".slim-vin lipseste din bloc"
|
||||
assert ".slim-meta" in bloc, ".slim-meta lipseste din bloc"
|
||||
assert "var(--muted)" in bloc, ".slim-meta nu foloseste var(--muted)"
|
||||
assert ".c-meta" in bloc, ".c-meta lipseste din bloc"
|
||||
assert "var(--muted)" in bloc, "componentele slim nu folosesc var(--muted)"
|
||||
|
||||
|
||||
def test_clasa_camp_slim(client):
|
||||
|
||||
@@ -186,15 +186,16 @@ def test_operatie_contine_cod_rar(client):
|
||||
|
||||
|
||||
def test_pill_eticheta_scurta(client):
|
||||
"""Pill-ul de Stare foloseste eticheta scurta; textul lung in title."""
|
||||
"""Statusul e bulina colorata (dot-stare); textul complet al starii in title."""
|
||||
acct = _create_account_user("pill@test.com")
|
||||
_insert_submission(acct, "sent", id_prezentare=70001)
|
||||
_login(client, "pill@test.com")
|
||||
resp = client.get("/_fragments/submissions")
|
||||
assert resp.status_code == 200
|
||||
html = resp.text
|
||||
# eticheta scurta in pill
|
||||
assert ">Finalizat<" in html
|
||||
# bulina cu clasa de stare, fara text in celula
|
||||
assert "dot-stare" in html
|
||||
assert "s-sent" in html
|
||||
# textul lung pastrat ca tooltip (title)
|
||||
assert 'title="Declarate la RAR' in html
|
||||
|
||||
@@ -229,8 +230,8 @@ def test_eticheta_umana_apare_sub_pill(client):
|
||||
resp = client.get("/_fragments/submissions")
|
||||
assert resp.status_code == 200
|
||||
html = resp.text
|
||||
assert "eticheta-problema" in html # containerul textului uman sub pill
|
||||
assert "s-error" in html # colorat ca problema (error/needs_*)
|
||||
assert "c-err" in html # sub-linia compacta de eroare
|
||||
assert "lipsa odometru" in html # textul brut al erorii, nu eticheta explicativa
|
||||
# NU randeaza cod brut de catalog pe rand
|
||||
assert "COD_" not in html
|
||||
assert "RAR_EROARE" not in html
|
||||
@@ -444,16 +445,17 @@ def test_rand_slim_vin_operatie_pill(client):
|
||||
assert "slim-vin" in html, "slim-vin lipseste — linia 1 placuta"
|
||||
assert "B777ZZZ" in html, "placuta (nr. inmatriculare) lipseste de pe rand"
|
||||
|
||||
# L2: cod RAR · operatie · data (slim-meta / slim-rand2)
|
||||
assert "slim-meta" in html, "slim-meta lipseste — linia 2"
|
||||
assert "slim-rand2" in html, "slim-rand2 lipseste — linia 2 (cod RAR · operatie · data)"
|
||||
# Celulele: cod RAR · operatie · data (c-meta cu c-cod/c-op/c-data)
|
||||
assert "c-meta" in html, "c-meta lipseste — celulele cod/operatie/data"
|
||||
assert "c-cod" in html and "c-op" in html, "celulele cod/operatie lipsesc"
|
||||
|
||||
# VIN integral nu mai e pe rand — traieste in modalul de detaliu.
|
||||
assert "000777" not in html, "VIN scurt nu mai trebuie randat pe randul slim (2 linii)"
|
||||
|
||||
# Pill de stare: clasa CSS + eticheta scurta
|
||||
assert "s-sent" in html, "clasa pill s-sent lipseste"
|
||||
assert "Finalizat" in html, "eticheta scurta stare_scurt lipseste"
|
||||
# Status: bulina cu clasa de stare; numele coloanei in header
|
||||
assert "s-sent" in html, "clasa de stare s-sent lipseste"
|
||||
assert "dot-stare" in html, "bulina de status lipseste"
|
||||
assert "Status" in html, "headerul coloanei Status lipseste"
|
||||
|
||||
|
||||
def test_filtre_paginare_pastrate(client):
|
||||
|
||||
@@ -136,3 +136,128 @@ def test_placuta_lipsa_nu_genereaza_rand_gol(client):
|
||||
assert m.group(1).strip() != "—", "slim-vin afiseaza '—' izolat ca identificator"
|
||||
|
||||
assert "fara numar" in html, "fallback 'fara numar' lipseste cand placuta+VIN absente"
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Tabel compact desktop (PRD 5.22): header coloane, bulina status, T/P, #
|
||||
# badge +N multi-cod, sub-linie eroare bruta. #
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
def _ins_full(acct: int, *, payload: dict, status: str = "queued",
|
||||
rar_env: str = "test", rar_error: str | None = None) -> int:
|
||||
from app.db import get_connection
|
||||
conn = get_connection()
|
||||
try:
|
||||
cur = conn.execute(
|
||||
"INSERT INTO submissions (idempotency_key, account_id, status, payload_json, rar_env, rar_error) "
|
||||
"VALUES (?, ?, ?, ?, ?, ?)",
|
||||
(f"k-{os.urandom(5).hex()}", acct, status,
|
||||
json.dumps(payload), rar_env, rar_error),
|
||||
)
|
||||
conn.commit()
|
||||
return int(cur.lastrowid)
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
|
||||
def _payload_min(coduri: list[str] | None = None) -> dict:
|
||||
return {
|
||||
"vin": "WVWZZZ1JZXW000002",
|
||||
"nr_inmatriculare": "B22TST",
|
||||
"data_prestatie": "2026-06-21",
|
||||
"odometru_final": "200",
|
||||
"prestatii": [{"cod_prestatie": c} for c in (coduri or ["R-X"])],
|
||||
}
|
||||
|
||||
|
||||
def test_desktop_header_coloane(client):
|
||||
"""Lista are un rand de header cu numele coloanelor (Status, Mediu etc.)."""
|
||||
acct = _create_account_user("head.col@test.com")
|
||||
_ins(acct, nr="B77HDR")
|
||||
_login(client, "head.col@test.com")
|
||||
|
||||
html = client.get("/_fragments/submissions").text
|
||||
assert "trimiteri-head" in html, "Randul de header lipseste"
|
||||
for col in ("Vehicul", "Cod RAR", "Operatie", "Status", "Mediu"):
|
||||
assert col in html, f"Coloana '{col}' lipseste din header"
|
||||
|
||||
|
||||
def test_status_bulina_cu_tooltip(client):
|
||||
"""Statusul e o bulina colorata (dot-stare) cu numele starii in title."""
|
||||
acct = _create_account_user("dot.status@test.com")
|
||||
_ins_full(acct, payload=_payload_min(), status="sent")
|
||||
_login(client, "dot.status@test.com")
|
||||
|
||||
html = client.get("/_fragments/submissions").text
|
||||
m = re.search(r'<span[^>]*class="dot-stare[^"]*s-sent[^"]*"[^>]*title="([^"]+)"', html) or \
|
||||
re.search(r'<span[^>]*class="dot-stare[^"]*"[^>]*class[^>]*>', html)
|
||||
assert "dot-stare" in html, "Bulina de status (dot-stare) lipseste"
|
||||
assert m, f"Bulina fara title (tooltip cu starea): {html[html.find('dot-stare')-100:html.find('dot-stare')+200]}"
|
||||
|
||||
|
||||
def test_mediu_litera_t_p(client):
|
||||
"""Mediul RAR e litera compacta: T (testare, contur) / P (productie, fill)."""
|
||||
acct = _create_account_user("env.litera@test.com")
|
||||
_ins_full(acct, payload=_payload_min(), rar_env="test")
|
||||
_ins_full(acct, payload=_payload_min(), rar_env="prod")
|
||||
_login(client, "env.litera@test.com")
|
||||
|
||||
html = client.get("/_fragments/submissions").text
|
||||
assert re.search(r'class="env-l env-l-test"[^>]*>\s*T\s*<', html), "Litera T (testare) lipseste"
|
||||
assert re.search(r'class="env-l env-l-prod"[^>]*>\s*P\s*<', html), "Litera P (productie) lipseste"
|
||||
|
||||
|
||||
def test_multicod_badge_plus_n(client):
|
||||
"""Mai multe coduri RAR: primul cod + badge +N cu toate codurile in title."""
|
||||
acct = _create_account_user("multicod@test.com")
|
||||
_ins_full(acct, payload=_payload_min(["OE-1", "OE-2", "OE-8"]))
|
||||
_ins_full(acct, payload=_payload_min(["OE-4"]))
|
||||
_login(client, "multicod@test.com")
|
||||
|
||||
html = client.get("/_fragments/submissions").text
|
||||
m = re.search(r'<span class="cod-plus" title="([^"]+)">\+2</span>', html)
|
||||
assert m, "Badge-ul +2 lipseste pentru trimiterea cu 3 coduri"
|
||||
for cod in ("OE-1", "OE-2", "OE-8"):
|
||||
assert cod in m.group(1), f"Codul {cod} lipseste din tooltip-ul badge-ului"
|
||||
# un singur cod -> fara badge
|
||||
assert not re.search(r'OE-4[^<]*</span><span class="cod-plus"', html)
|
||||
|
||||
|
||||
def test_sublinie_eroare_bruta_doar_pe_error(client):
|
||||
"""Sub-linia rosie contine textul brut al erorii RAR, doar pe error/needs_data."""
|
||||
acct = _create_account_user("err.brut@test.com")
|
||||
_ins_full(
|
||||
acct, payload=_payload_min(), status="error",
|
||||
rar_error=json.dumps({
|
||||
"cod": "RAR_EROARE_SERVER",
|
||||
"problema": "RAR a esuat la inregistrarea prezentarii",
|
||||
"cauza": "ORA-12899: value too large for column PRESTATII.COD",
|
||||
"fix": "x", "field": None,
|
||||
"message": "ORA-12899: value too large for column PRESTATII.COD",
|
||||
}),
|
||||
)
|
||||
_ins_full(
|
||||
acct,
|
||||
payload={**_payload_min(), "prestatii": [{"cod_op_service": "IGIENIZARE", "denumire": "Igienizare AC"}]},
|
||||
status="needs_mapping",
|
||||
rar_error=json.dumps({"unmapped": [{"cod_op_service": "IGIENIZARE"}]}),
|
||||
)
|
||||
_login(client, "err.brut@test.com")
|
||||
|
||||
html = client.get("/_fragments/submissions").text
|
||||
err_cells = re.findall(r'class="c-err"[^>]*>([^<]*)<', html)
|
||||
assert len(err_cells) == 1, f"Exact o sub-linie de eroare asteptata, gasite {len(err_cells)}"
|
||||
assert "ORA-12899" in err_cells[0], f"Textul brut RAR lipseste: {err_cells[0]!r}"
|
||||
|
||||
|
||||
def test_mobil_pastreaza_doua_linii_cu_bulina_si_litera(client):
|
||||
"""CSS-ul mobil: header ascuns, rand pe 2 linii prin grid-areas (veh / meta),
|
||||
cu actiune + mediu + status in dreapta."""
|
||||
_create_account_user("mobil.css@test.com")
|
||||
_login(client, "mobil.css@test.com")
|
||||
|
||||
html = client.get("/?tab=coada").text
|
||||
assert re.search(r'\.trimiteri-head\s*\{\s*display\s*:\s*none', html), \
|
||||
"Headerul de coloane nu e ascuns pe mobil"
|
||||
m = re.search(r'grid-template-areas\s*:\s*"check veh\s+act env status"\s*"check meta act env status"', html)
|
||||
assert m, "Grid-areas pe 2 linii (veh/meta) lipseste din CSS-ul mobil"
|
||||
|
||||
Reference in New Issue
Block a user