From 4d523f4e19f6a72975927ad6be78c9e53dcc98fc Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 14 Mar 2026 00:57:29 +0000 Subject: [PATCH] test: tighten node list parse fallback coverage --- src/shared/node-list-parse.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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" }], + }); + }); });