fix: prevent onboarding TUI auto-delivery (#791) (thanks @roshanasingh4)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it, vi, beforeEach } from "vitest";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { dashboardCommand } from "./dashboard.js";
|
||||
|
||||
@@ -94,7 +94,10 @@ describe("dashboardCommand", () => {
|
||||
it("prints SSH hint when browser cannot open", async () => {
|
||||
mockSnapshot("shhhh");
|
||||
mocks.copyToClipboard.mockResolvedValue(false);
|
||||
mocks.detectBrowserOpenSupport.mockResolvedValue({ ok: false, reason: "ssh" });
|
||||
mocks.detectBrowserOpenSupport.mockResolvedValue({
|
||||
ok: false,
|
||||
reason: "ssh",
|
||||
});
|
||||
mocks.formatControlUiSshHint.mockReturnValue("ssh hint");
|
||||
|
||||
await dashboardCommand(runtime);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { resolveGatewayPort, readConfigFileSnapshot } from "../config/config.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import {
|
||||
readConfigFileSnapshot,
|
||||
resolveGatewayPort,
|
||||
} from "../config/config.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import {
|
||||
copyToClipboard,
|
||||
detectBrowserOpenSupport,
|
||||
@@ -33,7 +36,9 @@ export async function dashboardCommand(
|
||||
runtime.log(`Dashboard URL: ${authedUrl}`);
|
||||
|
||||
const copied = await copyToClipboard(authedUrl).catch(() => false);
|
||||
runtime.log(copied ? "Copied to clipboard." : "Copy to clipboard unavailable.");
|
||||
runtime.log(
|
||||
copied ? "Copied to clipboard." : "Copy to clipboard unavailable.",
|
||||
);
|
||||
|
||||
let opened = false;
|
||||
let hint: string | undefined;
|
||||
|
||||
Reference in New Issue
Block a user