From ccdd33545bded46756abdb76d02cdd3420ecf48b Mon Sep 17 00:00:00 2001 From: Shakker Date: Wed, 1 Apr 2026 23:20:27 +0100 Subject: [PATCH] test: narrow qr dashboard integration surfaces --- src/cli/qr-dashboard.integration.test.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/cli/qr-dashboard.integration.test.ts b/src/cli/qr-dashboard.integration.test.ts index 16616cac184..0ff060dfbf8 100644 --- a/src/cli/qr-dashboard.integration.test.ts +++ b/src/cli/qr-dashboard.integration.test.ts @@ -33,8 +33,8 @@ vi.mock("../runtime.js", () => ({ defaultRuntime: runtime, })); +let dashboardCommand: typeof import("../commands/dashboard.js").dashboardCommand; let registerQrCli: typeof import("./qr-cli.js").registerQrCli; -let registerMaintenanceCommands: typeof import("./program/register.maintenance.js").registerMaintenanceCommands; function createGatewayTokenRefFixture() { return { @@ -81,7 +81,6 @@ function decodeSetupCode(setupCode: string): { async function runCli(args: string[]): Promise { const program = new Command(); registerQrCli(program); - registerMaintenanceCommands(program); await program.parseAsync(args, { from: "user" }); } @@ -92,17 +91,16 @@ const unmockedDependencyIds = [ "../gateway/resolve-configured-secret-input-string.js", "../pairing/setup-code.js", "./command-secret-gateway.js", - "./program/register.maintenance.js", "./qr-cli.js", -]; +] as const; async function loadCliModules() { vi.resetModules(); for (const id of unmockedDependencyIds) { vi.doUnmock(id); } + ({ dashboardCommand } = await import("../commands/dashboard.js")); ({ registerQrCli } = await import("./qr-cli.js")); - ({ registerMaintenanceCommands } = await import("./program/register.maintenance.js")); } describe("cli integration: qr + dashboard token SecretRef", () => { @@ -163,7 +161,7 @@ describe("cli integration: qr + dashboard token SecretRef", () => { runtimeLogs.length = 0; runtimeErrors.length = 0; - await runCli(["dashboard", "--no-open"]); + await dashboardCommand(runtime, { noOpen: true }); const joined = runtimeLogs.join("\n"); expect(joined).toContain("Dashboard URL: http://127.0.0.1:18789/"); expect(joined).not.toContain("#token="); @@ -191,7 +189,7 @@ describe("cli integration: qr + dashboard token SecretRef", () => { runtimeLogs.length = 0; runtimeErrors.length = 0; - await runCli(["dashboard", "--no-open"]); + await dashboardCommand(runtime, { noOpen: true }); const joined = runtimeLogs.join("\n"); expect(joined).toContain("Dashboard URL: http://127.0.0.1:18789/"); expect(joined).not.toContain("#token=");