from __future__ import annotations

from fastapi import FastAPI
from fastapi.testclient import TestClient

from src.api.v1.agents import router


def test_awoooi_status_cleanup_dashboard_endpoint_returns_snapshot():
    app = FastAPI()
    app.include_router(router, prefix="/api/v1")
    client = TestClient(app)

    response = client.get("/api/v1/agents/awoooi-status-cleanup-dashboard")

    assert response.status_code == 200
    data = response.json()
    assert data["schema_version"] == "awoooi_status_cleanup_dashboard_v1"
    assert data["summary"]["dashboard_status"] == "controlled_status_cleanup_package_ready"
    assert data["summary"]["gate_count"] == 5
    assert data["summary"]["blocked_gate_count"] == 0
    assert data["summary"]["controlled_status_cleanup_package_ready"] is True
    assert data["summary"]["apply_allowed"] is False
    assert data["summary"]["memory_write_authorized"] is False
    assert data["summary"]["wazuh_api_live_query_authorized"] is False
    assert data["memory_write_authorized"] is False
    assert data["runtime_execution_authorized"] is False
