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.

Make source-text guardrail assertions tolerant of prettier wrapping

rcourtman84c766730579
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 2a030c9b80..90e242b3d5 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -1053,19 +1053,24 @@ describe('settings architecture guardrails', () => {
});
it('keeps settings copy aligned with Infrastructure as the default workspace', () => {
- expect(settingsHeaderMetaSource).toContain(
+ // Copy phrases are matched against whitespace-normalized source so
+ // prettier line-wrapping inside JSX text cannot break the guard.
+ const normalize = (source: string) => source.replace(/\s+/g, ' ');
+ expect(normalize(settingsHeaderMetaSource)).toContain(
'Manage appearance, layout, and default monitoring cadence.',
);
- expect(generalSettingsPanelSource).not.toContain('Dashboard, Infrastructure');
- expect(networkBoundarySettingsSectionSource).toContain('Pulse URL for Notifications');
- expect(networkBoundarySettingsSectionSource).not.toContain('Dashboard URL for Notifications');
- expect(nodeModalBasicInfoSectionSource).toContain('monitoring views');
- expect(nodeModalBasicInfoSectionSource).not.toContain('dashboards');
- expect(nodeModalMonitoringSectionSource).toContain('trim workload noise');
- expect(nodeModalMonitoringSectionSource).toContain('Existing monitoring readings');
- expect(nodeModalMonitoringSectionSource).not.toContain('dashboard readings');
- expect(recoverySettingsPanelSource).toContain('Required for workload backup status');
- expect(recoverySettingsPanelSource).not.toContain('dashboard backup status');
+ expect(normalize(generalSettingsPanelSource)).not.toContain('Dashboard, Infrastructure');
+ expect(normalize(networkBoundarySettingsSectionSource)).toContain('Pulse URL for Notifications');
+ expect(normalize(networkBoundarySettingsSectionSource)).not.toContain(
+ 'Dashboard URL for Notifications',
+ );
+ expect(normalize(nodeModalBasicInfoSectionSource)).toContain('monitoring views');
+ expect(normalize(nodeModalBasicInfoSectionSource)).not.toContain('dashboards');
+ expect(normalize(nodeModalMonitoringSectionSource)).toContain('trim workload noise');
+ expect(normalize(nodeModalMonitoringSectionSource)).toContain('Existing monitoring readings');
+ expect(normalize(nodeModalMonitoringSectionSource)).not.toContain('dashboard readings');
+ expect(normalize(recoverySettingsPanelSource)).toContain('Required for workload backup status');
+ expect(normalize(recoverySettingsPanelSource)).not.toContain('dashboard backup status');
});
it('keeps cluster member address edits on the durable IPOverride boundary', () => {
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index 0a12e7721f..9f07745b3a 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -1394,7 +1394,8 @@ describe('Workloads performance contract', () => {
expect(guestRowStateSource).not.toContain('rowStyle');
expect(guestRowStateSource).not.toContain('box-shadow');
expect(guestRowStateSource).toContain('getWorkloadTypeBadge');
- expect(guestRowCellsSource).toContain('export { AvailabilityProbeCell');
+ // Wrapping-tolerant: prettier may break the export list across lines.
+ expect(guestRowCellsSource).toMatch(/export \{[^}]*\bAvailabilityProbeCell\b/);
expect(guestRowCellsSource).toContain('function NetworkInfoCell(');
expect(guestRowCellsSource).toContain('function OSInfoCell(');
expect(guestRowCellsSource).toContain('useTooltip');