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.

Format the backup-cycle guide regression fixture

pulse-triage[bot]48ff973ff6e4
diff --git a/frontend-modern/src/features/docs/__tests__/backupFreshnessDocs.test.ts b/frontend-modern/src/features/docs/__tests__/backupFreshnessDocs.test.ts
index bb62360591..62cb998c28 100644
--- a/frontend-modern/src/features/docs/__tests__/backupFreshnessDocs.test.ts
+++ b/frontend-modern/src/features/docs/__tests__/backupFreshnessDocs.test.ts
@@ -8,7 +8,8 @@ import { useThresholdsRecoveryDefaultsState } from '@/features/alerts/thresholds
import type { ThresholdsTableProps } from '@/features/alerts/thresholds/types';
import { createGuideFixture } from './guideFixture';
-const read = (name: string) => readFileSync(resolve(process.cwd(), '../docs', `${name}.md`), 'utf8');
+const read = (name: string) =>
+ readFileSync(resolve(process.cwd(), '../docs', `${name}.md`), 'utf8');
const article = createGuideFixture(read);
const text = (node: Element) => node.textContent!.replace(/\s+/g, ' ').trim();
const now = new Date('2026-10-12T08:00:00Z');
@@ -19,7 +20,9 @@ describe('backup-cycle help matches the existing controls', () => {
const guide = article('PBS');
const heading = guide.querySelector('#backup-age-colours-for-a-longer-backup-cycle');
expect(heading).not.toBeNull();
- expect(text(guide)).toContain(`Alerts → Thresholds → Proxmox, then expand ${ALERT_THRESHOLDS_SECTION_TITLE_BACKUPS}`);
+ expect(text(guide)).toContain(
+ `Alerts → Thresholds → Proxmox, then expand ${ALERT_THRESHOLDS_SECTION_TITLE_BACKUPS}`,
+ );
expect(text(guide)).toContain('Global Defaults');
const scroll = heading!.nextElementSibling!.nextElementSibling!.nextElementSibling!;
expect(scroll.hasAttribute('data-doc-table-scroll')).toBe(true);
@@ -27,9 +30,11 @@ describe('backup-cycle help matches the existing controls', () => {
expect(table).not.toBeNull();
expect(table.tagName).toBe('TABLE');
expect([...table.querySelectorAll('tbody tr td:first-child')].map(text)).toEqual([
- 'Fresh Hours', 'Stale Hours', 'Warning Days / Critical Days',
+ 'Fresh Hours',
+ 'Stale Hours',
+ 'Warning Days / Critical Days',
]);
- expect(text(table)).toContain('not the shield\'s freshness window');
+ expect(text(table)).toContain("not the shield's freshness window");
expect(readFileSync(resolve(process.cwd(), 'public/docs/PBS.md'), 'utf8')).toBe(read('PBS'));
});
@@ -38,7 +43,12 @@ describe('backup-cycle help matches the existing controls', () => {
expect(getBackupInfo(completed, undefined, now).status).toBe('stale');
const thresholds = { freshHours: 72, staleHours: 96 };
expect(getBackupInfo(completed, thresholds, now).status).toBe('fresh');
- for (const [hours, expected] of [[72, 'fresh'], [73, 'stale'], [96, 'stale'], [97, 'overdue']] as const) {
+ for (const [hours, expected] of [
+ [72, 'fresh'],
+ [73, 'stale'],
+ [96, 'stale'],
+ [97, 'overdue'],
+ ] as const) {
expect(getBackupInfo(now.getTime() - hours * hour, thresholds, now).status).toBe(expected);
}
expect(getBackupInfo(completed, thresholds, now).ageMs).toBe(25 * hour);
@@ -53,12 +63,22 @@ describe('backup-cycle help matches the existing controls', () => {
expect(getBackupInfo(now.getTime() + hour, thresholds, now).status).toBe('unknown');
const guide = article('PBS');
expect(text(guide)).toContain('missing or unknown backup evidence is not made healthy');
- expect(guide.querySelector('a[href="#backups-are-visible-but-coverage-says-unprotected"]')).not.toBeNull();
- expect(text(guide)).toContain('Do not run another backup, change retention, disable alerts or clear History');
+ expect(
+ guide.querySelector('a[href="#backups-are-visible-but-coverage-says-unprotected"]'),
+ ).not.toBeNull();
+ expect(text(guide)).toContain(
+ 'Do not run another backup, change retention, disable alerts or clear History',
+ );
});
it('retains the stable-version caution while the repaired editor preserves Off', () => {
- const config = { enabled: true, warningDays: 3, criticalDays: 0, freshHours: 72, staleHours: 96 };
+ const config = {
+ enabled: true,
+ warningDays: 3,
+ criticalDays: 0,
+ freshHours: 72,
+ staleHours: 96,
+ };
const result = createRoot((dispose) => {
const state = useThresholdsRecoveryDefaultsState({
backupDefaults: () => config,