ui: loading states, player failure overlay + retry, toasts, back nav, full history page with delete
Bundle 1-4+7 from PLAN.md: skeleton loaders, player Loading/Buffering/fatal overlay with Retry, action toasts, back-to-home crumb + logo fix, ?history full-history view with per-entry delete (GET /api/history?all=1, DELETE /api/history). 14/14 tests green.
This commit is contained in:
1 parent
19e878800c
commit
2ec0f8a034
10 files changed
+414
-20
No files matched your search
@@ -115,6 +115,29 @@ def test_history_per_user(base=BASE):
|
||||
assert all(e.get("ep_id") != "111" for e in got_b), "leak: admin entry in alice's history"
|
||||
|
||||
|
||||
def test_history_all_and_delete(base=BASE):
|
||||
jar = login("alice", "alicepw12345", base)
|
||||
e1 = {"ep_id": 201, "slug_id": "del-a", "title": "Del A", "season_id": 1,
|
||||
"ep": "1", "lang": "eng", "pos": 5}
|
||||
e2 = {"ep_id": "202", "slug_id": "del-b", "title": "Del B", "season_id": 1,
|
||||
"ep": "2", "lang": "eng", "pos": 5}
|
||||
assert req("POST", "/api/history", e1, jar=jar, base=base) == 200
|
||||
assert req("POST", "/api/history", e2, jar=jar, base=base) == 200
|
||||
all_ = _json("GET", "/api/history?all=1", jar=jar, base=base)
|
||||
assert {e["slug_id"] for e in all_} >= {"del-a", "del-b"}
|
||||
# plain GET still caps at 5
|
||||
assert len(_json("GET", "/api/history", jar=jar, base=base)) <= 5
|
||||
# loose str match: the int ep_id row is deleted via a string query param
|
||||
removed = _json("DELETE", "/api/history?slug_id=del-a&ep_id=201", jar=jar, base=base)
|
||||
assert removed["removed"] >= 1, removed
|
||||
all_ = _json("GET", "/api/history?all=1", jar=jar, base=base)
|
||||
assert all(e["slug_id"] != "del-a" for e in all_)
|
||||
assert any(e["slug_id"] == "del-b" for e in all_)
|
||||
# idempotent
|
||||
assert _json("DELETE", "/api/history?slug_id=del-a&ep_id=201",
|
||||
jar=jar, base=base)["removed"] == 0
|
||||
|
||||
|
||||
def test_self_delete(base=BASE):
|
||||
jar = login("dave", "davepw12345", base)
|
||||
assert req("POST", "/account/delete", jar=jar, base=base) == 200
|
||||
|
||||
Reference in new issue
Block a user