feat(ui): onboarding suggestion chips with one-tap submit, keyboard access, and mobile scroll row
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
"""Integration tests: HTTP API surface (no database required)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
from app.config import get_settings
|
||||
|
||||
|
||||
def test_health_reports_ok(client) -> None:
|
||||
r = client.get("/api/health")
|
||||
@@ -16,7 +20,32 @@ def test_suggestions_returns_list(client) -> None:
|
||||
assert r.status_code == 200
|
||||
suggestions = r.json()["suggestions"]
|
||||
assert isinstance(suggestions, list)
|
||||
assert all(isinstance(s, str) and s for s in suggestions)
|
||||
assert len(suggestions) >= 3
|
||||
assert all(isinstance(s, str) and s.strip() for s in suggestions)
|
||||
|
||||
|
||||
def test_suggestions_honors_bor_suggestions_env_override(monkeypatch) -> None:
|
||||
"""GET /api/suggestions reflects the BOR_SUGGESTIONS JSON env override."""
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import create_app
|
||||
|
||||
override = [
|
||||
"How do I back up with Borg?",
|
||||
"How is my K3S cluster set up?",
|
||||
"How do I deploy a service?",
|
||||
"What proxy fronts reeseapps.com?",
|
||||
]
|
||||
get_settings.cache_clear()
|
||||
try:
|
||||
monkeypatch.setenv("BOR_SUGGESTIONS", json.dumps(override))
|
||||
fresh_client = TestClient(create_app())
|
||||
finally:
|
||||
get_settings.cache_clear()
|
||||
|
||||
r = fresh_client.get("/api/suggestions")
|
||||
assert r.status_code == 200
|
||||
assert r.json() == {"suggestions": override}
|
||||
|
||||
|
||||
def test_index_html_served_locally(client) -> None:
|
||||
|
||||
Reference in New Issue
Block a user