diff --git a/src/cli/nodes-cli/register.status.ts b/src/cli/nodes-cli/register.status.ts index 011b99b24f30..8ed283223fc2 100644 --- a/src/cli/nodes-cli/register.status.ts +++ b/src/cli/nodes-cli/register.status.ts @@ -560,7 +560,9 @@ export function registerNodesStatusCommands(nodes: Command) { return true; }); const filteredLabel = - hasFilters && filteredPaired.length !== paired.length ? ` (of ${paired.length})` : ""; + hasFilters && filteredPaired.length !== effectivePairedRows.length + ? ` (of ${effectivePairedRows.length})` + : ""; if (opts.json) { defaultRuntime.writeJson({ pending: pendingRows, diff --git a/src/cli/program.nodes-basic.e2e.test.ts b/src/cli/program.nodes-basic.e2e.test.ts index 1a1cb8a74dbe..7fdcf7ac20b5 100644 --- a/src/cli/program.nodes-basic.e2e.test.ts +++ b/src/cli/program.nodes-basic.e2e.test.ts @@ -325,6 +325,39 @@ describe("cli program (nodes basics)", () => { expect(output).not.toContain("Two"); }); + it("counts catalog-only paired nodes in the filtered list total", async () => { + callGateway.mockImplementation(async (...args: unknown[]) => { + const opts = (args[0] ?? {}) as { method?: string }; + if (opts.method === "node.pair.list") { + return { + pending: [], + paired: [{ nodeId: "paired-store", displayName: "Paired Store" }], + }; + } + if (opts.method === "node.list") { + return { + nodes: [ + { nodeId: "paired-store", connected: true }, + { + nodeId: "catalog-only", + displayName: "Catalog Only", + paired: true, + connected: true, + }, + ], + }; + } + return { ok: true }; + }); + + await runProgram(["nodes", "list", "--connected"]); + + const output = getRuntimeOutput(); + expect(output).toMatch(/^Pending: 0 ยท Paired: 2$/m); + expect(output).toContain("Paired Store"); + expect(output).toContain("Catalog Only"); + }); + it("runs nodes status --last-connected and filters by age", async () => { const now = Date.now(); callGateway.mockImplementation(async (...args: unknown[]) => {