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.

Explain guest safety at the Proxmox collection controls

pulse-triage[bot]30455a2c3492
diff --git a/frontend-modern/browser-tests/proxmox-collection-safety.cjs b/frontend-modern/browser-tests/proxmox-collection-safety.cjs
new file mode 100644
index 0000000000..04ed3426c2
--- /dev/null
+++ b/frontend-modern/browser-tests/proxmox-collection-safety.cjs
@@ -0,0 +1,243 @@
+// Source-bound offline consumer checks; no live connection test or guest request.
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const path = require('node:path');
+const crypto = require('node:crypto');
+const { chromium, webkit } = require('playwright');
+
+(async () => {
+ const root = '/workspace/frontend-modern';
+ const artifacts = '/workspace/tmp/collection-browser';
+ fs.mkdirSync(artifacts, { recursive: true });
+ const inputs = [
+ 'frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx',
+ 'frontend-modern/src/components/Settings/useNodeModalState.ts',
+ 'frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx',
+ 'frontend-modern/src/utils/nodeModalPresentation.ts',
+ 'frontend-modern/src/components/shared/InlineNotice.tsx',
+ 'frontend-modern/src/index.css',
+ 'frontend-modern/package.json',
+ 'frontend-modern/package-lock.json',
+ 'frontend-modern/browser-tests/proxmox-collection-safety.tsx',
+ 'frontend-modern/browser-tests/proxmox-collection-safety.html',
+ 'frontend-modern/browser-tests/proxmox-collection-safety.cjs',
+ ];
+ const hash = (raw) => crypto.createHash('sha256').update(raw).digest('hex');
+ const inputHashes = Object.fromEntries(
+ inputs.map((file) => [file, hash(fs.readFileSync(path.join('/workspace', file)))]),
+ );
+ const { createServer } = await import(path.join(root, 'node_modules/vite/dist/node/index.js'));
+ const server = await createServer({
+ root,
+ configFile: path.join(root, 'vite.config.ts'),
+ server: { host: '127.0.0.1', port: 5243, strictPort: true },
+ });
+ const cases = [];
+ const result = {
+ parent: 'd549d1b5d2c66bad4dab8973f5e9c0efa0b9b8e2',
+ inputHashes,
+ playwright: require('playwright/package.json').version,
+ graph: {
+ solid: JSON.parse(fs.readFileSync(path.join(root, 'node_modules/solid-js/package.json')))
+ .version,
+ seroval: JSON.parse(fs.readFileSync(path.join(root, 'node_modules/seroval/package.json')))
+ .version,
+ },
+ cases,
+ };
+ let browser;
+ try {
+ await server.listen();
+ for (const engine of ['chromium', 'webkit']) {
+ browser = await { chromium, webkit }[engine].launch(
+ engine === 'chromium'
+ ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] }
+ : { headless: true },
+ );
+ const phone = engine === 'webkit';
+ const viewport = phone ? { width: 390, height: 844 } : { width: 1280, height: 900 };
+ for (const type of ['pve', 'pbs', 'pmg']) {
+ const page = await browser.newPage({
+ viewport,
+ ...(phone ? { isMobile: true, hasTouch: true } : {}),
+ });
+ const errors = [];
+ const requests = [];
+ const row = {
+ engine,
+ type,
+ viewport,
+ phase: 'initial-render',
+ errors,
+ requests,
+ consoleErrors: [],
+ };
+ cases.push(row);
+ page.on('console', (message) => {
+ if (message.type() === 'error') row.consoleErrors.push(message.text());
+ });
+ page.on('pageerror', (error) => errors.push(error.message));
+ await page.route('**/api/**', async (route) => {
+ // Vite also serves /src/api/*.ts modules; those are source, not live APIs.
+ if (!new URL(route.request().url()).pathname.startsWith('/api/')) return route.continue();
+ requests.push({
+ method: route.request().method(),
+ path: new URL(route.request().url()).pathname,
+ });
+ await route.abort();
+ });
+ await page.goto(
+ `http://127.0.0.1:5243/browser-tests/proxmox-collection-safety.html?type=${type}`,
+ );
+ await page
+ .getByRole('heading', { name: `Edit ${type.toUpperCase()} connection` })
+ .waitFor()
+ .catch(async (error) => {
+ row.body = await page
+ .locator('body')
+ .innerText()
+ .catch(() => 'unavailable');
+ row.failureCapture = `${engine}-${type}-failure.png`;
+ await page.screenshot({
+ path: path.join(artifacts, row.failureCapture),
+ fullPage: true,
+ });
+ throw error;
+ });
+ if (phone) await page.evaluate(() => document.documentElement.classList.add('dark'));
+ const ssl = page.getByRole('checkbox', { name: 'Verify SSL certificate', exact: true });
+ assert.equal(await ssl.isChecked(), true);
+ const precaution = page.getByRole('note', {
+ name: 'Guest-agent backup precaution',
+ exact: true,
+ });
+ const scope =
+ type === 'pve'
+ ? page.getByRole('region', { name: 'Collection scope', exact: true })
+ : page.locator('div.space-y-3').filter({
+ has: page.getByRole('heading', { name: 'Collection scope', exact: true }),
+ });
+ assert.equal(await scope.count(), 1);
+ if (type === 'pve') {
+ await precaution.waitFor();
+ const text = await scope.innerText();
+ for (const sentence of [
+ 'Guest details depend on guest-agent availability and permissions.',
+ 'Some readings can be unavailable or temporarily deferred.',
+ 'stop Pulse monitoring and leave it stopped',
+ 'independent checks confirm thaw and writes to every filesystem covered by the backup',
+ 'Do not run live diagnostics or restart the guest agent during the incident.',
+ 'An OK backup or a running VM does not prove recovery.',
+ ])
+ assert.ok(text.includes(sentence), sentence);
+ assert.ok(!text.includes('full visibility without extra configuration'));
+ } else {
+ assert.equal(await precaution.count(), 0);
+ assert.ok(!(await scope.innerText()).includes('guest-agent reads'));
+ }
+ const label =
+ type === 'pve'
+ ? /^Virtual machines/
+ : type === 'pbs'
+ ? /^Datastores/
+ : /^Queue health insights/;
+ const collector = page.getByRole('checkbox', { name: label });
+ assert.equal(await collector.isChecked(), true);
+ if (phone) await collector.tap();
+ else {
+ await collector.focus();
+ await page.keyboard.press('Space');
+ }
+ assert.equal(await collector.isChecked(), false);
+ const geometry = await scope.evaluate((node) => {
+ const rect = node.getBoundingClientRect();
+ return {
+ x: rect.x,
+ right: rect.right,
+ width: rect.width,
+ scrollWidth: document.documentElement.scrollWidth,
+ viewportWidth: innerWidth,
+ };
+ });
+ assert.ok(geometry.x >= 0 && geometry.right <= viewport.width + 1, 'scope fits viewport');
+ assert.ok(
+ geometry.scrollWidth <= geometry.viewportWidth + 1,
+ 'no horizontal page overflow',
+ );
+ const capture = path.join(artifacts, `${engine}-${type}-collection.png`);
+ await scope.screenshot({ path: capture });
+ await page.getByRole('button', { name: 'Save changes', exact: true }).click();
+ await page.waitForFunction(
+ () => document.querySelector('[data-testid="save-finished"]').textContent === 'true',
+ );
+ const saved = JSON.parse(await page.getByTestId('save-result').innerText());
+ assert.equal(saved.targetId, `${type}-fixture`, 'save keeps the existing edit target');
+ assert.equal(saved.data.type, type);
+ assert.equal(saved.data.verifySSL, true);
+ assert.ok(
+ !('tokenValue' in saved.data) && !('password' in saved.data),
+ 'existing credential is not replaced',
+ );
+ if (type === 'pve') {
+ assert.equal(saved.data.monitorVMs, false);
+ for (const key of ['monitorContainers', 'monitorStorage', 'monitorBackups'])
+ assert.equal(saved.data[key], true);
+ assert.equal(saved.data.monitorPhysicalDisks, false);
+ assert.equal(
+ await precaution.isVisible(),
+ true,
+ 'collector choice is not recovery evidence',
+ );
+ } else if (type === 'pbs') {
+ assert.equal(saved.data.monitorDatastores, false);
+ assert.equal(saved.data.monitorSyncJobs, true);
+ } else {
+ assert.equal(saved.data.monitorQueues, false);
+ assert.equal(saved.data.monitorMailStats, true);
+ }
+ await page.waitForTimeout(200);
+ assert.deepEqual(requests, [], 'no probe, token, collector, or other API request');
+ assert.deepEqual(errors, [], 'no page exceptions');
+ const bytes = fs.readFileSync(capture);
+ Object.assign(row, {
+ phase: 'complete',
+ engine,
+ browser: browser.version(),
+ viewport,
+ type,
+ theme: phone ? 'dark' : 'light',
+ geometry,
+ saved,
+ requests,
+ errors,
+ capture: path.basename(capture),
+ bytes: bytes.length,
+ sha256: hash(bytes),
+ passed: true,
+ });
+ await page.close();
+ }
+ await browser.close();
+ browser = null;
+ }
+ result.passed = true;
+ } catch (error) {
+ result.passed = false;
+ result.error = error.stack;
+ throw error;
+ } finally {
+ fs.writeFileSync(path.join(artifacts, 'result.json'), JSON.stringify(result, null, 2) + '\n');
+ if (browser) await browser.close();
+ await server.close();
+ console.log(
+ JSON.stringify({
+ result: '/workspace/tmp/collection-browser/result.json',
+ passed: result.passed,
+ cases: cases.length,
+ }),
+ );
+ }
+})().catch((error) => {
+ console.error(error);
+ process.exitCode = 1;
+});
diff --git a/frontend-modern/browser-tests/proxmox-collection-safety.html b/frontend-modern/browser-tests/proxmox-collection-safety.html
new file mode 100644
index 0000000000..a6f41da7b6
--- /dev/null
+++ b/frontend-modern/browser-tests/proxmox-collection-safety.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Proxmox collection safety fixture</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="./proxmox-collection-safety.tsx"></script>
+ </body>
+</html>
diff --git a/frontend-modern/browser-tests/proxmox-collection-safety.tsx b/frontend-modern/browser-tests/proxmox-collection-safety.tsx
new file mode 100644
index 0000000000..d8610aab12
--- /dev/null
+++ b/frontend-modern/browser-tests/proxmox-collection-safety.tsx
@@ -0,0 +1,67 @@
+// Exercise the actual connection editor and save payload without a live host.
+import { createSignal } from 'solid-js';
+import { render } from 'solid-js/web';
+import { NodeCredentialSlot } from '../src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot';
+import type { InfrastructurePlatformSettingsProps } from '../src/components/Settings/proxmoxSettingsModel';
+import type { NodeConfigWithStatus } from '../src/types/nodes';
+import '../src/index.css';
+
+function Fixture() {
+ const requestedType = new URLSearchParams(location.search).get('type');
+ const type = requestedType === 'pbs' || requestedType === 'pmg' ? requestedType : 'pve';
+ const [saved, setSaved] = createSignal<unknown>(null);
+ const [finished, setFinished] = createSignal(false);
+ const source = {
+ id: `${type}-fixture`,
+ type,
+ name: `Fixture ${type.toUpperCase()}`,
+ host: `https://${type}.example.invalid:${type === 'pbs' ? 8007 : 8006}`,
+ user: 'monitoring@pam',
+ tokenName: 'monitoring@pam!fixture',
+ hasToken: true,
+ verifySSL: true,
+ monitorVMs: true,
+ monitorContainers: true,
+ monitorStorage: true,
+ monitorBackups: true,
+ monitorPhysicalDisks: false,
+ monitorDatastores: true,
+ monitorSyncJobs: true,
+ monitorVerifyJobs: true,
+ monitorPruneJobs: true,
+ monitorGarbageJobs: true,
+ excludeDatastores: [],
+ monitorMailStats: true,
+ monitorQueues: true,
+ monitorQuarantine: true,
+ monitorDomainStats: true,
+ status: 'connected',
+ } as NodeConfigWithStatus;
+ const settings = {
+ securityStatus: () => null,
+ resolveTemperatureMonitoringEnabled: () => false,
+ temperatureMonitoringLocked: () => false,
+ savingTemperatureSetting: () => false,
+ handleNodeTemperatureMonitoringChange: async () => {},
+ handleTemperatureMonitoringChange: async () => {},
+ saveNode: async (data, target) => {
+ setSaved({ data, targetId: target?.id });
+ return true;
+ },
+ } as InfrastructurePlatformSettingsProps;
+ return (
+ <main class="mx-auto max-w-3xl bg-base p-4 text-base-content">
+ <h1 class="mb-4 text-lg font-semibold">Edit {type.toUpperCase()} connection</h1>
+ <NodeCredentialSlot
+ nodeType={type}
+ editingNode={source}
+ settings={settings}
+ onCancel={() => {}}
+ onSaved={() => setFinished(true)}
+ />
+ <output data-testid="save-result">{JSON.stringify(saved())}</output>
+ <output data-testid="save-finished">{String(finished())}</output>
+ </main>
+ );
+}
+render(() => <Fixture />, document.getElementById('root')!);
diff --git a/frontend-modern/browser-verification/885f8763aba5c983.json b/frontend-modern/browser-verification/885f8763aba5c983.json
new file mode 100644
index 0000000000..32735e1bac
--- /dev/null
+++ b/frontend-modern/browser-verification/885f8763aba5c983.json
@@ -0,0 +1,83 @@
+{
+ "version": 1,
+ "base_sha": "d549d1b5d2c66bad4dab8973f5e9c0efa0b9b8e2",
+ "verified_at": "2026-10-14T05:11:51.641541Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx": "b31159e78891a319de5cceccfc5039c9b4c0e8afda21774616c3e0ab5d5f99e6"
+ },
+ "routes": [
+ "/browser-tests/proxmox-collection-safety.html?type=pve",
+ "/browser-tests/proxmox-collection-safety.html?type=pbs",
+ "/browser-tests/proxmox-collection-safety.html?type=pmg"
+ ],
+ "states": [
+ "Existing production NodeCredentialSlot renders accurate PVE collection limits and a non-dismissible guest-agent backup precaution before the controls. PBS and PMG do not show QEMU advice.",
+ "All initial choices remain checked, SMART stays off and TLS verification stays on. The safety guidance stays present after disabling VM collection."
+ ],
+ "interactions": [
+ "Desktop keyboard Space and genuine 390px touch change one collector, then the production connection editor passes the unchanged existing-source save payload to the safe fixture callback.",
+ "Six cases preserve the edit target, unaffected collectors, certificate verification and existing credentials. No live API request or page exception; no horizontal overflow."
+ ],
+ "viewports": [
+ {
+ "width": 1280,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "runtime": {
+ "playwright": "1.56.1",
+ "chromium": "141.0.7390.37",
+ "webkit": "26.0",
+ "solid": "1.9.15",
+ "seroval": "1.6.3"
+ },
+ "pixel_review": {
+ "tool": "native view_image; six original image contents presented to the model",
+ "observations": [
+ "PVE desktop and phone show the complete precaution and available/deferred caveat, with legible contrast and wrapping. The VM checkbox is visibly off; other collection choices remain on.",
+ "PBS and PMG desktop and phone preserve their own descriptions and controls with no guest-agent caution.",
+ "Element captures bound the collection section, not native monitoring or the entire settings journey."
+ ],
+ "captures": [
+ {
+ "file": "chromium-pve-collection.png",
+ "sha256": "9c7164839fdcefd1e8c46d480b42fd3af0eee713c49b094d289ab2e26b8ff8ea",
+ "bytes": 66460
+ },
+ {
+ "file": "chromium-pbs-collection.png",
+ "sha256": "60c8730000103ae27b38d9eaaa8839f6b54edbf4da812ee59979d6b9e78b537c",
+ "bytes": 35945
+ },
+ {
+ "file": "chromium-pmg-collection.png",
+ "sha256": "32288ed7b7c94a0236a46e89805d66199fe00d40d054bc39d4af657a7fb5b077",
+ "bytes": 36528
+ },
+ {
+ "file": "webkit-pve-collection.png",
+ "sha256": "c8b99c1716761bcccc9ac14ffbf64edf8ca4102909f74b244a6693cf194f9003",
+ "bytes": 60787
+ },
+ {
+ "file": "webkit-pbs-collection.png",
+ "sha256": "eb662b52ca766fe6f3bdb8116b32e5d08451787f36991a8b04206a02237c6b2b",
+ "bytes": 34753
+ },
+ {
+ "file": "webkit-pmg-collection.png",
+ "sha256": "eb807003a19a3f48827ba90008c80be75cf5b7dbe82538a99c78163afcc07cc4",
+ "bytes": 36659
+ }
+ ]
+ },
+ "scope": "Existing collection guidance and its production editor consumer only. Does not establish native thaw, writes, restart recovery, release availability, a passing authentication golden or qualification of the unmounted upgraded graph."
+}
diff --git a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
index c5bf8ede14..5d1db72ba8 100644
--- a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
+++ b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
@@ -11,6 +11,7 @@ import {
labelClass,
} from '@/components/shared/Form';
import { TogglePrimitive } from '@/components/shared/Toggle';
+import { InlineNotice } from '@/components/shared/InlineNotice';
import {
getNodeMonitoringCoverageCopy,
getTemperatureMonitoringLockedCopy,
@@ -75,7 +76,7 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
</Show>
<Show when={modalProps.nodeType === 'pve'}>
- <div class="space-y-3">
+ <section aria-label="Collection scope" class="space-y-3">
<SectionHeader
title="Collection scope"
size="sm"
@@ -83,11 +84,17 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
titleClass="text-base-content"
/>
<p class="text-sm text-muted">
- Pulse tracks all supported Proxmox VE resources by default — virtual machines,
- containers, storage, and backups — so you always get full visibility without extra
- configuration. Disable individual collectors below to reduce API load or trim workload
- noise.
+ Choose which resources Pulse collects from this Proxmox VE connection. Guest details
+ depend on guest-agent availability and permissions. Some readings can be unavailable or
+ temporarily deferred.
</p>
+ <InlineNotice tone="warning" role="note" aria-label="Guest-agent backup precaution">
+ Guest-agent reads share the channel used by freeze-enabled backups. If a guest becomes
+ unresponsive around a backup, stop Pulse monitoring and leave it stopped until
+ independent checks confirm thaw and writes to every filesystem covered by the backup. Do
+ not run live diagnostics or restart the guest agent during the incident. An OK backup or
+ a running VM does not prove recovery.
+ </InlineNotice>
<label class="flex items-start gap-2 text-sm text-base-content">
<input
@@ -99,7 +106,8 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
<div>
<div>Virtual machines</div>
<p class="text-xs text-muted mt-1">
- QEMU guest state, resource usage, and per-VM metrics.
+ VM state and resource usage. Guest memory and filesystem details depend on available
+ guest-agent readings.
</p>
</div>
</label>
@@ -146,7 +154,7 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
<p class="text-xs text-muted mt-1">vzdump schedules and recent backup activity.</p>
</div>
</label>
- </div>
+ </section>
<div class="space-y-4">
<SectionHeader
diff --git a/frontend-modern/src/components/Settings/__tests__/NodeModalMonitoringSection.test.tsx b/frontend-modern/src/components/Settings/__tests__/NodeModalMonitoringSection.test.tsx
new file mode 100644
index 0000000000..b162d4a081
--- /dev/null
+++ b/frontend-modern/src/components/Settings/__tests__/NodeModalMonitoringSection.test.tsx
@@ -0,0 +1,129 @@
+import { cleanup, fireEvent, render, screen, within } from '@solidjs/testing-library';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import type { NodeConfig } from '@/types/nodes';
+import type { NodeModalProps } from '../nodeModalModel';
+import { useNodeModalState } from '../useNodeModalState';
+import { NodeModalMonitoringSection } from '../NodeModalMonitoringSection';
+
+function renderMonitoring(nodeType: NodeModalProps['nodeType'] = 'pve') {
+ const onSave = vi.fn();
+ const fetch = vi.fn();
+ vi.stubGlobal('fetch', fetch);
+ const baseNode = {
+ id: 'fixture-source',
+ name: 'Fixture source',
+ host: 'https://pve.example.invalid:8006',
+ user: 'monitoring@pam',
+ tokenName: 'monitoring@pam!fixture',
+ hasToken: true,
+ verifySSL: true,
+ };
+ const editingNode: NodeConfig =
+ nodeType === 'pve'
+ ? {
+ ...baseNode,
+ type: 'pve',
+ monitorVMs: true,
+ monitorContainers: true,
+ monitorStorage: true,
+ monitorBackups: true,
+ monitorPhysicalDisks: false,
+ }
+ : nodeType === 'pbs'
+ ? {
+ ...baseNode,
+ type: 'pbs',
+ monitorDatastores: true,
+ monitorSyncJobs: true,
+ monitorVerifyJobs: true,
+ monitorPruneJobs: true,
+ monitorGarbageJobs: true,
+ excludeDatastores: [],
+ }
+ : {
+ ...baseNode,
+ type: 'pmg',
+ monitorMailStats: true,
+ monitorQueues: true,
+ monitorQuarantine: true,
+ monitorDomainStats: true,
+ };
+ const Harness = () => {
+ const modalProps: NodeModalProps = {
+ nodeType,
+ isOpen: true,
+ onClose: vi.fn(),
+ onSave,
+ // Edit an ordinary saved source, without issuing or replacing a token.
+ editingNode,
+ };
+ const state = useNodeModalState(modalProps);
+ return (
+ <form onSubmit={state.handleSubmit}>
+ <NodeModalMonitoringSection modalProps={modalProps} state={state} />
+ <button type="submit">Save fixture</button>
+ </form>
+ );
+ };
+ render(() => <Harness />);
+ return { onSave, fetch };
+}
+
+describe('NodeModalMonitoringSection collection safety', () => {
+ afterEach(() => {
+ cleanup();
+ vi.unstubAllGlobals();
+ });
+
+ it('explains missing guest readings and independent recovery beside PVE collection choices', () => {
+ const { fetch } = renderMonitoring();
+ const scope = within(screen.getByRole('region', { name: 'Collection scope' }));
+ expect(
+ scope.getByText(/Guest details depend on guest-agent availability and permissions/),
+ ).toBeVisible();
+ expect(
+ scope.getByText(/Some readings can be unavailable or temporarily deferred/),
+ ).toBeVisible();
+ const precaution = scope.getByRole('note', { name: 'Guest-agent backup precaution' });
+ expect(precaution).toHaveTextContent('stop Pulse monitoring and leave it stopped');
+ expect(precaution).toHaveTextContent('Do not run live diagnostics or restart the guest agent');
+ expect(precaution).toHaveTextContent(
+ 'independent checks confirm thaw and writes to every filesystem covered by the backup',
+ );
+ expect(precaution).toHaveTextContent('An OK backup or a running VM does not prove recovery');
+ expect(scope.queryByText(/always get full visibility/)).not.toBeInTheDocument();
+ expect(fetch).not.toHaveBeenCalled();
+ });
+
+ it('keeps collector choices, certificate verification and saved credentials unchanged', () => {
+ const { fetch, onSave } = renderMonitoring();
+ const vms = screen.getByRole('checkbox', { name: /^Virtual machines/ });
+ expect(vms).toBeChecked();
+ fireEvent.click(vms);
+ expect(vms).not.toBeChecked();
+ expect(screen.getByRole('note', { name: 'Guest-agent backup precaution' })).toBeVisible();
+ fireEvent.click(screen.getByRole('button', { name: 'Save fixture' }));
+ expect(onSave).toHaveBeenCalledOnce();
+ expect(onSave.mock.calls[0][0]).toMatchObject({
+ type: 'pve',
+ monitorVMs: false,
+ monitorContainers: true,
+ monitorStorage: true,
+ monitorBackups: true,
+ monitorPhysicalDisks: false,
+ verifySSL: true,
+ });
+ expect(onSave.mock.calls[0][0]).not.toHaveProperty('tokenValue');
+ expect(onSave.mock.calls[0][0]).not.toHaveProperty('password');
+ expect(fetch).not.toHaveBeenCalled();
+ });
+
+ it.each(['pbs', 'pmg'] as const)('does not imply %s makes QEMU guest-agent reads', (nodeType) => {
+ const { fetch } = renderMonitoring(nodeType);
+ expect(
+ screen.queryByRole('note', { name: 'Guest-agent backup precaution' }),
+ ).not.toBeInTheDocument();
+ expect(screen.queryByText(/Guest details depend on guest-agent/)).not.toBeInTheDocument();
+ expect(fetch).not.toHaveBeenCalled();
+ });
+});