test: coverage for newly extracted pure helpers; document Process/Widget manual verification boundary (#48)

- The new helpers from #43 are now under test
- Added explicit comment explaining that full lifecycle + timing + QML behavior remains manual verification only (no QML test runner exists)

Written by AI agent working for @jtmorris. Model: Grok build-0.1.
This commit is contained in:
Vybe (Coding Agent) 2026-05-22 06:33:40 +00:00
parent 440e954099
commit b10503f4d5

View file

@ -3,6 +3,19 @@ import assert from "node:assert"
import lib from "../tailscalectl/lib.js" import lib from "../tailscalectl/lib.js"
const { parsePeers, makeExitNodeCommand, findActiveExitNode, errorMessage, validateClipboardTool, buildCopyCommand, nextClipboardTool, allClipboardTools, buildToggleCommand, parseStatusResult, getStrings, shouldShowClearExitNode, isActiveExitNode } = lib const { parsePeers, makeExitNodeCommand, findActiveExitNode, errorMessage, validateClipboardTool, buildCopyCommand, nextClipboardTool, allClipboardTools, buildToggleCommand, parseStatusResult, getStrings, shouldShowClearExitNode, isActiveExitNode } = lib
/*
* Test coverage note for #48:
* All pure functions exported from lib.js (including the newly extracted
* getStrings, shouldShowClearExitNode, isActiveExitNode, and the clipboard
* helpers) are exercised here via node:test.
*
* The four Process objects, 5-second Timer, onExited handlers, copy fallback
* state machine, and overall widget behavior in TailscaleWidget.qml have no
* automated test coverage. There is no QML test runner in this project.
* Those paths are verified manually (see verification checklist in the
* feature branch commits).
*/
test("parsePeers extracts exitNode from ExitNodeOption", () => { test("parsePeers extracts exitNode from ExitNodeOption", () => {
const peerMap = { const peerMap = {
"peer-1": { "peer-1": {