From ac1a4700286da627e4be64145e535f733f736345 Mon Sep 17 00:00:00 2001 From: xuans Date: Sat, 26 Sep 2026 13:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85SSH=E5=BC=95=E5=AF=BC?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E8=81=94=E5=8A=A8=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加服务器配置地址与用户驱动SSH引导命令的回归测试,覆盖Windows和Linux命令。 --- frontend/src/views/Dashboard/Dashboard.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/src/views/Dashboard/Dashboard.test.js b/frontend/src/views/Dashboard/Dashboard.test.js index 9aa1114..740200a 100644 --- a/frontend/src/views/Dashboard/Dashboard.test.js +++ b/frontend/src/views/Dashboard/Dashboard.test.js @@ -151,6 +151,19 @@ test("编辑服务器正确保留已有密码状态,新建和未配置密码 assert.equal(state.serverEditingId.value, ""); }); +test("SSH引导目标直接跟随服务器配置中的地址和用户", async (t) => { + const { state } = await setup(t, () => verifiedResponse()); + state.openServerCreate(); + state.serverForm.value.username = "root"; + state.serverForm.value.address = "45.136.13.241"; + await nextTick(); + + assert.equal(state.sshKeyCommandUsername.value, "root"); + assert.equal(state.sshKeyCommandHost.value, "45.136.13.241"); + assert.match(state.sshPublicKeyCommands.value.windows, /ssh root@45\.136\.13\.241/); + assert.match(state.sshPublicKeyCommands.value.linux, /root@45\.136\.13\.241/); +}); + async function fill(state) { state.settingsForm.value.dns.credentials = { access_key_id: "fake-key" }; state.settingsForm.value.dns.test_domain = "example.test";