From 6b40a52add4469b0dfb39d9777d2474ecce75093 Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Sun, 6 Sep 2026 08:26:14 +0100 Subject: [PATCH] test(truenas): supply API key owner in setup journeys The setup fixtures omitted the owner identity required by supported API-key authentication, so they stopped at local validation rather than exercising test, preview, save and capacity denial. Supply the owner and assert it reaches test and create payloads; retain a browser assertion that a missing owner sends no test request. Validation: reproduced both original Chromium failures and inspected the missing-owner screenshot; corrected spec passes 3/3 with no retries using pulse-heavy-run. Focused TrueNAS state tests pass 36/36 and E2E tier selection passes. No runtime or tier changes. Change-source: pulse-maintainer --- .../21-truenas-connections-workspace.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/integration/tests/21-truenas-connections-workspace.spec.ts b/tests/integration/tests/21-truenas-connections-workspace.spec.ts index 56afd9300..23ce6e0fa 100644 --- a/tests/integration/tests/21-truenas-connections-workspace.spec.ts +++ b/tests/integration/tests/21-truenas-connections-workspace.spec.ts @@ -269,11 +269,25 @@ test.describe("TrueNAS connections in the consolidated workspace", () => { .getByRole("textbox", { name: "API key", exact: true }) .fill("secret-api-key"); + // Missing key ownership must fail locally, not send an unusable credential. + await dialog.getByRole("button", { name: "Test connection" }).click(); + await expect( + page.getByText( + "TrueNAS API key owner username is required for supported authentication", + { exact: true }, + ), + ).toBeVisible(); + expect(draftTestPayload).toBeNull(); + + await dialog + .getByRole("textbox", { name: /^API key owner username/ }) + .fill("pulse-monitor"); await dialog.getByRole("button", { name: "Test connection" }).click(); await expect.poll(() => draftTestPayload).not.toBeNull(); expect(draftTestPayload).toMatchObject({ host: "tower.local", apiKey: "secret-api-key", + username: "pulse-monitor", }); await dialog.getByRole("button", { name: "Preview impact" }).click(); @@ -290,6 +304,7 @@ test.describe("TrueNAS connections in the consolidated workspace", () => { name: "Tower NAS", host: "tower.local", apiKey: "secret-api-key", + username: "pulse-monitor", useHttps: true, enabled: true, }); @@ -352,6 +367,9 @@ test.describe("TrueNAS connections in the consolidated workspace", () => { .getByRole("textbox", { name: "API key", exact: true }) .fill("secret-api-key"); + await dialog + .getByRole("textbox", { name: /^API key owner username/ }) + .fill("pulse-monitor"); await dialog.getByRole("button", { name: "Add connection" }).click(); // The rejection surfaces the server's monitored-system explanation as an