fix: clarify unavailable legacy blocker resolution

This commit is contained in:
gti
2026-09-22 21:42:24 -03:00
parent c23782095c
commit 50254772e4
7 changed files with 141 additions and 9 deletions
+22
View File
@@ -271,6 +271,28 @@ def test_agent_and_blocker_details_keep_safe_forms_and_human_event_rows():
assert not re.search(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}", re.sub(r' title="[^"]*"', "", blocker_response.text))
def test_legacy_blocker_detail_explains_unavailable_resolution_without_form():
client, agent_id, _ = _panel_client()
with client._session_factory() as session:
installation = session.scalar(select(Installation).where(Installation.agent_id == agent_id))
blocker = upsert_blocker(
session,
installation.tenant_id,
{"company": "Acme", "product_code": "LEGACY", "blocker_type": "BLOCKED_MISSING_EVIDENCE", "field": "ST", "reason_code": "LEGACY", "input_fingerprint": "unbound-detail"},
)
session.commit()
blocker_id = blocker.id
response = client.get(f"/blockers/{blocker_id}")
assert response.status_code == 200
assert "blocker legado de empresa" in response.text.lower()
assert "sem vínculo comprovado com um servidor" in response.text.lower()
assert "não é possível oferecer o reprocessamento de contexto com segurança" in response.text.lower()
assert "Salvar contexto e reprocessar" not in response.text
assert f'action="/blockers/{blocker_id}/resolve-context"' not in response.text
def test_agent_detail_resolves_agent_after_first_hundred_installations():
client, _, _ = _panel_client()
factory = client._session_factory