refactor: make Following sync outcome explicit
This commit is contained in:
parent
6c12731215
commit
d3ba5975a0
|
|
@ -3785,6 +3785,7 @@ async def mutate_global_search_preview_subscription(
|
|||
)
|
||||
return JSONResponse({
|
||||
**result,
|
||||
"following_synced": True,
|
||||
"following_revision": following["revision"],
|
||||
"following_count": len(following["items"]),
|
||||
})
|
||||
|
|
|
|||
|
|
@ -42,7 +42,12 @@ async def test_confirmed_watch_updates_account_following_collection(monkeypatch,
|
|||
following = await client.get("/api/v1/following")
|
||||
|
||||
assert watched.status_code == 200
|
||||
assert watched.json() == {"watching": True, "following_revision": 1, "following_count": 1}
|
||||
assert watched.json() == {
|
||||
"watching": True,
|
||||
"following_synced": True,
|
||||
"following_revision": 1,
|
||||
"following_count": 1,
|
||||
}
|
||||
assert following.status_code == 200
|
||||
assert following.headers["cache-control"] == "no-store"
|
||||
assert following.json() == {"revision": 1, "items": [{
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ async def test_search_preview_subscription_mutation_revalidates_target_and_confi
|
|||
expected_count = 1 if watching else 0
|
||||
assert response.json() == {
|
||||
"watching": watching,
|
||||
"following_synced": True,
|
||||
"following_revision": expected_count,
|
||||
"following_count": expected_count,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user