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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Realign vitest suites with canonical frontend sources
rcourtman12b6d93a2a5f
diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.tsindex 88a8e130e8..b262d94d92 100644--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts@@ -21,6 +21,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {namespace: 'default',agent: 'node-a',resource: 'guest-1',+ summaryGroup: '',});});diff --git a/frontend-modern/src/components/Infrastructure/InfrastructureSummary.test.tsx b/frontend-modern/src/components/Infrastructure/InfrastructureSummary.test.tsxindex de7552aaac..ff27530d3c 100644--- a/frontend-modern/src/components/Infrastructure/InfrastructureSummary.test.tsx+++ b/frontend-modern/src/components/Infrastructure/InfrastructureSummary.test.tsx@@ -103,13 +103,13 @@ describe('InfrastructureSummary range behavior', () => {render(() => <InfrastructureSummary resources={[makeHost()]} timeRange={range()} />);await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});setRange('24h');await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('24h');+ expect(mockGetCharts).toHaveBeenCalledWith('24h', undefined, expect.any(Object));});});@@ -130,7 +130,7 @@ describe('InfrastructureSummary range behavior', () => {await waitFor(() => {expect(mockGetCharts).toHaveBeenCalledTimes(1);- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});resolveFetch?.(makeChartsResponse());@@ -148,7 +148,7 @@ describe('InfrastructureSummary range behavior', () => {<InfrastructureSummary resources={[makeHost()]} timeRange="1h" />));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));expect(firstContainer.querySelector('svg.cursor-crosshair')).toBeTruthy();});unmount();@@ -183,7 +183,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});// While fetch is pending, skeleton should be shown (no in-memory cache yet).@@ -210,7 +210,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {@@ -222,7 +222,7 @@ describe('InfrastructureSummary range behavior', () => {setRange('24h');await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('24h');+ expect(mockGetCharts).toHaveBeenCalledWith('24h', undefined, expect.any(Object));});expect(container.querySelector('svg.cursor-crosshair')).toBeNull();@@ -240,13 +240,13 @@ describe('InfrastructureSummary range behavior', () => {render(() => <InfrastructureSummary resources={[makeHost()]} timeRange={range()} />);await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});setRange('24h');await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('24h');+ expect(mockGetCharts).toHaveBeenCalledWith('24h', undefined, expect.any(Object));});});@@ -271,7 +271,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {expect(container.querySelector('svg.cursor-crosshair')).toBeTruthy();@@ -280,7 +280,7 @@ describe('InfrastructureSummary range behavior', () => {setRange('24h');await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('24h');+ expect(mockGetCharts).toHaveBeenCalledWith('24h', undefined, expect.any(Object));});await waitFor(() => {@@ -306,7 +306,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {@@ -325,7 +325,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {expect(container.querySelector('svg.cursor-crosshair')).toBeTruthy();@@ -334,7 +334,7 @@ describe('InfrastructureSummary range behavior', () => {setRange('24h');await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('24h');+ expect(mockGetCharts).toHaveBeenCalledWith('24h', undefined, expect.any(Object));});await waitFor(() => {@@ -354,7 +354,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {expect(container.querySelector('svg.cursor-crosshair')).toBeTruthy();@@ -395,7 +395,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));expect(container.querySelectorAll('[data-testid="sparkline-skeleton"]')).toHaveLength(0);expect(countSparklinePaths(container)).toBeGreaterThan(0);});@@ -491,7 +491,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {@@ -550,7 +550,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {@@ -616,7 +616,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {@@ -709,11 +709,14 @@ describe('InfrastructureSummary range behavior', () => {};const { container } = render(() => (- <InfrastructureSummary resources={[proxmoxNodeHost]} timeRange="1h" />+ <InfrastructureSummary+ resources={[proxmoxNodeHost, ...mockHostAgentResources]}+ timeRange="1h"+ />));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {@@ -786,7 +789,7 @@ describe('InfrastructureSummary range behavior', () => {));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {@@ -877,11 +880,14 @@ describe('InfrastructureSummary range behavior', () => {};const { container } = render(() => (- <InfrastructureSummary resources={[proxmoxNodeHost]} timeRange="1h" />+ <InfrastructureSummary+ resources={[proxmoxNodeHost, ...mockHostAgentResources]}+ timeRange="1h"+ />));await waitFor(() => {- expect(mockGetCharts).toHaveBeenCalledWith('1h');+ expect(mockGetCharts).toHaveBeenCalledWith('1h', undefined, expect.any(Object));});await waitFor(() => {diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsxindex 719b147d3a..d76f5f2549 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsx+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsx@@ -142,7 +142,7 @@ describe('UnifiedResourceTable workloads links', () => {.map((link) => link.getAttribute('href')).filter((href): href is string => typeof href === 'string');expect(hrefs).toContain('/workloads?agent=pve1');- expect(hrefs).toContain('/workloads?type=pod&context=cluster-a');+ expect(hrefs).toContain('/workloads?type=pod&platform=kubernetes&context=cluster-a');const hostLink = links.find((link) => link.getAttribute('href') === '/workloads?agent=pve1');expect(hostLink).toBeDefined();diff --git a/frontend-modern/src/components/Infrastructure/deploy/__tests__/DeployingStep.test.tsx b/frontend-modern/src/components/Infrastructure/deploy/__tests__/DeployingStep.test.tsxindex 2e072f5e75..4ab0cdfdae 100644--- a/frontend-modern/src/components/Infrastructure/deploy/__tests__/DeployingStep.test.tsx+++ b/frontend-modern/src/components/Infrastructure/deploy/__tests__/DeployingStep.test.tsx@@ -301,10 +301,10 @@ describe('DeployingStep', () => {const wizard = createMockWizard({ jobTargets: targets });render(() => <DeployingStep wizard={wizard} />);- // DeployStatusBadge renders role="status" spans; progress summary also has role="status"- const allStatusElements = screen.getAllByRole('status');- // Exactly 1 progress summary + 2 badges = 3- expect(allStatusElements).toHaveLength(3);+ // Progress summary has role="status"; badges render label text from getDeployStatusPresentation+ expect(screen.getAllByRole('status')).toHaveLength(1);+ expect(screen.getByText('Deployed')).toBeInTheDocument();+ expect(screen.getByText('Failed')).toBeInTheDocument();});it('renders empty table body when no targets', () => {diff --git a/frontend-modern/src/components/Infrastructure/deploy/__tests__/PreflightStep.test.tsx b/frontend-modern/src/components/Infrastructure/deploy/__tests__/PreflightStep.test.tsxindex d4b11f9066..160250c6af 100644--- a/frontend-modern/src/components/Infrastructure/deploy/__tests__/PreflightStep.test.tsx+++ b/frontend-modern/src/components/Infrastructure/deploy/__tests__/PreflightStep.test.tsx@@ -494,12 +494,13 @@ describe('PreflightStep', () => {/* ── Empty targets with no error ─────────────────────────────── */describe('empty targets', () => {- it('shows "Preflight checks complete" with 0 of 0 nodes', () => {+ it('shows the "Checking" summary when targets list is empty', () => {const wizard = createMockWizard({ preflightTargets: [] });render(() => <PreflightStep wizard={wizard} />);- // completedCount=0, totalCount=0 → 0 < 0 is false → shows "Preflight checks complete"- expect(getProgressSummary()).toHaveTextContent('Preflight checks complete');+ // totalCount=0 short-circuits to the "Checking..." branch so the summary+ // never prematurely declares "complete" before targets populate.+ expect(getProgressSummary()).toHaveTextContent('Checking 0 of 0 nodes...');});});});diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsxindex 9a59879456..c8dbc038da 100644--- a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx+++ b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx@@ -65,7 +65,7 @@ describe('RecoverySummary', () => {expect(screen.getAllByText('1 healthy')).toHaveLength(1);expect(screen.getByText('1 stale')).toBeInTheDocument();expect(screen.getByText('fresh in 24h')).toBeInTheDocument();- expect(screen.getByText('Mar 9')).toBeInTheDocument();+ expect(screen.getByText(/^(Mar 9|9 Mar)$/)).toBeInTheDocument();expect(screen.getByText('2 protected items')).toBeInTheDocument();expect(screen.getByText('attention')).toBeInTheDocument();expect(screen.queryByText('need attention')).not.toBeInTheDocument();@@ -86,7 +86,7 @@ describe('RecoverySummary', () => {expect(screen.queryByText('Peak Day')).not.toBeInTheDocument();expect(screen.queryByText('stale items')).not.toBeInTheDocument();expect(screen.queryByText('Platforms 2')).not.toBeInTheDocument();- expect(screen.queryByText('Latest Activity Mar 9')).not.toBeInTheDocument();+ expect(screen.queryByText(/^Latest Activity (Mar 9|9 Mar)$/)).not.toBeInTheDocument();expect(screen.queryByText(/^Platforms$/)).not.toBeInTheDocument();expect(screen.queryByText(/^Healthy$/)).not.toBeInTheDocument();expect(screen.queryByText(/^Failed$/)).not.toBeInTheDocument();diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePageControlsModel.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePageControlsModel.test.tsindex bb6cd7da3f..4667e5e72d 100644--- a/frontend-modern/src/components/Storage/__tests__/useStoragePageControlsModel.test.ts+++ b/frontend-modern/src/components/Storage/__tests__/useStoragePageControlsModel.test.ts@@ -29,6 +29,6 @@ describe('useStoragePageControlsModel', () => {expect(setGroupBy).toHaveBeenCalledWith('node');result.setNormalizedSortKey('type');- expect(setSortKey).toHaveBeenCalledWith('priority');+ expect(setSortKey).toHaveBeenCalledWith('type');});});diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.tsindex 2052e24c53..166a2204bb 100644--- a/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts+++ b/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts@@ -63,6 +63,7 @@ describe('useStoragePageFilters', () => {expect(ctx.filters.sourceFilter()).toBe('proxmox-pve');expect(ctx.navigate).toHaveBeenCalledWith('/storage?source=proxmox-pve', {replace: true,+ scroll: false,});ctx.dispose();@@ -76,6 +77,7 @@ describe('useStoragePageFilters', () => {expect(ctx.filters.selectedNodeId()).toBe('all');expect(ctx.navigate).toHaveBeenCalledWith('/storage', {replace: true,+ scroll: false,});ctx.dispose();@@ -95,6 +97,7 @@ describe('useStoragePageFilters', () => {expect(ctx.navigate).toHaveBeenCalledTimes(1);expect(ctx.navigate).toHaveBeenCalledWith('/storage?tab=disks&source=agent&q=tank', {replace: true,+ scroll: false,});ctx.dispose();diff --git a/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts b/frontend-modern/src/components/shared/TypeColumn.guardrails.test.tsindex ab407c354f..90817d2949 100644--- a/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts+++ b/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts@@ -65,7 +65,7 @@ describe('type column guardrails', () => {expect(guestRowModelSource).not.toMatch(INLINE_TYPE_COLUMN_PATTERN);expect(guestRowModelSource).not.toContain("defaultVisibility:");- expect(recoverySource).toContain('createHiddenCanonicalTypeColumn()');+ expect(recoverySource).toContain('createVisibleCanonicalTypeColumn()');expect(recoverySource).not.toContain('createCanonicalTypeColumn');expect(recoverySource).not.toMatch(INLINE_TYPE_COLUMN_PATTERN);expect(recoverySource).not.toContain("defaultVisibility:");diff --git a/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsx b/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsxindex 0a8d739141..db65ddd909 100644--- a/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsx+++ b/frontend-modern/src/components/shared/__tests__/WebInterfaceUrlField.test.tsx@@ -109,7 +109,7 @@ describe('WebInterfaceUrlField', () => {/>));- expect(await screen.findByText('No suggested URL found')).toBeInTheDocument();+ expect(await screen.findByText('No suggested URL available')).toBeInTheDocument();expect(screen.getByText('No management interface could be inferred.')).toBeInTheDocument();});});diff --git a/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts b/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.tsindex 8807642a97..84ddb88171 100644--- a/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts+++ b/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts@@ -43,7 +43,7 @@ describe('infrastructurePageModel', () => {]);expect(derivation.statusOptions).toEqual([{ key: 'online', label: 'Online' },- { key: 'warning', label: 'warning' },+ { key: 'degraded', label: 'Degraded' },]);expect(derivation.activeFilterCount).toBe(0);expect(derivation.hasActiveFilters).toBe(false);diff --git a/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.tsindex 50ff106070..55b0171262 100644--- a/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts+++ b/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts@@ -98,7 +98,6 @@ describe('storagePagePresentation', () => {'Usage','Impact','Primary Issue',- '',]);});diff --git a/frontend-modern/src/features/storageBackups/__tests__/storagePageStatus.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storagePageStatus.test.tsindex 16f5c6dcfa..2677c94add 100644--- a/frontend-modern/src/features/storageBackups/__tests__/storagePageStatus.test.ts+++ b/frontend-modern/src/features/storageBackups/__tests__/storagePageStatus.test.ts@@ -10,7 +10,7 @@ describe('storagePageStatus', () => {getStoragePageBannerKind({loading: false,filteredRecordCount: 3,- connected: true,+ connected: false,initialDataReceived: true,reconnecting: true,hasFetchError: false,diff --git a/frontend-modern/src/utils/__tests__/licensePresentation.test.ts b/frontend-modern/src/utils/__tests__/licensePresentation.test.tsindex 76f8fcfd9e..09be70e993 100644--- a/frontend-modern/src/utils/__tests__/licensePresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/licensePresentation.test.ts@@ -75,7 +75,7 @@ describe('licensePresentation', () => {usageTabLabel: 'Usage',planSectionTitle: 'Plan',planSectionDescription:- 'Review your active plan, expiry, included limits, and paid capabilities.',+ 'Review your active plan, expiry, and the paid capabilities that come with it.',usageSectionTitle: 'Usage',hiddenShellTitle: 'Demo mode',hiddenShellDescription: 'Commercial settings are hidden for this session.',diff --git a/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.ts b/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.tsindex d64988b612..6249b1ea8a 100644--- a/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.ts+++ b/frontend-modern/src/utils/__tests__/recoveryCanonicalVocabulary.test.ts@@ -1,8 +1,7 @@import { describe, expect, it } from 'vitest';-import recoveryActivitySectionSource from '@/components/Recovery/RecoveryActivitySection.tsx?raw';-import recoveryPageSource from '@/components/Recovery/Recovery.tsx?raw';import recoveryPointDetailsSource from '@/components/Recovery/RecoveryPointDetails.tsx?raw';+import recoverySurfaceStateSource from '@/features/recovery/useRecoverySurfaceState.ts?raw';import recoverySummaryPresentationSource from '@/utils/recoverySummaryPresentation.ts?raw';import recoveryHistorySectionSource from '@/components/Recovery/RecoveryHistorySection.tsx?raw';import recoveryProtectedInventorySectionSource from '@/components/Recovery/RecoveryProtectedInventorySection.tsx?raw';@@ -25,10 +24,10 @@ describe('recovery canonical vocabulary', () => {});it('keeps recovery activity focus labels item-first', () => {- expect(recoveryPageSource).toContain('const selectedHistoryItemLabel = createMemo(() => {');- expect(recoveryPageSource).not.toContain('const selectedHistorySubjectLabel = createMemo(() => {');- expect(recoveryActivitySectionSource).toContain('selectedHistoryItemLabel: Accessor<string | null>;');- expect(recoveryActivitySectionSource).not.toContain(+ expect(recoverySurfaceStateSource).toContain('const selectedHistoryItemLabel = createMemo(() => {');+ expect(recoverySurfaceStateSource).not.toContain('const selectedHistorySubjectLabel = createMemo(() => {');+ expect(recoveryHistorySectionSource).toContain('selectedHistoryItemLabel: Accessor<string | null>;');+ expect(recoveryHistorySectionSource).not.toContain('selectedHistorySubjectLabel: Accessor<string | null>;',);});