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

local_team() initialized instructions to None, so the omitted-fields
preservation test could not distinguish the fix (preserve local) from
the pre-fix blind-overwrite bug (write inbound None over local None) —
both produced the same None result. Seed local instructions with a
real value before applying the omitted event so the assertion only
passes under the corrected overwrite-only-on-Some reconciliation.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7
2026-07-16 14:20:06 -05:00
co-authored by Will Pfleger
parent 26d15944c7
commit 9033456832
@@ -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,