perf: consolidate initial navigation loading
ci / docker (push) Successful in 3m46s

This commit is contained in:
2026-09-05 20:29:47 +08:00
parent 05ab768a3b
commit 27432fa2e2
4 changed files with 79 additions and 1 deletions
+17
View File
@@ -12,6 +12,23 @@ def boot(client):
return client.get("/api/v1/lists").json()[0]
def test_bootstrap_returns_navigation_and_current_user(client):
inbox = boot(client)
client.post("/api/v1/folders", json={"name": "工作"})
client.post("/api/v1/tags", json={"name": "重要", "color": "#ff0000"})
client.post("/api/v1/tasks", json={"title": "首屏任务", "list_id": inbox["id"]})
response = client.get("/api/v1/bootstrap")
assert response.status_code == 200
data = response.json()
assert data["user"]["username"] == "owner"
assert any(row["id"] == inbox["id"] for row in data["lists"])
assert [row["name"] for row in data["folders"]] == ["工作"]
assert [row["name"] for row in data["tags"]] == ["重要"]
assert data["inbox_id"] == inbox["id"]
def test_recurring_calendar_exceptions_and_scopes(client):
inbox = boot(client)
task = client.post(