diff --git a/src/shared/node-list-parse.test.ts b/src/shared/node-list-parse.test.ts index 9437e31118a..29bc910fcc9 100644 --- a/src/shared/node-list-parse.test.ts +++ b/src/shared/node-list-parse.test.ts @@ -23,4 +23,26 @@ describe("shared/node-list-parse", () => { expect(parsePairingList(undefined)).toEqual({ pending: [], paired: [] }); expect(parsePairingList(["not-an-object"])).toEqual({ pending: [], paired: [] }); }); + + it("preserves valid pairing arrays when the sibling field is malformed", () => { + expect( + parsePairingList({ + pending: [{ requestId: "r1", nodeId: "n1", ts: 1 }], + paired: "x", + }), + ).toEqual({ + pending: [{ requestId: "r1", nodeId: "n1", ts: 1 }], + paired: [], + }); + + expect( + parsePairingList({ + pending: 1, + paired: [{ nodeId: "n1" }], + }), + ).toEqual({ + pending: [], + paired: [{ nodeId: "n1" }], + }); + }); });