test(cli): share nodes ios fixture helpers

This commit is contained in:
Peter Steinberger
2026-02-21 21:55:57 +00:00
parent fb73c0034e
commit d6ad647f56
4 changed files with 29 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createIosNodeListResponse } from "./program.nodes-test-helpers.js";
import { callGateway, installBaseProgramMocks, runTui, runtime } from "./program.test-mocks.js";
installBaseProgramMocks();
@@ -42,17 +43,7 @@ describe("cli program (nodes basics)", () => {
callGateway.mockImplementation(async (...args: unknown[]) => {
const opts = (args[0] ?? {}) as { method?: string };
if (opts.method === "node.list") {
return {
ts: Date.now(),
nodes: [
{
nodeId: "ios-node",
displayName: "iOS Node",
remoteIp: "192.168.0.88",
connected: true,
},
],
};
return createIosNodeListResponse();
}
if (opts.method === method) {
return result;