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:
@@ -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' } });
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user