fix(web): fix UP card layout and fan delta semantics
This commit is contained in:
1 parent
7fcd1db987
commit
f9a5478800
7 files changed
+51
-16
No files matched your search
@@ -171,6 +171,7 @@ def test_up_queries():
|
||||
db, q = setup(tmp)
|
||||
try:
|
||||
ups = q.list_ups()
|
||||
assert ups["sort"] == "avg_views"
|
||||
assert ups["total"] == 2
|
||||
assert ups["items"][0]["up_mid"] == 1
|
||||
assert ups["items"][0]["video_count"] == 2
|
||||
@@ -212,6 +213,15 @@ def test_fans_candidates_system_and_export():
|
||||
wide = q.fans(days=30)
|
||||
assert wide["dates"] == list(DATES)
|
||||
|
||||
# 缺失前一天时不能把跨多天的变化标成“日增”
|
||||
db.write(lambda conn: conn.execute(
|
||||
"DELETE FROM up_stat WHERE mid=37754047 AND stat_date=?",
|
||||
("2026-10-30",),
|
||||
))
|
||||
gapped = q.fans(days=3)
|
||||
assert gapped["delta_1d"] is None
|
||||
assert gapped["delta_7d"] is None
|
||||
|
||||
candidates = q.candidates()
|
||||
assert candidates["total"] == 2
|
||||
assert candidates["pending"] == 1
|
||||
|
||||
Reference in new issue
Block a user