test(shared): cover null-valued entry in deserializePhantoms

Adds a null-valued entry under a valid square key (d3) to the
'keeps valid entries and drops invalid ones' fixture, proving the
typeof/null guard branch in deserializePhantoms is exercised.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
claude (blind_chess)
2026-05-18 20:23:17 -04:00
parent a574100e25
commit 2ae2c8013c
+1
View File
@@ -32,6 +32,7 @@ describe('deserializePhantoms', () => {
zz: { color: 'b', type: 'p' }, // invalid square zz: { color: 'b', type: 'p' }, // invalid square
a1: { color: 'x', type: 'p' }, // invalid colour a1: { color: 'x', type: 'p' }, // invalid colour
b2: { color: 'b', type: 'z' }, // invalid type b2: { color: 'b', type: 'z' }, // invalid type
d3: null, // valid square, null value
}); });
expect(deserializePhantoms(raw)).toEqual({ e5: { color: 'b', type: 'n' } }); expect(deserializePhantoms(raw)).toEqual({ e5: { color: 'b', type: 'n' } });
}); });