"""FlowDeck — Basic tests.""" import pytest from fastapi.testclient import TestClient @pytest.fixture def client(): import os os.environ["GITEA_URL"] = "https://git.dracodev.net" os.environ["GITEA_TOKEN"] = "test" os.environ["DATABASE_URL"] = "sqlite:///:memory:" from app.main import app from app.db import init_db init_db() return TestClient(app) def test_health(client): resp = client.get("/api/health") assert resp.status_code == 200 data = resp.json() assert "status" in data assert data["db"] is True def test_dashboard(client): resp = client.get("/") assert resp.status_code == 200 assert "FlowDeck" in resp.text or "Projets" in resp.text def test_stats(client): resp = client.get("/api/stats") assert resp.status_code == 200 data = resp.json() assert "boards" in data def test_projects(client): resp = client.get("/api/projects") assert resp.status_code == 200 def test_board_404(client): resp = client.get("/board/test/test") # Should render or return error, not crash assert resp.status_code in (200, 500)