Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Align browser guards with retirement and current navigation

pulse-triage[bot]9e81bd661ed8
diff --git a/frontend-modern/browser-tests/pbs-host-history-correlation.tsx b/frontend-modern/browser-tests/pbs-host-history-correlation.tsx
index 22b50c3ead..9744b676f2 100644
--- a/frontend-modern/browser-tests/pbs-host-history-correlation.tsx
+++ b/frontend-modern/browser-tests/pbs-host-history-correlation.tsx
@@ -7,6 +7,8 @@
// Synthetic props only; the check script intercepts the metrics-history request.
import { createSignal, onCleanup } from 'solid-js';
import { render } from 'solid-js/web';
+import { Route, Router } from '@solidjs/router';
+import { DarkModeContext, WebSocketContext, type WebSocketStore } from '../src/contexts/appRuntime';
import { ProxmoxBackupServersTable } from '../src/features/proxmox/ProxmoxBackupServersTable';
import type { Resource } from '../src/types/resource';
@@ -194,4 +196,23 @@ const Fixture = () => {
);
};
-render(() => <Fixture />, document.getElementById('root') as HTMLElement);
+render(
+ () => (
+ <WebSocketContext.Provider
+ value={
+ {
+ activeAlerts: {},
+ state: { pmg: [] },
+ connected: () => false,
+ } as unknown as WebSocketStore
+ }
+ >
+ <DarkModeContext.Provider value={() => document.documentElement.classList.contains('dark')}>
+ <Router>
+ <Route path="*" component={Fixture} />
+ </Router>
+ </DarkModeContext.Provider>
+ </WebSocketContext.Provider>
+ ),
+ document.getElementById('root') as HTMLElement,
+);
diff --git a/tests/integration/tests/06-theme-visual.spec.ts b/tests/integration/tests/06-theme-visual.spec.ts
index 82ca67d5ff..12d82c8dba 100644
--- a/tests/integration/tests/06-theme-visual.spec.ts
+++ b/tests/integration/tests/06-theme-visual.spec.ts
@@ -49,6 +49,30 @@ async function stabilizeUpdateChecks(page: Page): Promise<void> {
);
}
+// The auth visual baseline includes the default organisation. Pin the
+// runtime and org inventory, not the real login/session or permission gates:
+// a preceding probation spec must not change this page's sidebar composition.
+const AUTH_VISUAL_RUNTIME_CAPABILITIES = {
+ capabilities: ["update_alerts", "sso", "ai_patrol", "multi_tenant"],
+ limits: [],
+ hosted_mode: false,
+ max_history_days: 7,
+ runtime: { build: "community", label: "Pulse Community runtime" },
+ blocked_capabilities: [],
+};
+
+async function stabilizeAuthInventory(page: Page): Promise<void> {
+ await page.addInitScript(() => {
+ localStorage.setItem("pulse_org_id", "default");
+ });
+ await page.route("**/api/license/runtime-capabilities", (route) =>
+ route.fulfill({ json: AUTH_VISUAL_RUNTIME_CAPABILITIES }),
+ );
+ await page.route("**/api/orgs", (route) =>
+ route.fulfill({ json: [{ id: "default", displayName: "default" }] }),
+ );
+}
+
async function applyThemePreference(
page: Page,
theme: ThemePreference,
@@ -174,6 +198,11 @@ async function openAuthenticatedSecurityAuth(page: Page, theme: ThemePreference)
await expect(authHeading).toBeVisible();
}
+ // Fail before pixel comparison if this is a different inventory. The
+ // screenshot threshold and baseline images remain unchanged.
+ const sidebar = page.locator('[aria-label="Settings navigation"]');
+ await expect(sidebar.getByText('Organization', { exact: true })).toBeVisible();
+ await expect(sidebar.getByText('Overview', { exact: true })).toBeVisible();
await stabilizeVisualState(page);
}
@@ -185,6 +214,7 @@ test.describe.serial('Theme visual regression (auth surfaces)', () => {
test.beforeEach(async ({ page }) => {
await stabilizeUpdateChecks(page);
+ await stabilizeAuthInventory(page);
await page.setViewportSize(VISUAL_VIEWPORT);
});
diff --git a/tests/integration/tests/11-first-session.spec.ts b/tests/integration/tests/11-first-session.spec.ts
index 45cebfe35b..454c46712b 100644
--- a/tests/integration/tests/11-first-session.spec.ts
+++ b/tests/integration/tests/11-first-session.spec.ts
@@ -270,8 +270,7 @@ test.describe.serial("First-session experience", () => {
);
// Gated routes with their required feature. Gating is feature-based, not
- // tier-based — e.g. a "relay" tier has the relay feature but not
- // advanced_reporting or audit_logging.
+ // tier-based. Pulse Mobile retirement is an all-tier notice, not a sales gate.
const gatedRoutes = [
{
route: "/settings/support/reporting",
@@ -285,12 +284,6 @@ test.describe.serial("First-session experience", () => {
feature: "audit_logging",
paywallIndicator: /Audit (Logging|Webhooks)/i,
},
- {
- route: "/settings/system-relay",
- expectedURL: /\/settings\/system-relay/,
- feature: "relay",
- paywallIndicator: /Remote Access \(Relay\)/i,
- },
] as const;
try {
@@ -388,6 +381,68 @@ test.describe.serial("First-session experience", () => {
}
});
+ test("Pulse Mobile explains retirement without selling access or exposing unlicensed pairing", async ({
+ page,
+ }) => {
+ await ensureAuthenticated(page);
+ const runtimeRes = await apiRequest(
+ page,
+ "/api/license/runtime-capabilities",
+ );
+ expect(runtimeRes.ok()).toBeTruthy();
+ const runtime = (await runtimeRes.json()) as RuntimeCapabilitiesPayload;
+ const entitlementReads = trackBrowserRequests(
+ page,
+ "/api/license/entitlements",
+ );
+ try {
+ await page.goto("/settings/system-relay", {
+ waitUntil: "domcontentloaded",
+ });
+ await expect(
+ page.getByRole("heading", { name: "Pulse Mobile" }).last(),
+ ).toBeVisible();
+ const main = page.getByRole("main");
+ await expect(main.getByText(/31 March 2027/).first()).toBeVisible();
+ await expect(
+ main.getByRole("link", { name: /Upgrade|Try Pro|Buy Relay/i }),
+ ).toHaveCount(0);
+ if (runtime.capabilities?.includes("relay")) {
+ // The paired-phone service remains usable until retirement. Do not
+ // turn it off or replace its entitlement with an unlicensed notice.
+ await expect(
+ main.getByText("Allow Pulse Mobile connections", { exact: true }),
+ ).toBeVisible();
+ await expect(
+ main.getByText("Pair Pulse Mobile", { exact: true }).first(),
+ ).toBeVisible();
+ } else {
+ await expect(
+ main.getByText(/no longer part of new plans/),
+ ).toBeVisible();
+ await expect(main.getByText(/ntfy, Gotify, or Pushover/)).toBeVisible();
+ await expect(
+ main.getByText("Allow Pulse Mobile connections", { exact: true }),
+ ).toHaveCount(0);
+ await expect(
+ main.getByRole("button", { name: /Pair|Generate.*QR/i }),
+ ).toHaveCount(0);
+ await expect(
+ main.locator(
+ 'form input:not([type="search"]), form textarea, form select',
+ ),
+ ).toHaveCount(0);
+ }
+ } finally {
+ const urls = entitlementReads.urls();
+ entitlementReads.stop();
+ expect(
+ urls,
+ "Mobile retirement must use runtime capabilities, not billing reads",
+ ).toEqual([]);
+ }
+ });
+
test("Pro license panel is discoverable from settings", async ({
page,
}, testInfo) => {
@@ -406,7 +461,9 @@ test.describe.serial("First-session experience", () => {
// content. Scope assertions to main content, not the settings sidebar.
const licenseContent = page
.getByRole("main")
- .getByText(/Current plan|Existing purchases|Use existing key|activation key/i)
+ .getByText(
+ /Current plan|Existing purchases|Use existing key|activation key/i,
+ )
.first();
await expect(
licenseContent,
diff --git a/tests/integration/tests/59-self-hosted-plans-entitlement-summary.spec.ts b/tests/integration/tests/59-self-hosted-plans-entitlement-summary.spec.ts
index 7b38da077a..2fef520e5b 100644
--- a/tests/integration/tests/59-self-hosted-plans-entitlement-summary.spec.ts
+++ b/tests/integration/tests/59-self-hosted-plans-entitlement-summary.spec.ts
@@ -289,7 +289,7 @@ test.describe('Self-hosted plans entitlement summary', () => {
'Users',
'Audit Log',
'Audit Webhooks',
- 'Remote Access',
+ 'Pulse Mobile',
]) {
await expect(settingsNav.getByText(label, { exact: true })).toBeVisible();
}
diff --git a/tests/integration/tests/90-operational-trust-protection-posture.spec.ts b/tests/integration/tests/90-operational-trust-protection-posture.spec.ts
index 441bec5757..beab0e4f2b 100644
--- a/tests/integration/tests/90-operational-trust-protection-posture.spec.ts
+++ b/tests/integration/tests/90-operational-trust-protection-posture.spec.ts
@@ -37,9 +37,16 @@ test.describe("Operational trust protection posture", () => {
await page.setViewportSize(DESKTOP_VIEWPORT);
await ensureAuthenticated(page);
await openDesktopProxmoxBackups(page);
- const coverageButton = page.getByRole("button", { name: "Coverage" });
- await expect(coverageButton).toBeVisible({ timeout: 60_000 });
- await coverageButton.click();
+ const coverageLink = page
+ .getByRole("navigation", { name: "Backup views" })
+ .getByRole("link", { name: "Coverage", exact: true });
+ await expect(coverageLink).toBeVisible({ timeout: 60_000 });
+ await expect(coverageLink).toHaveAttribute(
+ "href",
+ "/proxmox/backups/coverage",
+ );
+ await coverageLink.click();
+ await expect(page).toHaveURL(/\/proxmox\/backups\/coverage$/);
const coverageTable = page
.locator("div.overflow-x-auto")
@@ -82,9 +89,16 @@ test.describe("Operational trust protection posture", () => {
await ensureAuthenticated(page);
await page.goto("/proxmox/backups", { waitUntil: "domcontentloaded" });
- const coverageButton = page.getByRole("button", { name: "Coverage" });
- await expect(coverageButton).toBeVisible({ timeout: 60_000 });
- await coverageButton.click();
+ const coverageLink = page
+ .getByRole("navigation", { name: "Backup views" })
+ .getByRole("link", { name: "Coverage", exact: true });
+ await expect(coverageLink).toBeVisible({ timeout: 60_000 });
+ await expect(coverageLink).toHaveAttribute(
+ "href",
+ "/proxmox/backups/coverage",
+ );
+ await coverageLink.click();
+ await expect(page).toHaveURL(/\/proxmox\/backups\/coverage$/);
await expect(page.locator('th:has-text("Posture")').first()).toBeVisible();
const viewport = await page.evaluate(() => ({
diff --git a/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts b/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts
index dd374fec6f..a58aa0fe06 100644
--- a/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts
+++ b/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts
@@ -684,7 +684,7 @@ test("starts from the normal monitor shell and reaches the canonical attention q
page.getByRole("region", { name: "Patrol decision inbox" }),
).toBeVisible();
await expect(
- page.getByRole("button", { name: "Open CPU pressure on pve-main" }),
+ page.getByRole("button", { name: "Open pve-main · CPU pressure" }),
).toBeVisible();
await expect(
page.getByRole("tab", { name: "Inbox", exact: true }),
@@ -752,13 +752,13 @@ test("makes active operational work primary and preserves the evidence boundary"
).toHaveCount(0);
const itemButton = queue.getByRole("button", {
- name: "Open CPU pressure on pve-main",
+ name: "Open pve-main · CPU pressure",
});
await itemButton.focus();
await page.keyboard.press("Enter");
const detailPanel = page.getByRole("complementary", {
- name: "CPU pressure on pve-main",
+ name: "pve-main · CPU pressure",
});
await expect(detailPanel).toBeVisible();
await expect(
@@ -799,7 +799,7 @@ test("makes active operational work primary and preserves the evidence boundary"
).toBeVisible();
await expect(
attentionList.getByRole("button", {
- name: "Open CPU pressure on pve-main",
+ name: "Open pve-main · CPU pressure",
}),
).toHaveCount(0);
@@ -828,12 +828,12 @@ test("puts the selected detail in view on a phone without page overflow", async
await page.goto("/patrol", { waitUntil: "domcontentloaded" });
const itemButton = page.getByRole("button", {
- name: "Open CPU pressure on pve-main",
+ name: "Open pve-main · CPU pressure",
});
await itemButton.click();
const detailPanel = page.getByRole("complementary", {
- name: "CPU pressure on pve-main",
+ name: "pve-main · CPU pressure",
});
await expect(detailPanel).toBeInViewport();
await expect(itemButton).toBeHidden();