fix(connection): resolve host from entered URL

This commit is contained in:
t8y2
2026-05-21 22:49:32 +08:00
parent eef217d6eb
commit 390e244c85
2 changed files with 46 additions and 13 deletions
@@ -0,0 +1,15 @@
import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const source = readFileSync("apps/desktop/src/components/connection/ConnectionDialog.vue", "utf8");
test("connection dialog auto-resolves host from URL before test/save", () => {
assert.match(source, /function ensureConnectionHostResolvedFromUrl\(\): boolean/);
assert.match(source, /if \(!ensureConnectionHostResolvedFromUrl\(\)\) return;/);
assert.match(source, /return applyConnectionUrlToForm\(url\);/);
});
test("save button allows URL-only submissions when host is empty", () => {
assert.match(source, /&&\s*!connectionUrlInput\.trim\(\)\)/);
});