test(desktop): make omission-preservation test discriminate on instructions (#1988)

Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Will Pfleger
2026-07-16 15:27:41 -04:00
committed by GitHub
parent 1e91fd473b
commit 2b015cb5dc

View File

@@ -468,6 +468,10 @@ fn inbound_team_omitted_fields_preserve_local() {
// Sietch Tabr wipe: an old-shaped (or genuinely field-omitting) event
// must not blank out a team that has real membership/instructions.
let mut teams = vec![local_team()];
// Give local_team real instructions so preservation is discriminating:
// the pre-fix blind-overwrite bug would collapse this to `None`, while
// the fix must leave it untouched on an omitted field.
teams[0].instructions = Some("local instructions".to_string());
apply_inbound_team(
&mut teams,
TEAM_ID.to_string(),
@@ -481,8 +485,9 @@ fn inbound_team_omitted_fields_preserve_local() {
"shared non-optional field still overwrites"
);
assert_eq!(
t.instructions, None,
"local had no instructions; omission preserves that (no-op)"
t.instructions,
Some("local instructions".to_string()),
"omitted instructions preserves local value rather than wiping it"
);
assert_eq!(
t.persona_ids,