From 12ef07040c6588d5eba05fe23efad18142bc5818 Mon Sep 17 00:00:00 2001 From: vybe Date: Fri, 22 May 2026 21:47:41 +0000 Subject: [PATCH] Code formatting cleanup. --- tailscalectl/lib.js | 4 ++-- test/lib.test.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tailscalectl/lib.js b/tailscalectl/lib.js index 6d28fe8..2879eac 100644 --- a/tailscalectl/lib.js +++ b/tailscalectl/lib.js @@ -59,8 +59,8 @@ function getStrings() { } } - // Light UI predicates — keep the view thin. - function shouldShowClearExitNode(currentExitNode) { +// Light UI predicates — keep the view thin. +function shouldShowClearExitNode(currentExitNode) { return currentExitNode !== "" } diff --git a/test/lib.test.js b/test/lib.test.js index 8d3c0f0..c5ab20b 100644 --- a/test/lib.test.js +++ b/test/lib.test.js @@ -85,7 +85,7 @@ test("errorMessage returns generic message for unknown command", () => { assert.strictEqual(msg, "Tailscale command failed") }) -// --- getClipboardCommands (simple array, argv only, per #48 first-principles) --- +// --- getClipboardCommands --- test("getClipboardCommands returns ordered argv arrays with text appended", () => { const cmds = getClipboardCommands("1.2.3.4") @@ -108,7 +108,7 @@ test("getClipboardCommands is deterministic and open for future tools", () => { assert.ok(Array.isArray(cmds[1])) }) -// --- getStrings (for #34 i18n prep) --- +// --- getStrings --- test("getStrings returns canonical UI strings for the widget", () => { const s = getStrings() @@ -196,7 +196,7 @@ test("parseStatusResult sets isConnected false for non-Running BackendState", () assert.strictEqual(state.isConnected, false) }) -// --- formatError (central error + detail formatting per first-principles plan) --- +// --- formatError (central error + detail formatting) --- test("formatError returns base message without detail", () => { assert.strictEqual(formatError("status"), "Failed to read Tailscale status") @@ -216,7 +216,7 @@ test("formatError handles empty or falsy detail gracefully", () => { assert.strictEqual(formatError("connect", null), "Failed to connect to Tailscale") }) -// --- isValidExitNodeHostname + makeExitNodeCommand safety (balanced paranoia, direct-argv defense-in-depth) --- +// --- isValidExitNodeHostname + makeExitNodeCommand safety --- test("isValidExitNodeHostname accepts empty string (clear)", () => { assert.strictEqual(isValidExitNodeHostname(""), true) @@ -244,7 +244,7 @@ test("makeExitNodeCommand still produces correct argv for valid input", () => { assert.deepStrictEqual(makeExitNodeCommand("gluetun-sjc"), ["tailscale", "set", "--exit-node=gluetun-sjc"]) }) -// --- getStatusCommand (new pure helper for low-duty-cycle architecture) --- +// --- getStatusCommand --- test("getStatusCommand returns the canonical tailscale status --json argv", () => { const cmd = getStatusCommand()