diff --git a/importarr/main.py b/importarr/main.py index 289b36b..897a8d2 100644 --- a/importarr/main.py +++ b/importarr/main.py @@ -55,7 +55,7 @@ def health() -> dict[str, str]: @app.get("/", response_class=HTMLResponse) def index(request: Request) -> HTMLResponse: - return templates.TemplateResponse("index.html", {"request": request, "status": status(), "batches": state.list_manual_batches()}) + return templates.TemplateResponse(request, "index.html", {"status": status(), "batches": state.list_manual_batches()}) @app.get("/api/status") diff --git a/tests/test_status.py b/tests/test_status.py index 19a45fc..d043441 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -18,3 +18,16 @@ def test_status_contains_service_configuration(tmp_path, monkeypatch): assert "movies_root" in payload assert "tv_root" in payload assert "auth_enabled" in payload + + +def test_index_renders_queue_controls(tmp_path, monkeypatch): + monkeypatch.setenv("IMPORTARR_STATE_PATH", str(tmp_path / "state.db")) + import importarr.main as main + + from fastapi.testclient import TestClient + + response = TestClient(main.app).get("/") + + assert response.status_code == 200 + assert "Queue controls" in response.text + assert "cancel-current" in response.text