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.

1.6 KB
Raw Blame
import { describe, expect, it } from 'vitest';

import {
  PROXMOX_BACKUP_SOURCE_KINDS,
  getProxmoxArchiveSourceTitle,
  getProxmoxBackupSourcePresentation,
} from '../proxmoxBackupSourcePresentation';

describe('proxmoxBackupSourcePresentation', () => {
  it('keeps Proxmox backup source vocabulary canonical across filters and badges', () => {
    expect(PROXMOX_BACKUP_SOURCE_KINDS).toEqual(['pbs', 'archive', 'snapshot']);

    expect(getProxmoxBackupSourcePresentation('pbs')).toMatchObject({
      badgeTone: 'sky',
      badgeLabel: 'PBS',
      coverageColumnLabel: 'Latest PBS',
      filterLabel: 'PBS backups',
      timelineLabel: 'PBS backups',
    });
    expect(getProxmoxBackupSourcePresentation('archive')).toMatchObject({
      badgeTone: 'info',
      badgeLabel: 'PVE file',
      coverageColumnLabel: 'Latest PVE file',
      filterLabel: 'PVE backup files',
      timelineLabel: 'PVE backup files',
    });
    expect(getProxmoxBackupSourcePresentation('snapshot')).toMatchObject({
      badgeTone: 'indigo',
      badgeLabel: 'Snapshot',
      coverageColumnLabel: 'Latest snapshot',
      filterLabel: 'Guest snapshots',
      timelineLabel: 'Guest snapshots',
    });
    expect(getProxmoxBackupSourcePresentation('pbs')).not.toHaveProperty('badgeClassName');
  });

  it('explains PVE file rows without making them look like direct PBS rows', () => {
    expect(getProxmoxArchiveSourceTitle(false)).toContain('Proxmox VE storage');
    expect(getProxmoxArchiveSourceTitle(true)).toBe(
      'Backup volume reported by Proxmox VE from a PBS-backed storage target',
    );
  });
});