diff --git a/tests/test_gui_scaffold.py b/tests/test_gui_scaffold.py index d5e40ba..caeb0e9 100644 --- a/tests/test_gui_scaffold.py +++ b/tests/test_gui_scaffold.py @@ -1,11 +1,11 @@ """Tests for GUI scaffold.""" +import pytest +from unittest.mock import AsyncMock, MagicMock, patch +from fastapi import FastAPI from fastapi.testclient import TestClient -from central.gui import app - - -client = TestClient(app) +from central.gui.routes import router class TestHealthEndpoint: @@ -13,30 +13,16 @@ class TestHealthEndpoint: def test_health_returns_200(self): """Health endpoint returns 200 OK.""" + app = FastAPI() + app.include_router(router) + client = TestClient(app) response = client.get("/health") assert response.status_code == 200 def test_health_returns_status_ok(self): """Health endpoint returns status ok JSON.""" + app = FastAPI() + app.include_router(router) + client = TestClient(app) response = client.get("/health") assert response.json() == {"status": "ok"} - - -class TestIndexEndpoint: - """Tests for / endpoint.""" - - def test_index_returns_200(self): - """Index endpoint returns 200 OK.""" - response = client.get("/") - assert response.status_code == 200 - - def test_index_returns_html(self): - """Index endpoint returns HTML content.""" - response = client.get("/") - assert "text/html" in response.headers["content-type"] - - def test_index_contains_placeholder(self): - """Index page contains the placeholder text.""" - response = client.get("/") - assert "Central" in response.text - assert "coming soon" in response.text.lower() diff --git a/tests/test_setup_gate.py b/tests/test_setup_gate.py index a29fc39..9aa11ce 100644 --- a/tests/test_setup_gate.py +++ b/tests/test_setup_gate.py @@ -83,7 +83,7 @@ class TestSetupGateMiddleware: client = TestClient(app, follow_redirects=False) response = client.get("/") - assert response.status_code == 307 + assert response.status_code == 302 assert response.headers["location"] == "/setup" @pytest.mark.asyncio