bmc_hub/tests/test_drift_operations_ui.py
Christian 1fb5b4a191 Add comprehensive tests for email and drift functionalities
- Introduced tests for drift operations UI and backend to ensure proper handling of ignore rules and UI elements.
- Added tests for email identity API to validate email linking and identity retrieval without updates.
- Implemented tests for email purchase link service to verify correct handling of purchase mail links and conflict scenarios.
- Created tests for email reply automation to ensure proper routing and processing of replies based on classification.
- Developed tests for email sender creation to validate suggestions and handling of existing contacts and companies.
- Added tests for email sender identity to ensure correct matching of contacts and domains.
- Implemented tests for work desk functionalities to validate task management, meeting registrations, and timer functionalities.
2026-11-03 01:16:12 +01:00

25 lines
1016 B
Python

from pathlib import Path
def test_drift_ui_uses_authoritative_summary_and_structured_ignore_flow():
source = Path("app/modules/drift/templates/drift.html").read_text(encoding="utf-8")
assert "data.active_alerts" in source
assert "uisp.active_events" in source
assert "Ignorér enhed fremover" in source
assert "/api/v1/drift/ignore-rules" in source
assert "Overvåg igen" in source
assert "drift-attention-filter" in source
assert "formatDriftDuration" in source
assert "Opsætning, kundemapping og ignorerede enheder" in source
def test_drift_backend_keeps_ignore_rules_reversible_and_source_scoped():
source = Path("app/modules/drift/backend/router.py").read_text(encoding="utf-8")
assert "CREATE TABLE IF NOT EXISTS drift_ignore_rules" in source
assert "UNIQUE (source_id, external_id)" in source
assert "SET is_active = FALSE" in source
assert "_event_matches_ignore_rule" in source
assert "IN ('active', 'warning', 'critical', 'new')" in source