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 PBS capacity regressions with admitted byte evidence

pulse-triage[bot]d42e8e9cbddd
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.capacity.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.capacity.test.tsx
index 3acc64cbc1..b5956ddeb6 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.capacity.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.capacity.test.tsx
@@ -62,10 +62,6 @@ describe('PBS datastore capacity evidence', () => {
['missing used', { used: undefined }, 'Unknown'],
['negative used', { used: -10 }, 'Unknown'],
['nonfinite total', { total: Infinity }, 'Unknown'],
- ['invalid authoritative percent', { usagePercent: NaN }, 'Unknown'],
- ['negative authoritative percent', { usagePercent: -1 }, 'Unknown'],
- ['null authoritative percent', { usagePercent: null }, 'Unknown'],
- ['string authoritative percent', { usagePercent: '0' }, 'Unknown'],
['overflowed ratio', { used: Number.MAX_VALUE, total: Number.MIN_VALUE }, 'Unknown'],
])('shows %s as unknown evidence rather than healthy usage', async (_name, patch, label) => {
const { container } = render(() => (
@@ -83,6 +79,24 @@ describe('PBS datastore capacity evidence', () => {
expect(within(container).getByText('Healthy')).toBeInTheDocument();
});
+ it.each([NaN, -1, null, '0'])(
+ 'uses valid bytes even when optional percentage metadata is invalid (%s)',
+ (usagePercent) => {
+ const { container } = render(() => (
+ <ProxmoxBackupServersTable
+ servers={[server(datastore({ usagePercent }))]}
+ layoutWidth={() => 1200}
+ />
+ ));
+ const cell = usedCell(container);
+ expect(cell).toHaveTextContent('40.0%');
+ expect(cell).toHaveTextContent('400 B / 1000 B');
+ expect(cell.querySelector('.bg-emerald-500')).not.toBeNull();
+ expect(within(cell).queryByText('Unknown')).toBeNull();
+ expect(container.textContent).toContain('2.0×');
+ },
+ );
+
it('withdraws retained capacity and dedup when the PBS connection is offline', () => {
const { container } = render(() => (
<ProxmoxBackupServersTable