test(pins): widen whitelist for the episode-collections JSON shapes (item 2 series)
TestContractPin_CollectionsJSON tripped on the additive keys the episode-collections work introduced — the tripwire worked exactly as designed (additive keys must be whitelisted here AND in docs/contract_pins.md first). - Collections envelope gains rule_match_mode (item 2.4): the smart-collection match semantics on GET /api/collections/:id. - BookInfo gains four STABLE keys (item 2.3): is_episode, feed_title, download_state, hidden — dropped omitempty so every card surface emits the same key set (the viewer_percentage precedent; adapters that predate episode awareness emit zero values). docs/contract_pins.md changelog entry written. Nothing removed, nothing renamed.
This commit is contained in:
1 parent
962f9089e0
commit
bc91ce68d4
3 files changed
+24
-5
No files matched your search
@@ -459,6 +459,8 @@ var bookInfoKeys = []string{
|
||||
"media_item_id", "title", "author", "cover_image_path",
|
||||
"has_conflict", "format_group", "badge",
|
||||
"viewer_percentage", "library_name",
|
||||
// Episode-collections extras (2.3 widening, every surface emits):
|
||||
"is_episode", "feed_title", "download_state", "hidden",
|
||||
}
|
||||
|
||||
func collectionURL(setup *TestServerSetup, id string) string {
|
||||
@@ -500,6 +502,7 @@ func TestContractPin_CollectionsJSON(t *testing.T) {
|
||||
"id", "user_id", "name", "description", "color", "icon",
|
||||
"auto_assign_rules", "view_settings", "books", "book_count",
|
||||
"is_smart", "created_at", "up_next",
|
||||
"rule_match_mode", // item-2.4 widening (docs/contract_pins.md)
|
||||
}
|
||||
|
||||
t.Run("user collection with library_id (badged branch)", func(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user