From e48d659bceecd23263c6e7ffc060e535f717ca63 Mon Sep 17 00:00:00 2001 From: funman300 Date: Sun, 23 Aug 2026 23:08:24 +0000 Subject: [PATCH] host: fix stale test that still asserted equippables was withheld MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit d146f9c flipped `club?type=equippables` from withheld to answering the KIT family — the change that made kits render in My Club, operator-confirmed — but it only touched src/lib.rs. `withheld_club_type_arms_are_empty_with_a_recorded_reason` still listed that arm, so the suite asserted the exact behaviour the fix removed. It failed on `cargo test --workspace`; the "1241 passed" figure carried in the notes was measured before the flip and was stale. Drops the arm from the withheld table and adds a test for what actually ships: the tab answers, serves exactly the kit family with cardsubtypeid 9, and returns the same body as `?type=kit`, so the two tabs cannot drift apart. `OPENFUT_FIFA17_EQUIPPABLES=0` is deliberately not exercised: it is read through a OnceLock, so flipping the process-wide env in one test would leak into every other test in the binary. --- openfut-utas-host/tests/host_test.rs | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/openfut-utas-host/tests/host_test.rs b/openfut-utas-host/tests/host_test.rs index 7bb3cfc..e18844f 100644 --- a/openfut-utas-host/tests/host_test.rs +++ b/openfut-utas-host/tests/host_test.rs @@ -2230,7 +2230,6 @@ fn position_tabs_serve_only_their_own_position_group() { #[test] fn withheld_club_type_arms_are_empty_with_a_recorded_reason() { for (query, reason) in [ - ("type=equippables", "multi_family_crash_2026_08_05"), ("type=leaguelogos", "subtype_by_elimination_unprobed"), ("type=healing", "served_by_club_consumables_route"), ("type=contract", "served_by_club_consumables_route"), @@ -2254,6 +2253,35 @@ fn withheld_club_type_arms_are_empty_with_a_recorded_reason() { } } +/// `?type=equippables` is the family the MY CLUB kit tab actually asks for, and it +/// answers with the KIT family only. Withholding it WAS the "0 kits in my club" +/// symptom — the tab asked, got the withheld empty body, and drew nothing. Serving +/// it is operator-confirmed on the retail client. +/// +/// Kits only, deliberately: the 2026-08-05 crash was 30 items across five families +/// at once, and nothing has retested that shape. +/// +/// NOT exercised here: `OPENFUT_FIFA17_EQUIPPABLES=0`, which restores the withheld +/// body. It is read through a `OnceLock`, so flipping the process-wide env inside +/// one test would leak into every other test sharing this binary. +#[test] +fn equippables_serves_the_kit_family_because_that_is_the_my_club_kit_tab() { + let (items, _, outcome) = club_query("type=equippables"); + assert_eq!(outcome, "ok"); + assert_eq!(items.len(), 2, "the fixture club owns exactly two kits"); + for it in &items { + assert_eq!(it["itemType"], "kit"); + assert_eq!( + it["cardsubtypeid"], 9, + "kits only: mixing families is the shape that crashed the client" + ); + } + + // The two tabs are the same question, so they must never diverge. + let (kits, _, _) = club_query("type=kit"); + assert_eq!(items, kits, "equippables and kit must serve one body"); +} + /// The three club-customisation families Core can own are MAPPED (so the arm asks /// Core for the right rows) but their item record is still withheld, so the answer /// is an empty list rather than a guessed record — and never another family's.