test: tighten shared metadata and node resolve coverage

This commit is contained in:
Peter Steinberger
2026-03-13 21:39:11 +00:00
parent 4ecdd7907a
commit 56299effe9
2 changed files with 28 additions and 0 deletions

View File

@@ -20,6 +20,18 @@ describe("shared/node-resolve", () => {
).toBe("mac-123");
});
it("passes the original node list to the default picker", () => {
expect(
resolveNodeIdFromNodeList(nodes, "", {
allowDefault: true,
pickDefaultNode: (entries) => {
expect(entries).toBe(nodes);
return entries[1] ?? null;
},
}),
).toBe("pi-456");
});
it("still throws when default selection is disabled or returns null", () => {
expect(() => resolveNodeIdFromNodeList(nodes, " ")).toThrow(/node required/);
expect(() =>