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 frontend-modern/src with prettier (mechanical, no functional changes)

rcourtman0e6d0532bfed
diff --git a/frontend-modern/src/api/__tests__/actionAudit.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/actionAudit.branchcov0718.test.ts
index 677fccee6e..3270458159 100644
--- a/frontend-modern/src/api/__tests__/actionAudit.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/actionAudit.branchcov0718.test.ts
@@ -86,10 +86,9 @@ describe('ActionAuditAPI listActionAudits branch coverage', () => {
limit: 0,
});
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/audit/actions?resourceId=vm%3A42',
- { cache: 'no-store' },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/audit/actions?resourceId=vm%3A42', {
+ cache: 'no-store',
+ });
});
// Covers normalizeSince invalid-date arm:
@@ -125,10 +124,9 @@ describe('ActionAuditAPI listActionAudits branch coverage', () => {
const result = await ActionAuditAPI.listActionAudits({ resourceId: ' vm:42 ' });
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/audit/actions?resourceId=vm%3A42',
- { cache: 'no-store' },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/audit/actions?resourceId=vm%3A42', {
+ cache: 'no-store',
+ });
expect(result.resourceId).toBe('vm:42');
});
diff --git a/frontend-modern/src/api/__tests__/agentCapabilities.branchcov.test.ts b/frontend-modern/src/api/__tests__/agentCapabilities.branchcov.test.ts
index da16be194c..4d1d8b4f9b 100644
--- a/frontend-modern/src/api/__tests__/agentCapabilities.branchcov.test.ts
+++ b/frontend-modern/src/api/__tests__/agentCapabilities.branchcov.test.ts
@@ -25,7 +25,9 @@ const capability = (overrides: Partial<AgentCapability> = {}): AgentCapability =
...overrides,
});
-const component = (overrides: Partial<AgentSurfaceContractComponent> = {}): AgentSurfaceContractComponent => ({
+const component = (
+ overrides: Partial<AgentSurfaceContractComponent> = {},
+): AgentSurfaceContractComponent => ({
id: 'component_id',
label: 'Component',
description: 'component description',
@@ -53,7 +55,9 @@ const adapter = (overrides: Partial<AgentMCPAdapterContract> = {}): AgentMCPAdap
...overrides,
});
-const manifest = (overrides: Partial<AgentCapabilitiesManifest> = {}): AgentCapabilitiesManifest => ({
+const manifest = (
+ overrides: Partial<AgentCapabilitiesManifest> = {},
+): AgentCapabilitiesManifest => ({
version: 'v1',
surfaceContract: {
core: component({ id: 'core', label: 'Core' }),
@@ -148,7 +152,11 @@ describe('agentCapabilities branch coverage', () => {
it('returns null when the contract normalizes away', () => {
expect(getAgentSurfaceToolPosturePresentation(undefined)).toBeNull();
expect(
- getAgentSurfaceToolPosturePresentation({ surfaceId: ' ', toolSource: 'x', toolNames: [] }),
+ getAgentSurfaceToolPosturePresentation({
+ surfaceId: ' ',
+ toolSource: 'x',
+ toolNames: [],
+ }),
).toBeNull();
});
});
diff --git a/frontend-modern/src/api/__tests__/agentProfiles.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/agentProfiles.branchcov0718.test.ts
index 0db434b035..8b4f2d557f 100644
--- a/frontend-modern/src/api/__tests__/agentProfiles.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/agentProfiles.branchcov0718.test.ts
@@ -412,9 +412,7 @@ describe('AgentProfilesAPI branch coverage', () => {
it('treats null Enum as absent (undefined)', async () => {
vi.mocked(apiFetch).mockResolvedValueOnce(
- jsonResponse([
- { Key: 'k', Type: 'string', Description: 'D', Required: false, Enum: null },
- ]),
+ jsonResponse([{ Key: 'k', Type: 'string', Description: 'D', Required: false, Enum: null }]),
);
const result = await AgentProfilesAPI.getConfigSchema();
@@ -472,10 +470,7 @@ describe('AgentProfilesAPI branch coverage', () => {
{ Valid: true, Warnings: [] },
'Warnings',
);
- expect(objectArrayFieldOrEmpty).not.toHaveBeenCalledWith(
- expect.anything(),
- 'Errors',
- );
+ expect(objectArrayFieldOrEmpty).not.toHaveBeenCalledWith(expect.anything(), 'Errors');
});
it('returns empty warnings array when Warnings field is undefined', async () => {
diff --git a/frontend-modern/src/api/__tests__/agentProfiles.test.ts b/frontend-modern/src/api/__tests__/agentProfiles.test.ts
index 93f24e85d3..b77d74d328 100644
--- a/frontend-modern/src/api/__tests__/agentProfiles.test.ts
+++ b/frontend-modern/src/api/__tests__/agentProfiles.test.ts
@@ -51,7 +51,7 @@ describe('AgentProfilesAPI', () => {
});
vi.mocked(assertAPIResponseOK).mockResolvedValue(undefined);
vi.mocked(assertAPIResponseOKOrAllowedStatus).mockResolvedValue(undefined);
- vi.mocked(assertAPIResponseOKOrThrowStatus).mockResolvedValue(undefined);
+ vi.mocked(assertAPIResponseOKOrThrowStatus).mockResolvedValue(undefined);
vi.mocked(arrayOrEmpty).mockImplementation((value) =>
Array.isArray(value) ? (value as never[]) : [],
);
@@ -107,7 +107,9 @@ describe('AgentProfilesAPI', () => {
});
it('returns empty array on 402 error', async () => {
- vi.mocked(apiFetchJSON).mockRejectedValueOnce(Object.assign(new Error('Payment Required'), { status: 402 }));
+ vi.mocked(apiFetchJSON).mockRejectedValueOnce(
+ Object.assign(new Error('Payment Required'), { status: 402 }),
+ );
const result = await AgentProfilesAPI.listProfiles();
@@ -156,7 +158,9 @@ describe('AgentProfilesAPI', () => {
});
it('returns null on 404', async () => {
- vi.mocked(apiFetchJSON).mockRejectedValueOnce(Object.assign(new Error('Not Found'), { status: 404 }));
+ vi.mocked(apiFetchJSON).mockRejectedValueOnce(
+ Object.assign(new Error('Not Found'), { status: 404 }),
+ );
const result = await AgentProfilesAPI.getProfile('p1');
@@ -288,7 +292,9 @@ describe('AgentProfilesAPI', () => {
});
it('returns empty array on 402', async () => {
- vi.mocked(apiFetchJSON).mockRejectedValueOnce(Object.assign(new Error('Payment Required'), { status: 402 }));
+ vi.mocked(apiFetchJSON).mockRejectedValueOnce(
+ Object.assign(new Error('Payment Required'), { status: 402 }),
+ );
const result = await AgentProfilesAPI.listAssignments();
@@ -379,7 +385,9 @@ describe('AgentProfilesAPI', () => {
ok: true,
status: 200,
text: () =>
- Promise.resolve(JSON.stringify({ name: 'Suggested', description: '', config: {}, rationale: [] })),
+ Promise.resolve(
+ JSON.stringify({ name: 'Suggested', description: '', config: {}, rationale: [] }),
+ ),
} as unknown as Response;
vi.mocked(apiFetch).mockResolvedValueOnce(mockResponse);
vi.mocked(parseRequiredAPIResponse).mockResolvedValueOnce({
@@ -479,7 +487,10 @@ describe('AgentProfilesAPI', () => {
const result = await AgentProfilesAPI.getConfigSchema();
expect(apiFetch).toHaveBeenCalledWith('/api/admin/profiles/schema');
- expect(assertAPIResponseOK).toHaveBeenCalledWith(expect.any(Response), 'Failed to fetch profile schema');
+ expect(assertAPIResponseOK).toHaveBeenCalledWith(
+ expect.any(Response),
+ 'Failed to fetch profile schema',
+ );
expect(parseRequiredJSON).toHaveBeenCalledWith(
expect.any(Response),
INVALID_AGENT_PROFILE_SCHEMA_MESSAGE,
diff --git a/frontend-modern/src/api/__tests__/ai.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/ai.branchcov0718.test.ts
index 44c0facc34..bf338db2a1 100644
--- a/frontend-modern/src/api/__tests__/ai.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/ai.branchcov0718.test.ts
@@ -129,7 +129,10 @@ describe('AIAPI branch coverage (request shaping + response handling)', () => {
});
it('forwards an explicit json format while keeping the days default', async () => {
- const stub = new Response('[]', { status: 200, headers: { 'Content-Type': 'application/json' } });
+ const stub = new Response('[]', {
+ status: 200,
+ headers: { 'Content-Type': 'application/json' },
+ });
apiFetchMock.mockResolvedValueOnce(stub);
await AIAPI.exportCostHistory(30, 'json');
diff --git a/frontend-modern/src/api/__tests__/ai.test.ts b/frontend-modern/src/api/__tests__/ai.test.ts
index 68c4b011c2..5cbb9ac53d 100644
--- a/frontend-modern/src/api/__tests__/ai.test.ts
+++ b/frontend-modern/src/api/__tests__/ai.test.ts
@@ -33,7 +33,10 @@ describe('AIAPI', () => {
expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/settings/ai');
apiFetchJSONMock.mockResolvedValueOnce({ configured: true } as any);
- await AIAPI.updateSettings({ enabled: true, zai_base_url: 'https://api.z.ai/api/coding/paas/v4' });
+ await AIAPI.updateSettings({
+ enabled: true,
+ zai_base_url: 'https://api.z.ai/api/coding/paas/v4',
+ });
expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/settings/ai/update', {
method: 'PUT',
body: JSON.stringify({ enabled: true, zai_base_url: 'https://api.z.ai/api/coding/paas/v4' }),
@@ -161,8 +164,7 @@ describe('AIAPI', () => {
category: 'reliability',
title: 'Service stalled',
description: 'Service stopped responding again',
- previous_resolved_fix_summary:
- 'Restart the workload service after backup window clears',
+ previous_resolved_fix_summary: 'Restart the workload service after backup window clears',
detected_at: '2026-05-08T12:00:00Z',
},
],
diff --git a/frontend-modern/src/api/__tests__/aiChat.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/aiChat.branchcov0718.test.ts
index efcd5614b9..660f4a0250 100644
--- a/frontend-modern/src/api/__tests__/aiChat.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/aiChat.branchcov0718.test.ts
@@ -163,9 +163,7 @@ describe('AIChatAPI branch coverage', () => {
const result = { denied: true, message: 'Command denied.' };
apiFetchJSONMock.mockResolvedValueOnce(result);
- await expect(AIChatAPI.denyCommand('approval-1', 'Wrong host')).resolves.toEqual(
- result,
- );
+ await expect(AIChatAPI.denyCommand('approval-1', 'Wrong host')).resolves.toEqual(result);
expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/ai/approvals/approval-1/deny', {
method: 'POST',
@@ -240,10 +238,9 @@ describe('AIChatAPI branch coverage', () => {
await expect(AIChatAPI.forkSession('session/root')).resolves.toEqual(forked);
// The session id is encoded; the literal '/fork' suffix is not.
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/ai/sessions/session%2Froot/fork',
- { method: 'POST' },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/ai/sessions/session%2Froot/fork', {
+ method: 'POST',
+ });
});
});
diff --git a/frontend-modern/src/api/__tests__/aiChatMentions.test.ts b/frontend-modern/src/api/__tests__/aiChatMentions.test.ts
index 4d3679814c..20a8fc053e 100644
--- a/frontend-modern/src/api/__tests__/aiChatMentions.test.ts
+++ b/frontend-modern/src/api/__tests__/aiChatMentions.test.ts
@@ -35,21 +35,14 @@ describe('AIChatAPI mention payloads', () => {
},
} as unknown as Response);
- await AIChatAPI.chat(
- 'check @NVMe Primary',
- undefined,
- undefined,
- vi.fn(),
- undefined,
- [
- {
- id: 'storage-vmware-1',
- name: 'NVMe Primary',
- type: 'storage',
- node: 'Lab VC',
- },
- ],
- );
+ await AIChatAPI.chat('check @NVMe Primary', undefined, undefined, vi.fn(), undefined, [
+ {
+ id: 'storage-vmware-1',
+ name: 'NVMe Primary',
+ type: 'storage',
+ node: 'Lab VC',
+ },
+ ]);
expect(apiFetchMock).toHaveBeenCalledWith(
'/api/ai/chat',
diff --git a/frontend-modern/src/api/__tests__/alerts.test.ts b/frontend-modern/src/api/__tests__/alerts.test.ts
index 92dd962992..8cb1663726 100644
--- a/frontend-modern/src/api/__tests__/alerts.test.ts
+++ b/frontend-modern/src/api/__tests__/alerts.test.ts
@@ -200,7 +200,9 @@ describe('AlertsAPI', () => {
const result = await AlertsAPI.getIncidentTimeline('canonical:a1');
- expect(apiFetchJSON).toHaveBeenCalledWith('/api/alerts/incidents?alertIdentifier=canonical%3Aa1');
+ expect(apiFetchJSON).toHaveBeenCalledWith(
+ '/api/alerts/incidents?alertIdentifier=canonical%3Aa1',
+ );
expect(result).toMatchObject({
alertIdentifier: 'canonical:a1',
diff --git a/frontend-modern/src/api/__tests__/charts.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/charts.branchcov0718.test.ts
index e603699462..31478bd5d1 100644
--- a/frontend-modern/src/api/__tests__/charts.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/charts.branchcov0718.test.ts
@@ -38,17 +38,7 @@ import {
} from '@/api/charts';
import { apiFetchJSON } from '@/utils/apiClient';
-const ALL_TIME_RANGES: TimeRange[] = [
- '5m',
- '15m',
- '30m',
- '1h',
- '4h',
- '12h',
- '24h',
- '7d',
- '30d',
-];
+const ALL_TIME_RANGES: TimeRange[] = ['5m', '15m', '30m', '1h', '4h', '12h', '24h', '7d', '30d'];
describe('ChartsAPI.getInfrastructureCharts — branch coverage', () => {
const apiFetchJSONMock = vi.mocked(apiFetchJSON);
@@ -78,16 +68,18 @@ describe('ChartsAPI.getInfrastructureCharts — branch coverage', () => {
});
});
- it.each(ALL_TIME_RANGES)('forwards TimeRange="%s" verbatim into the range query param', async (range) => {
- apiFetchJSONMock.mockResolvedValueOnce({} as never);
+ it.each(ALL_TIME_RANGES)(
+ 'forwards TimeRange="%s" verbatim into the range query param',
+ async (range) => {
+ apiFetchJSONMock.mockResolvedValueOnce({} as never);
- await ChartsAPI.getInfrastructureCharts(range);
+ await ChartsAPI.getInfrastructureCharts(range);
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- `/api/charts/infrastructure?range=${range}`,
- { signal: undefined },
- );
- });
+ expect(apiFetchJSONMock).toHaveBeenCalledWith(`/api/charts/infrastructure?range=${range}`, {
+ signal: undefined,
+ });
+ },
+ );
it('forwards an AbortSignal through to apiFetchJSON', async () => {
apiFetchJSONMock.mockResolvedValueOnce({} as never);
@@ -159,10 +151,9 @@ describe('ChartsAPI.getInfrastructureCharts — branch coverage', () => {
await ChartsAPI.getInfrastructureCharts('4h', controller.signal, { nodeId: 'pve1' });
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/charts/infrastructure?range=4h&node=pve1',
- { signal: controller.signal },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/charts/infrastructure?range=4h&node=pve1', {
+ signal: controller.signal,
+ });
});
it('returns the parsed InfrastructureChartsResponse payload verbatim from apiFetchJSON', async () => {
@@ -225,10 +216,9 @@ describe('ChartsAPI.getStorageSummaryTrend — branch coverage', () => {
await ChartsAPI.getStorageSummaryTrend(range);
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- `/api/charts/storage-summary?range=${range}`,
- { signal: undefined },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith(`/api/charts/storage-summary?range=${range}`, {
+ signal: undefined,
+ });
},
);
diff --git a/frontend-modern/src/api/__tests__/charts.test.ts b/frontend-modern/src/api/__tests__/charts.test.ts
index 767a6a3e8d..dce2d27d12 100644
--- a/frontend-modern/src/api/__tests__/charts.test.ts
+++ b/frontend-modern/src/api/__tests__/charts.test.ts
@@ -239,4 +239,3 @@ describe('Charts API Types', () => {
});
});
});
-
diff --git a/frontend-modern/src/api/__tests__/connections.test.ts b/frontend-modern/src/api/__tests__/connections.test.ts
index 247d5acebd..46eff9b320 100644
--- a/frontend-modern/src/api/__tests__/connections.test.ts
+++ b/frontend-modern/src/api/__tests__/connections.test.ts
@@ -150,7 +150,8 @@ describe('ConnectionsAPI', () => {
desired: 'disabled',
applied: 'enabled',
enforcement: 'drifted',
- reason: 'agent still reports command execution enabled while desired policy disables it',
+ reason:
+ 'agent still reports command execution enabled while desired policy disables it',
},
},
capabilities: { supportsPause: false, supportsScope: false, supportsTest: false },
@@ -223,7 +224,8 @@ describe('ConnectionsAPI', () => {
configDrift: {
status: 'pending',
desired: { version: 'host-agent-config/v1', hash: 'sha256:desired' },
- reason: 'Pulse has not received a comparable applied agent configuration fingerprint yet',
+ reason:
+ 'Pulse has not received a comparable applied agent configuration fingerprint yet',
},
rollout: {
status: 'pending',
diff --git a/frontend-modern/src/api/__tests__/discovery.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/discovery.branchcov0718.test.ts
index ad65c909f6..8aa7809c23 100644
--- a/frontend-modern/src/api/__tests__/discovery.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/discovery.branchcov0718.test.ts
@@ -97,9 +97,7 @@ describe('discovery api branch coverage', () => {
const result = await getDiscoveryProgress('vm', 'node-1', '100');
expect(apiFetchMock).toHaveBeenCalledTimes(1);
- expect(apiFetchMock).toHaveBeenCalledWith(
- '/api/discovery/vm/node-1/100/progress',
- );
+ expect(apiFetchMock).toHaveBeenCalledWith('/api/discovery/vm/node-1/100/progress');
expect(result).toMatchObject({
resource_id: '100',
status: 'running',
@@ -122,11 +120,7 @@ describe('discovery api branch coverage', () => {
it('encodes slashes in the target and resource id segments', async () => {
apiFetchMock.mockResolvedValueOnce(okJson(progressFixture()));
- await getDiscoveryProgress(
- 'vm/root' as never,
- 'node/1' as never,
- 'id/with/slash' as never,
- );
+ await getDiscoveryProgress('vm/root' as never, 'node/1' as never, 'id/with/slash' as never);
expect(apiFetchMock).toHaveBeenCalledWith(
'/api/discovery/vm%2Froot/node%2F1/id%2Fwith%2Fslash/progress',
@@ -140,9 +134,7 @@ describe('discovery api branch coverage', () => {
}),
);
- await expect(getDiscoveryProgress('vm', 'node-1', '100')).rejects.toThrow(
- 'scanner offline',
- );
+ await expect(getDiscoveryProgress('vm', 'node-1', '100')).rejects.toThrow('scanner offline');
});
it('throws a parse error when progress body is empty', async () => {
@@ -233,9 +225,7 @@ describe('discovery api branch coverage', () => {
await listDiscoveriesByAgent('agent/with slash');
- expect(apiFetchMock).toHaveBeenCalledWith(
- '/api/discovery/agent/agent%2Fwith%20slash',
- );
+ expect(apiFetchMock).toHaveBeenCalledWith('/api/discovery/agent/agent%2Fwith%20slash');
});
it('returns the parsed agent discovery list', async () => {
@@ -274,9 +264,7 @@ describe('discovery api branch coverage', () => {
}),
);
- await expect(listDiscoveriesByAgent('ghost')).rejects.toThrow(
- 'agent not connected',
- );
+ await expect(listDiscoveriesByAgent('ghost')).rejects.toThrow('agent not connected');
});
});
@@ -308,14 +296,11 @@ describe('discovery api branch coverage', () => {
await updateDiscoveryNotes('agent', 'host-1', 'host-1', notes);
- expect(apiFetchMock).toHaveBeenCalledWith(
- '/api/discovery/agent/host-1/host-1/notes',
- {
- method: 'PUT',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ user_notes: 'just text' }),
- },
- );
+ expect(apiFetchMock).toHaveBeenCalledWith('/api/discovery/agent/host-1/host-1/notes', {
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ user_notes: 'just text' }),
+ });
});
it('maps pod -> k8s for the notes subresource', async () => {
@@ -359,10 +344,9 @@ describe('discovery api branch coverage', () => {
await deleteDiscovery('pod', 'cluster-a', 'default/api');
- expect(apiFetchMock).toHaveBeenCalledWith(
- '/api/discovery/k8s/cluster-a/default%2Fapi',
- { method: 'DELETE' },
- );
+ expect(apiFetchMock).toHaveBeenCalledWith('/api/discovery/k8s/cluster-a/default%2Fapi', {
+ method: 'DELETE',
+ });
});
it('throws the backend error message on non-ok delete response', async () => {
@@ -370,9 +354,7 @@ describe('discovery api branch coverage', () => {
new Response(JSON.stringify({ error: 'discovery in use' }), { status: 409 }),
);
- await expect(deleteDiscovery('vm', 'node-1', '100')).rejects.toThrow(
- 'discovery in use',
- );
+ await expect(deleteDiscovery('vm', 'node-1', '100')).rejects.toThrow('discovery in use');
});
it('falls back to the default message when the error body is empty', async () => {
@@ -513,10 +495,7 @@ describe('discovery api branch coverage', () => {
expect(result?.id).toBe('agent:host-1:agent-X');
// resolveDiscoveryAgentId picks target_id ('host-1') because agent_id is absent
- expect(apiFetchMock).toHaveBeenNthCalledWith(
- 2,
- '/api/discovery/agent/host-1/agent-X',
- );
+ expect(apiFetchMock).toHaveBeenNthCalledWith(2, '/api/discovery/agent/host-1/agent-X');
});
it('matches a summary through resolveDiscoveryAgentId when target_id equals the request', async () => {
@@ -680,10 +659,7 @@ describe('discovery api branch coverage', () => {
const result = await getDiscovery('agent', 'rid-9', 'rid-9');
expect(result?.id).toBe('agent:rid-9:rid-9');
- expect(apiFetchMock).toHaveBeenNthCalledWith(
- 2,
- '/api/discovery/agent/rid-9/rid-9',
- );
+ expect(apiFetchMock).toHaveBeenNthCalledWith(2, '/api/discovery/agent/rid-9/rid-9');
});
});
});
diff --git a/frontend-modern/src/api/__tests__/monitoredSystemLedger.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/monitoredSystemLedger.branchcov0718.test.ts
index 8cb6471859..3147bd9be7 100644
--- a/frontend-modern/src/api/__tests__/monitoredSystemLedger.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/monitoredSystemLedger.branchcov0718.test.ts
@@ -29,10 +29,10 @@ describe('MonitoredSystemLedgerAPI branch coverage', () => {
await MonitoredSystemLedgerAPI.explain();
- expect(apiFetchJSON).toHaveBeenCalledWith(
- '/api/license/monitored-system-ledger/explain',
- { method: 'POST', body: '{}' },
- );
+ expect(apiFetchJSON).toHaveBeenCalledWith('/api/license/monitored-system-ledger/explain', {
+ method: 'POST',
+ body: '{}',
+ });
});
it('serializes both candidate and replacement objects into the POST body', async () => {
diff --git a/frontend-modern/src/api/__tests__/monitoring.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/monitoring.branchcov0718.test.ts
index 7261a44cd8..6d2c7785c3 100644
--- a/frontend-modern/src/api/__tests__/monitoring.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/monitoring.branchcov0718.test.ts
@@ -165,9 +165,9 @@ describe('MonitoringAPI branch coverage (optional query params / empty-input gua
it('updateAgentConfig throws the canonical message and skips the transport for an empty agentId', async () => {
// Exercises the `if (!agentId)` guard arm in updateAgentConfig — the
// PATCH body is never built or sent.
- await expect(
- MonitoringAPI.updateAgentConfig('', { commandsEnabled: true }),
- ).rejects.toThrow('Agent ID is required to update agent config.');
+ await expect(MonitoringAPI.updateAgentConfig('', { commandsEnabled: true })).rejects.toThrow(
+ 'Agent ID is required to update agent config.',
+ );
expect(fetchMock).not.toHaveBeenCalled();
});
diff --git a/frontend-modern/src/api/__tests__/monitoring.test.ts b/frontend-modern/src/api/__tests__/monitoring.test.ts
index 585135604f..d4d334d39d 100644
--- a/frontend-modern/src/api/__tests__/monitoring.test.ts
+++ b/frontend-modern/src/api/__tests__/monitoring.test.ts
@@ -146,7 +146,9 @@ describe('MonitoringAPI', () => {
it('treats 404 as idempotent success', async () => {
vi.mocked(apiFetch).mockResolvedValueOnce({ ok: false, status: 404 } as unknown as Response);
- await expect(MonitoringAPI.markDockerRuntimePendingUninstall('agent-1')).resolves.toBeUndefined();
+ await expect(
+ MonitoringAPI.markDockerRuntimePendingUninstall('agent-1'),
+ ).resolves.toBeUndefined();
});
});
@@ -187,7 +189,6 @@ describe('MonitoringAPI', () => {
});
});
-
describe('agent management', () => {
it('deletes agent via unified backend route', async () => {
vi.mocked(apiFetch).mockResolvedValueOnce({
@@ -456,5 +457,4 @@ describe('MonitoringAPI', () => {
expect(result).toEqual({ success: true, commandId: 'cmd-2' });
});
});
-
});
diff --git a/frontend-modern/src/api/__tests__/nodes.test.ts b/frontend-modern/src/api/__tests__/nodes.test.ts
index 325c3d1fb6..04476a9c38 100644
--- a/frontend-modern/src/api/__tests__/nodes.test.ts
+++ b/frontend-modern/src/api/__tests__/nodes.test.ts
@@ -260,7 +260,10 @@ describe('NodesAPI', () => {
describe('getAgentInstallCommand', () => {
it('gets agent install command', async () => {
- vi.mocked(apiFetchJSON).mockResolvedValueOnce({ command: ' curl ... ', token: 'secret-token' });
+ vi.mocked(apiFetchJSON).mockResolvedValueOnce({
+ command: ' curl ... ',
+ token: 'secret-token',
+ });
const result = await NodesAPI.getAgentInstallCommand({
type: 'pve',
@@ -350,7 +353,8 @@ describe('NodesAPI', () => {
type: ' pve ',
host: ' https://pve.example:8006 ',
url: ' https://pulse.example/api/setup-script?type=pve ',
- downloadURL: ' https://pulse.example/api/setup-script?type=pve&setup_token=setup-token-123 ',
+ downloadURL:
+ ' https://pulse.example/api/setup-script?type=pve&setup_token=setup-token-123 ',
scriptFileName: ' pulse-setup-pve.sh ',
command: ' curl pve ... ',
commandWithEnv: ' curl env pve ... ',
@@ -546,7 +550,8 @@ describe('NodesAPI', () => {
type: 'pve',
host: 'https://pve.example:8006',
url: 'https://pulse.example/base/api/setup-script?type=pve',
- downloadURL: 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
+ downloadURL:
+ 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
scriptFileName: 'pulse-setup-pve.sh',
command: 'curl pve ...',
commandWithEnv: 'curl env pve ...',
@@ -580,7 +585,8 @@ describe('NodesAPI', () => {
type: 'pbs',
host: 'pbs.example',
url: 'https://pulse.example/base/api/setup-script?type=pbs',
- downloadURL: 'https://pulse.example/base/api/setup-script?type=pbs&setup_token=pbs-token-123',
+ downloadURL:
+ 'https://pulse.example/base/api/setup-script?type=pbs&setup_token=pbs-token-123',
scriptFileName: 'pulse-setup-pbs.sh',
command: 'curl pbs ...',
commandWithEnv: 'curl env pbs ...',
@@ -615,7 +621,8 @@ describe('NodesAPI', () => {
type: 'pve',
host: 'https://pve.example:8006',
url: 'https://pulse.example/base/api/setup-script?type=pve',
- downloadURL: 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
+ downloadURL:
+ 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
scriptFileName: 'pulse-setup-pve.sh',
command: 'curl pve ...',
commandWithEnv: 'curl env pve ...',
@@ -639,7 +646,8 @@ describe('NodesAPI', () => {
type: 'pve',
host: 'https://pve.example:8006',
url: 'https://pulse.example/base/api/setup-script?type=pve',
- downloadURL: 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
+ downloadURL:
+ 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
scriptFileName: 'pulse-setup-pve.sh',
command: 'curl pve ...',
commandWithEnv: 'curl env pve ...',
@@ -666,7 +674,8 @@ describe('NodesAPI', () => {
type: 'pve',
host: 'https://pve.example:8006',
url: 'https://pulse.example/base/api/setup-script?type=pve',
- downloadURL: 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
+ downloadURL:
+ 'https://pulse.example/base/api/setup-script?type=pve&setup_token=setup-token-123',
scriptFileName: 'pulse-setup-pve.sh',
command: 'curl pve ...',
commandWithEnv: 'curl env pve ...',
diff --git a/frontend-modern/src/api/__tests__/notifications.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/notifications.branchcov0718.test.ts
index 0e1706c0e1..7efa7b2d49 100644
--- a/frontend-modern/src/api/__tests__/notifications.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/notifications.branchcov0718.test.ts
@@ -333,13 +333,10 @@ describe('NotificationsAPI — branch coverage (0718)', () => {
const result = await NotificationsAPI.testWebhook(webhook);
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/notifications/webhooks/test',
- {
- method: 'POST',
- body: JSON.stringify(webhook),
- },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/notifications/webhooks/test', {
+ method: 'POST',
+ body: JSON.stringify(webhook),
+ });
expect(parseBody(apiFetchJSONMock.mock.calls[0])).toEqual(webhook);
expect(result).toEqual({ success: true, message: 'ok' });
});
diff --git a/frontend-modern/src/api/__tests__/onboarding.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/onboarding.branchcov0718.test.ts
index 05db3848c5..cb08271b1e 100644
--- a/frontend-modern/src/api/__tests__/onboarding.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/onboarding.branchcov0718.test.ts
@@ -112,5 +112,4 @@ describe('OnboardingAPI – branch coverage', () => {
expect(caught?.diagnostics).toEqual([]);
});
});
-
});
diff --git a/frontend-modern/src/api/__tests__/onboarding.test.ts b/frontend-modern/src/api/__tests__/onboarding.test.ts
index 351592791b..44046e4f19 100644
--- a/frontend-modern/src/api/__tests__/onboarding.test.ts
+++ b/frontend-modern/src/api/__tests__/onboarding.test.ts
@@ -63,7 +63,8 @@ describe('OnboardingAPI', () => {
{
code: 'instance_url_not_https',
severity: 'warning',
- message: 'Pulse web link is not included in this pairing code because the resolved Pulse URL is not HTTPS.',
+ message:
+ 'Pulse web link is not included in this pairing code because the resolved Pulse URL is not HTTPS.',
field: 'instance_url',
},
],
diff --git a/frontend-modern/src/api/__tests__/patrol.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/patrol.branchcov0718.test.ts
index 750f8307f6..48740b4cf6 100644
--- a/frontend-modern/src/api/__tests__/patrol.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/patrol.branchcov0718.test.ts
@@ -251,9 +251,7 @@ describe('patrol api — uncovered branch coverage', () => {
const result = await getInvestigation('finding-inv');
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/ai/findings/finding-inv/investigation',
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/ai/findings/finding-inv/investigation');
expect(result).toEqual(investigation);
expect(result.outcome).toBe('fix_verified');
});
@@ -325,10 +323,9 @@ describe('patrol api — uncovered branch coverage', () => {
// Note: no body key is set — this is the no-body branch (unlike the
// other finding mutations which always carry a JSON body).
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/ai/findings/finding-re/reinvestigate',
- { method: 'POST' },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/ai/findings/finding-re/reinvestigate', {
+ method: 'POST',
+ });
expect(result).toEqual({ success: true, message: 'Reinvestigation queued' });
});
diff --git a/frontend-modern/src/api/__tests__/patrol.test.ts b/frontend-modern/src/api/__tests__/patrol.test.ts
index 9c371d7a25..6076227922 100644
--- a/frontend-modern/src/api/__tests__/patrol.test.ts
+++ b/frontend-modern/src/api/__tests__/patrol.test.ts
@@ -31,10 +31,10 @@ describe('patrol api', () => {
it('uses server acknowledgement and activation endpoints for Autopilot', async () => {
await createPatrolAutopilotAcknowledgement('ack/one');
- expect(apiFetchJSONMock).toHaveBeenLastCalledWith(
- '/api/ai/patrol/autonomy/acknowledgements',
- { method: 'POST', body: JSON.stringify({ acknowledgement_id: 'ack/one' }) },
- );
+ expect(apiFetchJSONMock).toHaveBeenLastCalledWith('/api/ai/patrol/autonomy/acknowledgements', {
+ method: 'POST',
+ body: JSON.stringify({ acknowledgement_id: 'ack/one' }),
+ });
await updatePatrolAutonomySettings({
autonomy_level: 'full',
@@ -511,7 +511,10 @@ describe('triggerPatrolRun scope body', () => {
beforeEach(() => {
apiFetchJSONMock.mockReset();
- apiFetchJSONMock.mockResolvedValue({ success: true, message: 'Triggered targeted Patrol check' });
+ apiFetchJSONMock.mockResolvedValue({
+ success: true,
+ message: 'Triggered targeted Patrol check',
+ });
});
it('sends no body for a fleet-wide run', async () => {
diff --git a/frontend-modern/src/api/__tests__/resourceOperatorState.test.ts b/frontend-modern/src/api/__tests__/resourceOperatorState.test.ts
index 1a6d97b5e9..561c662a46 100644
--- a/frontend-modern/src/api/__tests__/resourceOperatorState.test.ts
+++ b/frontend-modern/src/api/__tests__/resourceOperatorState.test.ts
@@ -39,9 +39,7 @@ describe('resourceOperatorState api', () => {
});
it('returns null when the server reports operator_state_not_set as 404', async () => {
- apiFetchJSONMock.mockRejectedValueOnce(
- Object.assign(new Error('Not found'), { status: 404 }),
- );
+ apiFetchJSONMock.mockRejectedValueOnce(Object.assign(new Error('Not found'), { status: 404 }));
await expect(getResourceOperatorState('vm:101')).resolves.toBeNull();
});
@@ -98,9 +96,8 @@ describe('resourceOperatorState api', () => {
apiFetchJSONMock.mockResolvedValueOnce(undefined as never);
await expect(clearResourceOperatorState('vm:101')).resolves.toBeUndefined();
- expect(apiFetchJSONMock).toHaveBeenCalledWith(
- '/api/resources/vm%3A101/operator-state',
- { method: 'DELETE' },
- );
+ expect(apiFetchJSONMock).toHaveBeenCalledWith('/api/resources/vm%3A101/operator-state', {
+ method: 'DELETE',
+ });
});
});
diff --git a/frontend-modern/src/api/__tests__/responseUtils.coverage.test.ts b/frontend-modern/src/api/__tests__/responseUtils.coverage.test.ts
index 4926b52e6b..e77801b931 100644
--- a/frontend-modern/src/api/__tests__/responseUtils.coverage.test.ts
+++ b/frontend-modern/src/api/__tests__/responseUtils.coverage.test.ts
@@ -105,7 +105,9 @@ describe('responseUtils pure coercion and guards', () => {
expect(apiResponseStatus({ status: null })).toBeNull();
expect(apiResponseStatus(null)).toBeNull();
expect(apiResponseStatus(undefined)).toBeNull();
- expect(apiResponseStatus(200 as unknown as Parameters<typeof apiResponseStatus>[0])).toBeNull();
+ expect(
+ apiResponseStatus(200 as unknown as Parameters<typeof apiResponseStatus>[0]),
+ ).toBeNull();
});
});
diff --git a/frontend-modern/src/api/__tests__/responseUtils.test.ts b/frontend-modern/src/api/__tests__/responseUtils.test.ts
index 97100b56d2..76bc239034 100644
--- a/frontend-modern/src/api/__tests__/responseUtils.test.ts
+++ b/frontend-modern/src/api/__tests__/responseUtils.test.ts
@@ -17,5 +17,4 @@ describe('responseUtils structured API errors', () => {
'VMware vCenter 6.7 is below the supported VI JSON release floor',
);
});
-
});
diff --git a/frontend-modern/src/api/__tests__/streaming.test.ts b/frontend-modern/src/api/__tests__/streaming.test.ts
index 2ec1edffe7..689621a220 100644
--- a/frontend-modern/src/api/__tests__/streaming.test.ts
+++ b/frontend-modern/src/api/__tests__/streaming.test.ts
@@ -238,9 +238,7 @@ describe('consumeJSONEventStream', () => {
it('surfaces stalled read timeouts without reporting normal completion', async () => {
vi.useFakeTimers();
- const read = vi.fn(
- () => new Promise<ReadableStreamReadResult<Uint8Array>>(() => undefined),
- );
+ const read = vi.fn(() => new Promise<ReadableStreamReadResult<Uint8Array>>(() => undefined));
const releaseLock = vi.fn();
const onEvent = vi.fn();
const onTimeout = vi.fn();
diff --git a/frontend-modern/src/api/__tests__/truenas.branchcov0718.test.ts b/frontend-modern/src/api/__tests__/truenas.branchcov0718.test.ts
index ebd3e3b7b8..a8329584b1 100644
--- a/frontend-modern/src/api/__tests__/truenas.branchcov0718.test.ts
+++ b/frontend-modern/src/api/__tests__/truenas.branchcov0718.test.ts
@@ -162,10 +162,9 @@ describe('TrueNASAPI preview* branch coverage', () => {
await TrueNASAPI.previewSavedConnection('conn/with slash');
- expect(mock).toHaveBeenCalledWith(
- '/api/truenas/connections/conn%2Fwith%20slash/preview',
- { method: 'POST' },
- );
+ expect(mock).toHaveBeenCalledWith('/api/truenas/connections/conn%2Fwith%20slash/preview', {
+ method: 'POST',
+ });
});
it('includes the serialized body when an input override is provided', async () => {
@@ -241,9 +240,7 @@ describe('TrueNASAPI preview* branch coverage', () => {
additional_count: 1,
effect: 'creates_new',
current_systems: [],
- projected_systems: [
- { name: 'solo', type: 'truenas', status: 'online', source: 'truenas' },
- ],
+ projected_systems: [{ name: 'solo', type: 'truenas', status: 'online', source: 'truenas' }],
projected_system: undefined,
});
diff --git a/frontend-modern/src/api/agentCapabilities.ts b/frontend-modern/src/api/agentCapabilities.ts
index 415b6b8080..7ac2a15879 100644
--- a/frontend-modern/src/api/agentCapabilities.ts
+++ b/frontend-modern/src/api/agentCapabilities.ts
@@ -71,11 +71,7 @@ export type AgentOperationsLoopNextAction =
export type AgentOperationsLoopStepStatus = 'complete' | 'current' | 'pending';
export type AgentOperationsLoopProActivationValueProofState =
- | 'not_started'
- | 'in_progress'
- | 'governed_decision_recorded'
- | 'verified_needs_mcp'
- | 'verified';
+ 'not_started' | 'in_progress' | 'governed_decision_recorded' | 'verified_needs_mcp' | 'verified';
export type AgentOperationsLoopPatrolControlValueState =
AgentOperationsLoopProActivationValueProofState;
diff --git a/frontend-modern/src/api/agentProfiles.ts b/frontend-modern/src/api/agentProfiles.ts
index 04adaffc98..a6c9d7a2e3 100644
--- a/frontend-modern/src/api/agentProfiles.ts
+++ b/frontend-modern/src/api/agentProfiles.ts
@@ -75,12 +75,10 @@ export interface ConfigValidationResult {
export const MISSING_AGENT_PROFILE_ASSIGNMENT_MESSAGE =
'Selected profile no longer exists. Refresh and choose another profile.';
-export const INVALID_AGENT_PROFILE_LIST_MESSAGE =
- 'Invalid agent profile list response from Pulse.';
+export const INVALID_AGENT_PROFILE_LIST_MESSAGE = 'Invalid agent profile list response from Pulse.';
export const INVALID_AGENT_PROFILE_ASSIGNMENT_LIST_MESSAGE =
'Invalid agent profile assignment list response from Pulse.';
-export const INVALID_AGENT_PROFILE_RESPONSE_MESSAGE =
- 'Invalid agent profile response from Pulse.';
+export const INVALID_AGENT_PROFILE_RESPONSE_MESSAGE = 'Invalid agent profile response from Pulse.';
export const INVALID_AGENT_PROFILE_SUGGESTION_MESSAGE =
'Invalid agent profile suggestion response from Pulse.';
export const INVALID_AGENT_PROFILE_SCHEMA_MESSAGE =
@@ -163,10 +161,7 @@ export class AgentProfilesAPI {
return value;
}
- private static requireArrayResponse<T>(
- response: unknown,
- invalidMessage: string,
- ): T[] {
+ private static requireArrayResponse<T>(response: unknown, invalidMessage: string): T[] {
if (!Array.isArray(response)) {
throw new Error(invalidMessage);
}
@@ -234,9 +229,8 @@ export class AgentProfilesAPI {
402,
[],
);
- return arrayOrEmpty<AgentProfile>(response).map(
- (profile) =>
- this.requireAgentProfileResponse(profile, INVALID_AGENT_PROFILE_LIST_MESSAGE),
+ return arrayOrEmpty<AgentProfile>(response).map((profile) =>
+ this.requireAgentProfileResponse(profile, INVALID_AGENT_PROFILE_LIST_MESSAGE),
);
}
@@ -430,7 +424,11 @@ export class AgentProfilesAPI {
return {
key: this.requireStringField(def, 'Key', INVALID_AGENT_PROFILE_SCHEMA_MESSAGE),
type: this.requireStringField(def, 'Type', INVALID_AGENT_PROFILE_SCHEMA_MESSAGE),
- description: this.requireStringField(def, 'Description', INVALID_AGENT_PROFILE_SCHEMA_MESSAGE),
+ description: this.requireStringField(
+ def,
+ 'Description',
+ INVALID_AGENT_PROFILE_SCHEMA_MESSAGE,
+ ),
defaultValue: def.Default,
required: (() => {
const value = def.Required;
@@ -441,20 +439,25 @@ export class AgentProfilesAPI {
})(),
min: this.requireOptionalNumberField(def, 'Min', INVALID_AGENT_PROFILE_SCHEMA_MESSAGE),
max: this.requireOptionalNumberField(def, 'Max', INVALID_AGENT_PROFILE_SCHEMA_MESSAGE),
- pattern: this.requireOptionalStringField(def, 'Pattern', INVALID_AGENT_PROFILE_SCHEMA_MESSAGE),
+ pattern: this.requireOptionalStringField(
+ def,
+ 'Pattern',
+ INVALID_AGENT_PROFILE_SCHEMA_MESSAGE,
+ ),
enum: (() => {
const value = def.Enum;
if (value === undefined || value === null) {
return undefined;
}
- return this.requireArrayResponse<unknown>(value, INVALID_AGENT_PROFILE_SCHEMA_MESSAGE).map(
- (entry) => {
- if (typeof entry !== 'string') {
- throw new Error(INVALID_AGENT_PROFILE_SCHEMA_MESSAGE);
- }
- return entry;
- },
- );
+ return this.requireArrayResponse<unknown>(
+ value,
+ INVALID_AGENT_PROFILE_SCHEMA_MESSAGE,
+ ).map((entry) => {
+ if (typeof entry !== 'string') {
+ throw new Error(INVALID_AGENT_PROFILE_SCHEMA_MESSAGE);
+ }
+ return entry;
+ });
})(),
};
});
@@ -464,14 +467,11 @@ export class AgentProfilesAPI {
* Validate a config without saving.
*/
static async validateConfig(config: Record<string, unknown>): Promise<ConfigValidationResult> {
- const response = await apiFetch(
- `${this.baseUrl}/validate`,
- {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify(config),
- },
- );
+ const response = await apiFetch(`${this.baseUrl}/validate`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(config),
+ });
await assertAPIResponseOK(response, 'Failed to validate profile config');
const parsed = await parseRequiredJSON<ConfigValidationResultResponse>(
response,
diff --git a/frontend-modern/src/api/alerts.ts b/frontend-modern/src/api/alerts.ts
index 4bb07a049d..fc4c5426b5 100644
--- a/frontend-modern/src/api/alerts.ts
+++ b/frontend-modern/src/api/alerts.ts
@@ -30,7 +30,10 @@ export class AlertsAPI {
return apiFetchJSON(`${this.baseUrl}/history?${queryParams}`);
}
- static async getIncidentTimeline(alertIdentifier: string, startedAt?: string): Promise<Incident | null> {
+ static async getIncidentTimeline(
+ alertIdentifier: string,
+ startedAt?: string,
+ ): Promise<Incident | null> {
const query = new URLSearchParams({ alertIdentifier });
if (startedAt) {
query.set('started_at', startedAt);
diff --git a/frontend-modern/src/api/charts.ts b/frontend-modern/src/api/charts.ts
index 0c20320fb3..21261293ef 100644
--- a/frontend-modern/src/api/charts.ts
+++ b/frontend-modern/src/api/charts.ts
@@ -71,13 +71,7 @@ export interface InfrastructureChartsResponse {
}
export type InfrastructureSummaryMetric =
- | 'cpu'
- | 'memory'
- | 'disk'
- | 'diskread'
- | 'diskwrite'
- | 'netin'
- | 'netout';
+ 'cpu' | 'memory' | 'disk' | 'diskread' | 'diskwrite' | 'netin' | 'netout';
export interface WorkloadChartsResponse {
data: Record<string, ChartData>;
@@ -143,16 +137,7 @@ export interface StorageSummaryTrendResponse {
}
// Persistent metrics history types (SQLite-backed, longer retention)
-export type HistoryTimeRange =
- | '30m'
- | '1h'
- | '6h'
- | '12h'
- | '24h'
- | '7d'
- | '14d'
- | '30d'
- | '90d';
+export type HistoryTimeRange = '30m' | '1h' | '6h' | '12h' | '24h' | '7d' | '14d' | '30d' | '90d';
type MetricsHistoryAPIResourceType =
| 'vm'
| 'system-container'
diff --git a/frontend-modern/src/api/connections.ts b/frontend-modern/src/api/connections.ts
index b481306588..ff69fa819c 100644
--- a/frontend-modern/src/api/connections.ts
+++ b/frontend-modern/src/api/connections.ts
@@ -2,23 +2,10 @@ import { apiFetchJSON } from '@/utils/apiClient';
import { MonitoringAPI } from './monitoring';
export type ConnectionType =
- | 'pve'
- | 'pbs'
- | 'pmg'
- | 'vmware'
- | 'truenas'
- | 'availability'
- | 'agent'
- | 'docker'
- | 'kubernetes';
+ 'pve' | 'pbs' | 'pmg' | 'vmware' | 'truenas' | 'availability' | 'agent' | 'docker' | 'kubernetes';
export type ConnectionState =
- | 'active'
- | 'paused'
- | 'unauthorized'
- | 'unreachable'
- | 'stale'
- | 'pending';
+ 'active' | 'paused' | 'unauthorized' | 'unreachable' | 'stale' | 'pending';
export type ConnectionSource = 'manual' | 'agent' | 'script';
@@ -26,11 +13,7 @@ export type ConnectionFleetEnrollmentState = 'configured' | 'enrolled' | 'paused
export type ConnectionFleetLivenessState = ConnectionState;
export type ConnectionFleetVersionDrift = 'behind' | 'current' | 'unknown' | 'not-applicable';
export type ConnectionFleetAdapterHealth =
- | 'blocked'
- | 'degraded'
- | 'healthy'
- | 'paused'
- | 'unknown';
+ 'blocked' | 'degraded' | 'healthy' | 'paused' | 'unknown';
export type ConnectionFleetConfigRollout = 'configured' | 'paused' | 'reported' | 'unknown';
export type ConnectionFleetCredentialStatus = 'invalid' | 'paused' | 'unknown' | 'verified';
export type ConnectionFleetUpdateStatus =
@@ -44,45 +27,17 @@ export type ConnectionFleetUpdateStatus =
| 'updating';
export type ConnectionFleetRemoteControl = 'disabled' | 'enabled' | 'not-applicable' | 'unknown';
export type ConnectionFleetConfigDriftStatus =
- | 'current'
- | 'drifted'
- | 'not-applicable'
- | 'paused'
- | 'pending'
- | 'unknown';
+ 'current' | 'drifted' | 'not-applicable' | 'paused' | 'pending' | 'unknown';
export type ConnectionFleetRolloutStatus =
- | 'blocked'
- | 'current'
- | 'not-applicable'
- | 'paused'
- | 'pending'
- | 'unknown';
+ 'blocked' | 'current' | 'not-applicable' | 'paused' | 'pending' | 'unknown';
export type ConnectionFleetCredentialHealthStatus =
- | 'expired'
- | 'expiring'
- | 'invalid'
- | 'not-applicable'
- | 'paused'
- | 'unknown'
- | 'verified';
+ 'expired' | 'expiring' | 'invalid' | 'not-applicable' | 'paused' | 'unknown' | 'verified';
export type ConnectionFleetCommandPolicyStatus =
- | 'blocked'
- | 'disabled'
- | 'enabled'
- | 'not-applicable'
- | 'unknown';
+ 'blocked' | 'disabled' | 'enabled' | 'not-applicable' | 'unknown';
export type ConnectionFleetCommandPolicyState =
- | 'disabled'
- | 'enabled'
- | 'not-applicable'
- | 'unknown';
+ 'disabled' | 'enabled' | 'not-applicable' | 'unknown';
export type ConnectionFleetCommandPolicyEnforcement =
- | 'blocked'
- | 'drifted'
- | 'in-sync'
- | 'not-applicable'
- | 'pending'
- | 'unknown';
+ 'blocked' | 'drifted' | 'in-sync' | 'not-applicable' | 'pending' | 'unknown';
export interface ConnectionFleetConfigFingerprint {
version: string;
diff --git a/frontend-modern/src/api/maintenanceVerification.ts b/frontend-modern/src/api/maintenanceVerification.ts
index b2c4050bd8..6177eb1507 100644
--- a/frontend-modern/src/api/maintenanceVerification.ts
+++ b/frontend-modern/src/api/maintenanceVerification.ts
@@ -15,10 +15,7 @@ import { apiFetchJSON } from '@/utils/apiClient';
* - pending → in-flight; the sentinel hasn't decided
*/
export type MaintenanceVerificationStatus =
- | 'pending'
- | 'healthy'
- | 'needs_review'
- | 'failed_verification';
+ 'pending' | 'healthy' | 'needs_review' | 'failed_verification';
export type MaintenanceVerificationUserOutcome = 'reviewed' | '';
diff --git a/frontend-modern/src/api/monitoring.ts b/frontend-modern/src/api/monitoring.ts
index 926506dfdd..7582cf33cd 100644
--- a/frontend-modern/src/api/monitoring.ts
+++ b/frontend-modern/src/api/monitoring.ts
@@ -139,11 +139,7 @@ export class MonitoringAPI {
static async setDockerRuntimeDisplayName(agentId: string, displayName: string): Promise<void> {
const url = `${this.baseUrl}/agents/docker/runtimes/${encodeURIComponent(agentId)}/display-name`;
- await setResourceDisplayName(
- url,
- displayName,
- 'Docker / Podman agent not found',
- );
+ await setResourceDisplayName(url, displayName, 'Docker / Podman agent not found');
}
static async allowDockerRuntimeReenroll(agentId: string): Promise<void> {
@@ -176,11 +172,7 @@ export class MonitoringAPI {
displayName: string,
): Promise<void> {
const url = `${this.baseUrl}/agents/kubernetes/clusters/${encodeURIComponent(clusterId)}/display-name`;
- await setResourceDisplayName(
- url,
- displayName,
- 'Kubernetes cluster not found',
- );
+ await setResourceDisplayName(url, displayName, 'Kubernetes cluster not found');
}
static async allowKubernetesClusterReenroll(clusterId: string): Promise<void> {
diff --git a/frontend-modern/src/api/nodes.ts b/frontend-modern/src/api/nodes.ts
index 1e9bce691d..f785bc88cf 100644
--- a/frontend-modern/src/api/nodes.ts
+++ b/frontend-modern/src/api/nodes.ts
@@ -28,7 +28,8 @@ const normalizeClusterEndpoint = (endpoint: RawClusterEndpoint): ClusterEndpoint
const nodeHasClusterEndpoints = (
node: NodeConfig,
-): node is NodeConfig & { type: 'pve'; clusterEndpoints?: RawClusterEndpoint[] } => node.type === 'pve';
+): node is NodeConfig & { type: 'pve'; clusterEndpoints?: RawClusterEndpoint[] } =>
+ node.type === 'pve';
const normalizeNodeConfig = (node: NodeConfig): NodeConfig => {
if (!nodeHasClusterEndpoints(node)) return node;
@@ -250,10 +251,13 @@ export class NodesAPI {
enableProxmox: boolean;
enableCommands?: boolean;
}): Promise<AgentInstallCommandResponse> {
- const response = await apiFetchJSON<RawAgentInstallCommandResponse>('/api/agent-install-command', {
- method: 'POST',
- body: JSON.stringify(params),
- });
+ const response = await apiFetchJSON<RawAgentInstallCommandResponse>(
+ '/api/agent-install-command',
+ {
+ method: 'POST',
+ body: JSON.stringify(params),
+ },
+ );
return normalizeAgentInstallCommandResponse(response);
}
diff --git a/frontend-modern/src/api/streaming.ts b/frontend-modern/src/api/streaming.ts
index 13b73edb5e..bf2b5efeee 100644
--- a/frontend-modern/src/api/streaming.ts
+++ b/frontend-modern/src/api/streaming.ts
@@ -41,10 +41,7 @@ const yieldToBrowserPaint = () =>
});
});
-const shouldYieldAfterEvent = <T,>(
- event: T,
- options: JSONEventStreamOptions<T>,
-) => {
+const shouldYieldAfterEvent = <T>(event: T, options: JSONEventStreamOptions<T>) => {
if (!options.yieldBetweenEvents) return false;
if (typeof options.yieldBetweenEvents === 'function') {
return options.yieldBetweenEvents(event);
diff --git a/frontend-modern/src/api/truenas.ts b/frontend-modern/src/api/truenas.ts
index d277ee1f99..dbfe8e1726 100644
--- a/frontend-modern/src/api/truenas.ts
+++ b/frontend-modern/src/api/truenas.ts
@@ -236,7 +236,9 @@ export class TrueNASAPI {
`${TRUE_NAS_CONNECTIONS_PATH}/${encodeURIComponent(id)}/test`,
{
method: 'POST',
- ...(input !== undefined ? { body: JSON.stringify(serializeTrueNASConnectionInput(input)) } : {}),
+ ...(input !== undefined
+ ? { body: JSON.stringify(serializeTrueNASConnectionInput(input)) }
+ : {}),
},
);
return {
diff --git a/frontend-modern/src/components/AI/AICostDashboard.tsx b/frontend-modern/src/components/AI/AICostDashboard.tsx
index 5887d20bbf..0461483f72 100644
--- a/frontend-modern/src/components/AI/AICostDashboard.tsx
+++ b/frontend-modern/src/components/AI/AICostDashboard.tsx
@@ -382,7 +382,11 @@ export const AICostDashboard: Component = () => {
<div class="text-lg font-semibold text-base-content">
<Show
when={estimatedTotalUSD() != null}
- fallback={<span class="text-muted" aria-hidden="true">—</span>}
+ fallback={
+ <span class="text-muted" aria-hidden="true">
+ —
+ </span>
+ }
>
{formatUSD(estimatedTotalUSD() ?? 0)}
</Show>
@@ -394,7 +398,11 @@ export const AICostDashboard: Component = () => {
<div class="text-lg font-semibold text-base-content mt-0.5">
<Show
when={parsedBudgetUSD30d() != null}
- fallback={<span class="text-muted" aria-hidden="true">—</span>}
+ fallback={
+ <span class="text-muted" aria-hidden="true">
+ —
+ </span>
+ }
>
{formatUSD(parsedBudgetUSD30d() ?? 0)}
</Show>
@@ -481,7 +489,15 @@ export const AICostDashboard: Component = () => {
<div class="text-xs text-muted">
USD is an estimate based on public list prices. It may differ from billing.
<Show when={unpricedProviderModels().length > 0}>
- <span class="ml-2" title={`Pricing unknown for:\n${unpricedProviderModels().map((pm) => `${getAIProviderDisplayName(pm.provider) || pm.provider}/${pm.model}`).join('\n')}`}>
+ <span
+ class="ml-2"
+ title={`Pricing unknown for:\n${unpricedProviderModels()
+ .map(
+ (pm) =>
+ `${getAIProviderDisplayName(pm.provider) || pm.provider}/${pm.model}`,
+ )
+ .join('\n')}`}
+ >
Estimated spend is partial — {unpricedProviderModels().length} model
{unpricedProviderModels().length === 1 ? '' : 's'} have unknown pricing.
</span>
@@ -547,7 +563,11 @@ export const AICostDashboard: Component = () => {
<TableCell class="py-2 px-2 text-right text-base-content">
<Show
when={pm.pricing_known}
- fallback={<span class="text-muted" aria-hidden="true">—</span>}
+ fallback={
+ <span class="text-muted" aria-hidden="true">
+ —
+ </span>
+ }
>
{formatUSD(pm.estimated_usd ?? 0)}
</Show>
diff --git a/frontend-modern/src/components/AI/Chat/MessageItem.tsx b/frontend-modern/src/components/AI/Chat/MessageItem.tsx
index af9c22cc2a..107738fc3e 100644
--- a/frontend-modern/src/components/AI/Chat/MessageItem.tsx
+++ b/frontend-modern/src/components/AI/Chat/MessageItem.tsx
@@ -28,10 +28,7 @@ import { stripAssistantOutputArtifacts } from './assistantOutputHygiene';
import { formatAssistantTurnDuration } from './assistantTurnSummary';
import { assistantWorkflowStatusKind, formatAssistantWorkflowStatus } from './activeTurnStatus';
import { groupStreamEventsForDisplay } from './streamEventGrouping';
-import {
- createPacedWorkflowStatus,
- WORKFLOW_STATUS_REFRESH_MS,
-} from './workflowStatusDisplay';
+import { createPacedWorkflowStatus, WORKFLOW_STATUS_REFRESH_MS } from './workflowStatusDisplay';
import type {
ChatMessage,
ModelRouteRecoveryOption,
@@ -241,7 +238,9 @@ const AssistantMarkdownBlock: Component<{
}
});
- return <div ref={container} class={markdownClass} aria-live={props.streaming ? 'polite' : undefined} />;
+ return (
+ <div ref={container} class={markdownClass} aria-live={props.streaming ? 'polite' : undefined} />
+ );
};
/**
@@ -286,9 +285,7 @@ export const MessageItem: Component<MessageItemProps> = (props) => {
if (!isSelectedModelRouteEvent(evt)) return true;
const hasRouteSwitch = (props.message.streamEvents || []).some(
(event) =>
- event.type === 'model_switch' &&
- !!event.model?.trim() &&
- !isSelectedModelRouteEvent(event),
+ event.type === 'model_switch' && !!event.model?.trim() && !isSelectedModelRouteEvent(event),
);
return (
hasRouteSwitch || !messageModelLabel() || modelRouteLabel(evt.model) !== messageModelLabel()
@@ -382,12 +379,7 @@ export const MessageItem: Component<MessageItemProps> = (props) => {
);
const workflowStatusPaceSequenceKey = createMemo(() => {
const first = liveWorkflowStatusHistory()[0];
- return [
- props.message.id,
- first?.phase,
- first?.message,
- first?.startedAt,
- ]
+ return [props.message.id, first?.phase, first?.message, first?.startedAt]
.map((value) => String(value ?? ''))
.join(':');
});
@@ -493,9 +485,7 @@ export const MessageItem: Component<MessageItemProps> = (props) => {
if (kind === 'tool') return 'bg-blue-500';
return 'bg-blue-500';
};
- const workflowStatusText = createMemo(() =>
- formatWorkflowStatus(currentWorkflowStatus(), true),
- );
+ const workflowStatusText = createMemo(() => formatWorkflowStatus(currentWorkflowStatus(), true));
// Workflow status is footer-owned (the activity dock in index.tsx), never shown
// in the transcript — not as a per-event row (shouldRenderWorkflowStatusEvent)
// and not as this early-phase header chip. During the empty-content window the
@@ -779,7 +769,9 @@ export const MessageItem: Component<MessageItemProps> = (props) => {
</div>
</Match>
- <Match when={evt()?.type === 'pending_tool' ? evt().pendingTool : undefined}>
+ <Match
+ when={evt()?.type === 'pending_tool' ? evt().pendingTool : undefined}
+ >
{(pendingTool) => <PendingToolBlock tool={pendingTool()} />}
</Match>
diff --git a/frontend-modern/src/components/AI/Chat/SlashCommandAutocomplete.tsx b/frontend-modern/src/components/AI/Chat/SlashCommandAutocomplete.tsx
index ce26ffbdc5..29fddef07a 100644
--- a/frontend-modern/src/components/AI/Chat/SlashCommandAutocomplete.tsx
+++ b/frontend-modern/src/components/AI/Chat/SlashCommandAutocomplete.tsx
@@ -179,11 +179,7 @@ export function SlashCommandAutocomplete(props: SlashCommandAutocompleteProps) {
aria-selected={item.index === selectedIndex()}
aria-disabled={command.disabled ? 'true' : undefined}
aria-label={`${
- command.disabled
- ? 'Unavailable'
- : command.insertText
- ? 'Insert'
- : 'Run'
+ command.disabled ? 'Unavailable' : command.insertText ? 'Insert' : 'Run'
} /${command.name}: ${command.description}${
command.disabledReason ? `. ${command.disabledReason}` : ''
}`}
@@ -191,9 +187,7 @@ export function SlashCommandAutocomplete(props: SlashCommandAutocompleteProps) {
command.disabled
? 'cursor-not-allowed opacity-60'
: 'hover:bg-surface-hover'
- } ${
- item.index === selectedIndex() ? 'bg-surface-hover' : ''
- }`}
+ } ${item.index === selectedIndex() ? 'bg-surface-hover' : ''}`}
onClick={(event) => {
event.stopPropagation();
selectCommand(command);
diff --git a/frontend-modern/src/components/AI/Chat/ThinkingBlock.tsx b/frontend-modern/src/components/AI/Chat/ThinkingBlock.tsx
index be5bd7f9e0..7d503616c5 100644
--- a/frontend-modern/src/components/AI/Chat/ThinkingBlock.tsx
+++ b/frontend-modern/src/components/AI/Chat/ThinkingBlock.tsx
@@ -64,7 +64,11 @@ export const ThinkingBlock: Component<ThinkingBlockProps> = (props) => {
<span class="min-w-0 truncate">
{statusText()}
<span class="text-muted/80">
- {durationLabel() ? (props.isStreaming ? ` (${durationLabel()})` : ` · ${durationLabel()}`) : ''}
+ {durationLabel()
+ ? props.isStreaming
+ ? ` (${durationLabel()})`
+ : ` · ${durationLabel()}`
+ : ''}
</span>
</span>
</div>
diff --git a/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx b/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx
index e14aae332b..225ba02cd6 100644
--- a/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx
+++ b/frontend-modern/src/components/AI/Chat/ToolExecutionBlock.tsx
@@ -454,120 +454,120 @@ export const ToolExecutionBlock: Component<ToolExecutionBlockProps> = (props) =>
</Show>
</div>
}
- >
- <div
- class="my-2 overflow-hidden rounded-md border border-border-subtle bg-surface text-[11px] shadow-sm"
- role={settlingFastCompletion() ? 'status' : undefined}
- aria-label={settlingFastCompletion() ? 'Assistant tool running' : undefined}
>
<div
- class={`flex min-w-0 items-start gap-2 px-2.5 py-2 ${
- hasDetails()
- ? 'cursor-pointer transition-colors hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:ring-inset'
- : ''
- }`}
- role={hasDetails() ? 'button' : undefined}
- tabIndex={hasDetails() ? 0 : undefined}
- aria-expanded={hasDetails() ? showDetails() : undefined}
- aria-controls={hasDetails() ? detailsId : undefined}
- title={hasDetails() ? summaryControlTitle() : undefined}
- onClick={toggleDetails}
- onKeyDown={handleSummaryKeyDown}
+ class="my-2 overflow-hidden rounded-md border border-border-subtle bg-surface text-[11px] shadow-sm"
+ role={settlingFastCompletion() ? 'status' : undefined}
+ aria-label={settlingFastCompletion() ? 'Assistant tool running' : undefined}
>
- <div class="pt-0.5">
- <Show
- when={!settlingFastCompletion()}
- fallback={
- <LoaderCircleIcon
- class="h-3.5 w-3.5 shrink-0 animate-spin text-blue-500 dark:text-blue-400"
- aria-label="running"
- />
- }
- >
+ <div
+ class={`flex min-w-0 items-start gap-2 px-2.5 py-2 ${
+ hasDetails()
+ ? 'cursor-pointer transition-colors hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:ring-inset'
+ : ''
+ }`}
+ role={hasDetails() ? 'button' : undefined}
+ tabIndex={hasDetails() ? 0 : undefined}
+ aria-expanded={hasDetails() ? showDetails() : undefined}
+ aria-controls={hasDetails() ? detailsId : undefined}
+ title={hasDetails() ? summaryControlTitle() : undefined}
+ onClick={toggleDetails}
+ onKeyDown={handleSummaryKeyDown}
+ >
+ <div class="pt-0.5">
<Show
- when={props.tool.success}
+ when={!settlingFastCompletion()}
fallback={
- <XCircleIcon
- class={`${getToolCallResultTextClass(props.tool.success)} h-3.5 w-3.5 shrink-0`}
- aria-label={statusLabel()}
+ <LoaderCircleIcon
+ class="h-3.5 w-3.5 shrink-0 animate-spin text-blue-500 dark:text-blue-400"
+ aria-label="running"
/>
}
>
- <CheckCircleIcon
- class={`${getToolCallResultTextClass(props.tool.success)} h-3.5 w-3.5 shrink-0`}
- aria-label={statusLabel()}
- />
+ <Show
+ when={props.tool.success}
+ fallback={
+ <XCircleIcon
+ class={`${getToolCallResultTextClass(props.tool.success)} h-3.5 w-3.5 shrink-0`}
+ aria-label={statusLabel()}
+ />
+ }
+ >
+ <CheckCircleIcon
+ class={`${getToolCallResultTextClass(props.tool.success)} h-3.5 w-3.5 shrink-0`}
+ aria-label={statusLabel()}
+ />
+ </Show>
</Show>
- </Show>
- </div>
+ </div>
- <div class="min-w-0 flex-1">
- <div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
- <span class="shrink-0 font-mono text-[9px] font-semibold uppercase tracking-wider text-muted">
- {toolLabel()}
- </span>
- <span
- class={`shrink-0 rounded border px-1.5 py-0.5 text-[9px] font-medium ${statusPillClass()}`}
- >
- {statusLabel()}
- </span>
- <Show when={durationLabel()}>
- <span
- class="inline-flex shrink-0 items-center gap-1 text-[10px] font-medium text-muted"
- title="Tool duration"
- aria-label={`Tool duration ${durationLabel()}`}
- >
- <ClockIcon class="h-3 w-3" aria-hidden="true" />
- {durationLabel()}
+ <div class="min-w-0 flex-1">
+ <div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
+ <span class="shrink-0 font-mono text-[9px] font-semibold uppercase tracking-wider text-muted">
+ {toolLabel()}
</span>
- </Show>
- <Show when={hasDetails()}>
- <ChevronRightIcon
- class={`h-3.5 w-3.5 shrink-0 text-muted transition-transform ${
- showDetails() ? 'rotate-90' : ''
- }`}
- aria-hidden="true"
- />
- </Show>
- <Show when={hiddenOutputBadgeSummary()}>
<span
- class="shrink-0 rounded border border-border-subtle bg-surface-alt px-1.5 py-0.5 text-[9px] font-medium text-muted"
- title="Open tool details to inspect output"
- aria-label={`Tool output available: ${hiddenOutputBadgeSummary()}`}
+ class={`shrink-0 rounded border px-1.5 py-0.5 text-[9px] font-medium ${statusPillClass()}`}
>
- {hiddenOutputBadgeLabel()}
+ {statusLabel()}
</span>
+ <Show when={durationLabel()}>
+ <span
+ class="inline-flex shrink-0 items-center gap-1 text-[10px] font-medium text-muted"
+ title="Tool duration"
+ aria-label={`Tool duration ${durationLabel()}`}
+ >
+ <ClockIcon class="h-3 w-3" aria-hidden="true" />
+ {durationLabel()}
+ </span>
+ </Show>
+ <Show when={hasDetails()}>
+ <ChevronRightIcon
+ class={`h-3.5 w-3.5 shrink-0 text-muted transition-transform ${
+ showDetails() ? 'rotate-90' : ''
+ }`}
+ aria-hidden="true"
+ />
+ </Show>
+ <Show when={hiddenOutputBadgeSummary()}>
+ <span
+ class="shrink-0 rounded border border-border-subtle bg-surface-alt px-1.5 py-0.5 text-[9px] font-medium text-muted"
+ title="Open tool details to inspect output"
+ aria-label={`Tool output available: ${hiddenOutputBadgeSummary()}`}
+ >
+ {hiddenOutputBadgeLabel()}
+ </span>
+ </Show>
+ </div>
+ <ToolInputSummary summary={inputSummary()} />
+ <Show when={commandPreview()}>
+ <ToolCommandPreview preview={commandPreview()} />
</Show>
</div>
- <ToolInputSummary summary={inputSummary()} />
- <Show when={commandPreview()}>
- <ToolCommandPreview preview={commandPreview()} />
- </Show>
</div>
- </div>
- <Show when={showInlineOutputPreview()}>
- <div class="border-t border-border-subtle bg-surface-alt">
- <div class="px-3 pt-2 text-[9px] font-semibold uppercase tracking-wide text-muted">
- Output preview
+ <Show when={showInlineOutputPreview()}>
+ <div class="border-t border-border-subtle bg-surface-alt">
+ <div class="px-3 pt-2 text-[9px] font-semibold uppercase tracking-wide text-muted">
+ Output preview
+ </div>
+ <pre
+ class="px-3 pb-2 pt-1 font-mono text-[11px] leading-5 text-base-content whitespace-pre-wrap break-words"
+ aria-label="Tool output preview"
+ >
+ {outputPreview()}
+ </pre>
</div>
- <pre
- class="px-3 pb-2 pt-1 font-mono text-[11px] leading-5 text-base-content whitespace-pre-wrap break-words"
- aria-label="Tool output preview"
- >
- {outputPreview()}
- </pre>
- </div>
- </Show>
+ </Show>
- <Show when={showDetails() && hasDetails()}>
- <ToolDetailsPanel
- id={detailsId}
- input={hasInput() ? detailInputText() : ''}
- output={hasOutput() ? outputText() : ''}
- />
- </Show>
- </div>
+ <Show when={showDetails() && hasDetails()}>
+ <ToolDetailsPanel
+ id={detailsId}
+ input={hasInput() ? detailInputText() : ''}
+ output={hasOutput() ? outputText() : ''}
+ />
+ </Show>
+ </div>
</Show>
);
};
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/MessageItem.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/MessageItem.test.tsx
index 5370a96f9e..1738e9ca41 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/MessageItem.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/MessageItem.test.tsx
@@ -131,7 +131,7 @@ describe('MessageItem', () => {
expect(messageItemSource).toContain('@/components/shared/Button');
expect(messageItemSource).toContain('CopyValueButton');
expect(messageItemSource).toContain('ActionIconButton');
- expect(messageItemSource).not.toContain("lucide-solid/icons/copy");
+ expect(messageItemSource).not.toContain('lucide-solid/icons/copy');
expect(messageItemSource).not.toContain("lucide-solid/icons/check';");
expect(messageItemSource).not.toContain(
'mt-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border-subtle bg-surface text-muted opacity-0 shadow-sm transition-opacity hover:text-base-content',
@@ -193,9 +193,7 @@ describe('MessageItem', () => {
})}
{...makeHandlers()}
getModelRouteLabel={(modelId) =>
- modelId === 'openrouter:qwen/qwen3.7-plus'
- ? 'Qwen 3.7 Plus via OpenRouter'
- : modelId
+ modelId === 'openrouter:qwen/qwen3.7-plus' ? 'Qwen 3.7 Plus via OpenRouter' : modelId
}
queuedPosition={2}
queuedCount={3}
@@ -2319,7 +2317,12 @@ describe('MessageItem', () => {
tool: { name: 'pulse_query', input: '{}', output, success: true },
});
const [msg, setMsg] = createSignal<ChatMessage>(
- makeMessage({ role: 'assistant', content: '', isStreaming: true, streamEvents: [toolEvent('a')] }),
+ makeMessage({
+ role: 'assistant',
+ content: '',
+ isStreaming: true,
+ streamEvents: [toolEvent('a')],
+ }),
);
render(() => <MessageItem message={msg()} {...makeHandlers()} />);
@@ -2328,7 +2331,12 @@ describe('MessageItem', () => {
// Next stream tick: brand-new array + brand-new tool event object (output
// grew), same position. <For> would recreate the row; <Index> keeps it.
setMsg(
- makeMessage({ role: 'assistant', content: '', isStreaming: true, streamEvents: [toolEvent('ab')] }),
+ makeMessage({
+ role: 'assistant',
+ content: '',
+ isStreaming: true,
+ streamEvents: [toolEvent('ab')],
+ }),
);
const nodeAfter = screen.getByTestId('tool-execution-block');
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx
index e9593f29db..502e5f77f6 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/ToolExecutionBlock.test.tsx
@@ -59,7 +59,7 @@ describe('ToolExecutionBlock', () => {
it('keeps tool copy controls on the shared CopyValueButton primitive', () => {
expect(toolExecutionBlockSource).toContain('@/components/shared/Button');
expect(toolExecutionBlockSource).toContain('CopyValueButton');
- expect(toolExecutionBlockSource).not.toContain("lucide-solid/icons/copy");
+ expect(toolExecutionBlockSource).not.toContain('lucide-solid/icons/copy');
expect(toolExecutionBlockSource).not.toContain("lucide-solid/icons/check';");
expect(toolExecutionBlockSource).not.toContain(
'inline-flex h-6 w-6 shrink-0 items-center justify-center rounded border border-border-subtle bg-surface text-muted transition-colors hover:bg-surface-hover hover:text-base-content focus:outline-none focus:ring-2 focus:ring-blue-500/30',
@@ -853,7 +853,12 @@ describe('PendingToolBlock', () => {
const tail = 'x'.repeat(130);
render(() => (
<PendingToolBlock
- tool={makePending({ name: 'pulse_query', input: '', rawInput: head + tail, status: 'pending' })}
+ tool={makePending({
+ name: 'pulse_query',
+ input: '',
+ rawInput: head + tail,
+ status: 'pending',
+ })}
/>
));
const preview = screen.getByLabelText('Tool input streaming');
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov.test.ts
index 461a196e91..c4705645a4 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov.test.ts
@@ -46,9 +46,7 @@ describe('formatPendingToolStatus branch coverage', () => {
it('renders a waiting tool from the label fallback when no activity is parseable', () => {
expect(
activeTurn({
- pendingTools: [
- { id: 'tool-1', name: 'pulse_get_nodes', input: '{}', status: 'waiting' },
- ],
+ pendingTools: [{ id: 'tool-1', name: 'pulse_get_nodes', input: '{}', status: 'waiting' }],
}),
).toEqual({
type: 'tool',
@@ -157,9 +155,9 @@ describe('sanitizeWorkflowStatusMessage branch coverage', () => {
});
it('collapses runs of whitespace and lone spaced-out periods', () => {
- expect(
- formatAssistantWorkflowStatus({ message: 'Working on it .' }),
- ).toBe('Working on it.');
+ expect(formatAssistantWorkflowStatus({ message: 'Working on it .' })).toBe(
+ 'Working on it.',
+ );
});
it('leaves a plain message unchanged when no tool context is present', () => {
@@ -177,17 +175,17 @@ describe('messageContainsToolLabel branch coverage', () => {
it('appends the tool suffix when the friendly label is absent from the message', () => {
// messageContainsToolLabel('Working', 'read') -> \bread\b does not match -> false
// -> toolSuffix is appended.
- expect(
- formatAssistantWorkflowStatus({ message: 'Working', tool: 'pulse_read' }),
- ).toBe('Working · read');
+ expect(formatAssistantWorkflowStatus({ message: 'Working', tool: 'pulse_read' })).toBe(
+ 'Working · read',
+ );
});
it('withholds the tool suffix when the message already mentions the label as a word', () => {
// messageContainsToolLabel('Reading storage', 'read') -> \bread\b does not
// match inside "Reading" -> false -> suffix appended (boundary edge case).
- expect(
- formatAssistantWorkflowStatus({ message: 'Reading storage', tool: 'pulse_read' }),
- ).toBe('Reading storage · read');
+ expect(formatAssistantWorkflowStatus({ message: 'Reading storage', tool: 'pulse_read' })).toBe(
+ 'Reading storage · read',
+ );
});
});
@@ -203,8 +201,12 @@ describe('formatRetryDelay branch coverage', () => {
>[0]);
it('formats sub-second delays in milliseconds', () => {
- expect(retry({ attempt: 1, retryAfterMs: 500 })).toBe('Retrying. · attempt 1 · retrying in 500ms');
- expect(retry({ attempt: 1, retryAfterMs: 999 })).toBe('Retrying. · attempt 1 · retrying in 999ms');
+ expect(retry({ attempt: 1, retryAfterMs: 500 })).toBe(
+ 'Retrying. · attempt 1 · retrying in 500ms',
+ );
+ expect(retry({ attempt: 1, retryAfterMs: 999 })).toBe(
+ 'Retrying. · attempt 1 · retrying in 999ms',
+ );
});
it('formats the one-second boundary and sub-ten-second delays with one decimal', () => {
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov0717.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov0717.test.ts
index c852933fdb..881bf287fa 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov0717.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/activeTurnStatus.branchcov0717.test.ts
@@ -4,11 +4,7 @@ import {
formatAssistantWorkflowStatus,
getAssistantActiveTurnStatus,
} from '@/components/AI/Chat/activeTurnStatus';
-import type {
- ChatMessage,
- PendingTool,
- StreamDisplayEvent,
-} from '@/components/AI/Chat/types';
+import type { ChatMessage, PendingTool, StreamDisplayEvent } from '@/components/AI/Chat/types';
// Fixture builders — mirror the conventions of the sibling branch-coverage tests.
const assistantMessage = (overrides: Partial<ChatMessage> = {}): ChatMessage => ({
@@ -134,9 +130,11 @@ describe('activeTurnStatus branch coverage (supplemental)', () => {
it('skips a pendingTools entry that produces no status text', () => {
// pendingToolCandidate(undefined) -> formatPendingToolStatus('') -> null,
// so the reducer returns its current accumulator unchanged.
- expect(
- activeTurn({ pendingTools: [undefined as unknown as PendingTool] }),
- ).toEqual({ type: 'thinking', text: 'Sending prompt.', startedAt: 1_000 });
+ expect(activeTurn({ pendingTools: [undefined as unknown as PendingTool] })).toEqual({
+ type: 'thinking',
+ text: 'Sending prompt.',
+ startedAt: 1_000,
+ });
});
});
@@ -180,7 +178,9 @@ describe('activeTurnStatus branch coverage (supplemental)', () => {
// The final `|| undefined` arm: activityAt is undefined.
expect(
activeTurn({
- streamEvents: [{ type: 'workflow_status', workflowStatus: { message: 'Working on it.' } }],
+ streamEvents: [
+ { type: 'workflow_status', workflowStatus: { message: 'Working on it.' } },
+ ],
}),
).toEqual({ type: 'thinking', text: 'Working on it.' });
});
@@ -246,28 +246,27 @@ describe('activeTurnStatus branch coverage (supplemental)', () => {
// -------------------------------------------------------------------------
describe('isGenericToolProgress equality arms', () => {
- it.each([
- 'Running command',
- 'Running read-only command',
- 'Running read-only command.',
- ])('treats %q generic progress as generic when a command preview exists', (progress) => {
- // A real command preview plus a generic progress string forces
- // isGenericToolProgress to be evaluated (commandPreview truthy ->
- // !commandPreview is false -> !isGenericToolProgress(progress) runs).
- expect(
- activeTurn({
- pendingTools: [
- {
- id: 't1',
- name: 'pulse_read',
- input: readToolInput('uptime'),
- progress,
- status: 'running',
- },
- ],
- }),
- ).toEqual({ type: 'tool', text: 'Running $ uptime' });
- });
+ it.each(['Running command', 'Running read-only command', 'Running read-only command.'])(
+ 'treats %q generic progress as generic when a command preview exists',
+ (progress) => {
+ // A real command preview plus a generic progress string forces
+ // isGenericToolProgress to be evaluated (commandPreview truthy ->
+ // !commandPreview is false -> !isGenericToolProgress(progress) runs).
+ expect(
+ activeTurn({
+ pendingTools: [
+ {
+ id: 't1',
+ name: 'pulse_read',
+ input: readToolInput('uptime'),
+ progress,
+ status: 'running',
+ },
+ ],
+ }),
+ ).toEqual({ type: 'tool', text: 'Running $ uptime' });
+ },
+ );
});
// -------------------------------------------------------------------------
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/aiCodeHighlight.branchcov0712.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/aiCodeHighlight.branchcov0712.test.ts
index 80850983e1..9b9977730c 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/aiCodeHighlight.branchcov0712.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/aiCodeHighlight.branchcov0712.test.ts
@@ -96,9 +96,7 @@ describe('loadHighlighter branch coverage — mocked core failures', () => {
vi.doMock('highlight.js/lib/core', () => ({ default: throwingHljs }));
const { highlightSettledCodeBlocks: highlight } = await import('../aiCodeHighlight');
- const container = makeContainer(
- '<pre><code class="language-bash">echo hello</code></pre>',
- );
+ const container = makeContainer('<pre><code class="language-bash">echo hello</code></pre>');
await highlight(container);
const code = container.querySelector('code') as HTMLElement;
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/assistantModelRoutes.branchcov0712b.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/assistantModelRoutes.branchcov0712b.test.ts
index a8c7ff42da..3ef3a45e19 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/assistantModelRoutes.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/assistantModelRoutes.branchcov0712b.test.ts
@@ -120,11 +120,7 @@ describe('normalizeAssistantRecentModelRoutes branch coverage', () => {
it('deduplicates explicit routes by their trimmed form', () => {
expect(
normalizeAssistantRecentModelRoutes(
- [
- 'openrouter:qwen/qwen3.7-plus',
- 'openrouter:qwen/qwen3.7-plus',
- 'deepseek:deepseek-chat',
- ],
+ ['openrouter:qwen/qwen3.7-plus', 'openrouter:qwen/qwen3.7-plus', 'deepseek:deepseek-chat'],
10,
),
).toEqual(['openrouter:qwen/qwen3.7-plus', 'deepseek:deepseek-chat']);
@@ -133,11 +129,7 @@ describe('normalizeAssistantRecentModelRoutes branch coverage', () => {
it('breaks as soon as the limit is reached, ignoring later valid routes', () => {
expect(
normalizeAssistantRecentModelRoutes(
- [
- 'openrouter:qwen/qwen3.7-plus',
- 'deepseek:deepseek-chat',
- 'gemini:gemini-3.1-flash-lite',
- ],
+ ['openrouter:qwen/qwen3.7-plus', 'deepseek:deepseek-chat', 'gemini:gemini-3.1-flash-lite'],
2,
),
).toEqual(['openrouter:qwen/qwen3.7-plus', 'deepseek:deepseek-chat']);
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov0712b.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov0712b.test.ts
index b6d7c7204c..f3ebe6f140 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov0712b.test.ts
@@ -160,9 +160,7 @@ describe('isKnownAssistantToolNamePrefix branch coverage', () => {
it('matches a full patrol_ tool name via the /^patrol_/ regex arm', () => {
const state = freshState();
- expect(
- appendVisibleTextBeforeAssistantOutputArtifacts(state, 'try patrol_remediate'),
- ).toEqual({
+ expect(appendVisibleTextBeforeAssistantOutputArtifacts(state, 'try patrol_remediate')).toEqual({
text: 'try ',
stripped: false,
});
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov2.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov2.test.ts
index 00cb3d02f0..c16906b26f 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov2.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.branchcov2.test.ts
@@ -69,9 +69,7 @@ describe('normalizeAssistantVisibleInternalIdentifiers branch coverage', () => {
it('consumes surrounding backticks and a trailing label word, handling multiple matches', () => {
// The regex swallows the optional backticks and the trailing
// (tool|command|query|call) word, replacing the whole match with the label.
- expect(
- stripAssistantOutputArtifacts('`pulse_read` tool and run_command query'),
- ).toEqual({
+ expect(stripAssistantOutputArtifacts('`pulse_read` tool and run_command query')).toEqual({
text: 'read command and command',
stripped: false,
});
@@ -141,10 +139,7 @@ describe('appendVisibleTextBeforeAssistantOutputArtifacts branch coverage', () =
});
// safeText re-slices back to 'Done.' which is no longer than what was shown.
expect(
- appendVisibleTextBeforeAssistantOutputArtifacts(
- state,
- '\npulse_read(target_host="x")',
- ),
+ appendVisibleTextBeforeAssistantOutputArtifacts(state, '\npulse_read(target_host="x")'),
).toEqual({ text: '', stripped: true });
});
});
@@ -319,9 +314,10 @@ describe('isCompactedToolPrelude branch coverage', () => {
it('returns false for 16-47 letters with exactly one whitespace', () => {
// 20 letters + 1 space + 1 letter = 21 letters, 1 whitespace.
- expect(
- stripAssistantOutputArtifacts('aaaaaaaaaaaaaaaaaaaa b\npulse_read()'),
- ).toEqual({ text: 'aaaaaaaaaaaaaaaaaaaa b', stripped: true });
+ expect(stripAssistantOutputArtifacts('aaaaaaaaaaaaaaaaaaaa b\npulse_read()')).toEqual({
+ text: 'aaaaaaaaaaaaaaaaaaaa b',
+ stripped: true,
+ });
});
it('returns false when whitespace >= 2 even with many letters', () => {
@@ -338,10 +334,12 @@ describe('isCompactedToolPrelude branch coverage', () => {
describe('splitTrailingPotentialToolNamePrefix branch coverage', () => {
it('holds nothing when the trailing run is not a known tool prefix', () => {
// 'world123' is tool-name characters but not a pulse/patrol prefix.
- expect(appendVisibleTextBeforeAssistantOutputArtifacts(freshState(), 'hello world123')).toEqual({
- text: 'hello world123',
- stripped: false,
- });
+ expect(appendVisibleTextBeforeAssistantOutputArtifacts(freshState(), 'hello world123')).toEqual(
+ {
+ text: 'hello world123',
+ stripped: false,
+ },
+ );
});
it('keeps a leading backtick attached to a held pulse_ prefix', () => {
@@ -381,9 +379,7 @@ describe('isKnownAssistantToolNamePrefix branch coverage', () => {
it('matches a complete patrol_ tool name via the patrol_ regex arm', () => {
const state = freshState();
- expect(
- appendVisibleTextBeforeAssistantOutputArtifacts(state, 'try patrol_remediate'),
- ).toEqual({
+ expect(appendVisibleTextBeforeAssistantOutputArtifacts(state, 'try patrol_remediate')).toEqual({
text: 'try ',
stripped: false,
});
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.test.ts
index 135fc6d396..ee71a1d388 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/assistantOutputHygiene.test.ts
@@ -116,8 +116,7 @@ describe('stripAssistantOutputArtifacts', () => {
it('drops held compacted prose when no tool leak follows before stream end', () => {
const state = createAssistantOutputArtifactStreamState();
- const content =
- "Thisisbadmodelspacingbutitistheactualanswerbecauseitneverturnsintoatoolcall.";
+ const content = 'Thisisbadmodelspacingbutitistheactualanswerbecauseitneverturnsintoatoolcall.';
expect(appendVisibleTextBeforeAssistantOutputArtifacts(state, content)).toEqual({
text: '',
@@ -172,7 +171,9 @@ describe('stripAssistantOutputArtifacts', () => {
text: '',
stripped: false,
});
- expect(appendVisibleTextBeforeAssistantOutputArtifacts(state, ' about the result this way.')).toEqual({
+ expect(
+ appendVisibleTextBeforeAssistantOutputArtifacts(state, ' about the result this way.'),
+ ).toEqual({
text: 'Think about the result this way.',
stripped: false,
});
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/assistantTurnSummary.branchcov0712b.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/assistantTurnSummary.branchcov0712b.test.ts
index cd72511d4a..3e7bb709de 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/assistantTurnSummary.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/assistantTurnSummary.branchcov0712b.test.ts
@@ -1,8 +1,5 @@
import { describe, expect, it } from 'vitest';
-import {
- formatAssistantTurnDuration,
- getAssistantTurnSummary,
-} from '../assistantTurnSummary';
+import { formatAssistantTurnDuration, getAssistantTurnSummary } from '../assistantTurnSummary';
import type { ChatMessage } from '../types';
// Branch-coverage companion to assistantTurnSummary.test.ts. Each test below
@@ -172,7 +169,7 @@ describe('getAssistantTurnSummary branch coverage', () => {
});
});
- it("omits the model part when model is absent (message.model?. absent short-circuit)", () => {
+ it('omits the model part when model is absent (message.model?. absent short-circuit)', () => {
expect(
getAssistantTurnSummary(
baseAssistant({
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/recentSessionsModel.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/recentSessionsModel.test.ts
index fc516be336..2819f5239a 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/recentSessionsModel.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/recentSessionsModel.test.ts
@@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest';
import type { ChatSession } from '@/api/aiChat';
-import {
- QUICK_RESUME_SESSION_LIMIT,
- selectQuickResumeSessions,
-} from '../recentSessionsModel';
+import { QUICK_RESUME_SESSION_LIMIT, selectQuickResumeSessions } from '../recentSessionsModel';
const session = (overrides: Partial<ChatSession> & { id: string }): ChatSession => ({
title: overrides.id,
@@ -16,7 +13,12 @@ const session = (overrides: Partial<ChatSession> & { id: string }): ChatSession
describe('selectQuickResumeSessions', () => {
it('excludes Pulse-owned background sessions from the quick-resume list', () => {
const sessions = [
- session({ id: 'patrol-main', title: '# Deterministic Triage Results Scanned 70', system: true, message_count: 200 }),
+ session({
+ id: 'patrol-main',
+ title: '# Deterministic Triage Results Scanned 70',
+ system: true,
+ message_count: 200,
+ }),
session({ id: 'user-chat-1' }),
];
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.branchcov0712b.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.branchcov0712b.test.ts
index f56edf020c..b3c755becb 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.branchcov0712b.test.ts
@@ -29,33 +29,25 @@ describe('parseFunctionStyleToolInput — partial-mode branches', () => {
// partial pass runs: the unquoted scan hits `)` (line 279 allowPartial
// arm), then the post-value `)` break fires (line 298). The captured
// command flows through to the read-exec intent label.
- expect(parseToolInputSummary('read(command=df -h)z', 'pulse_read')).toBe(
- 'Inspect filesystems',
- );
+ expect(parseToolInputSummary('read(command=df -h)z', 'pulse_read')).toBe('Inspect filesystems');
});
it('breaks on ")" after a quoted value when strict mode rejected the call (line 298)', () => {
// `read(action="file")extra)` — strict consumes the inner body then fails
// at the leftover "extra"; the partial pass slices the trailing ")" and
// breaks at the next ")" after the quoted value.
- expect(parseToolInputSummary('read(action="file")extra)', 'pulse_read')).toBe(
- 'read file',
- );
+ expect(parseToolInputSummary('read(action="file")extra)', 'pulse_read')).toBe('read file');
});
it('rescues earlier args when the body ends right after "=" (line 267)', () => {
// No closing ")" → strict regex fails; partial parses `action="file"`,
// reaches `path=`, then end-of-body and returns the partial result.
- expect(parseToolInputSummary('read(action="file", path=', 'pulse_read')).toBe(
- 'read file',
- );
+ expect(parseToolInputSummary('read(action="file", path=', 'pulse_read')).toBe('read file');
});
it('rescues earlier args when an unquoted value is empty (line 284)', () => {
// `x=,` yields an empty rawValue; partialResult returns the prior `action`.
- expect(parseToolInputSummary('read(action="file", x=,)', 'pulse_read')).toBe(
- 'read file',
- );
+ expect(parseToolInputSummary('read(action="file", x=,)', 'pulse_read')).toBe('read file');
});
it('types negative-integer and decimal unquoted values via the numeric matcher arms', () => {
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.coverage.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.coverage.test.ts
index e5a049285d..6f2dbfff06 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.coverage.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.coverage.test.ts
@@ -26,7 +26,9 @@ describe('pendingToolActionLabel', () => {
expect(pendingToolActionLabel('pulse_read')).toBe('Preparing read...');
expect(pendingToolActionLabel('pulse_query')).toBe('Preparing query...');
expect(pendingToolActionLabel('pulse_fetch_url')).toBe('Fetching URL...');
- expect(pendingToolActionLabel('pulse_get_infrastructure_state')).toBe('Reading infrastructure...');
+ expect(pendingToolActionLabel('pulse_get_infrastructure_state')).toBe(
+ 'Reading infrastructure...',
+ );
expect(pendingToolActionLabel('pulse_get_active_alerts')).toBe('Reading alerts...');
expect(pendingToolActionLabel('alerts')).toBe('Reading alerts...');
expect(pendingToolActionLabel('pulse_get_metrics_history')).toBe('Reading metrics...');
@@ -243,18 +245,16 @@ describe('parseFunctionStyleToolInput', () => {
describe('parseQuotedValue escape handling', () => {
it('unescapes embedded quotes inside a quoted command value', () => {
- expect(
- commandPreview('run_command(command="echo \\"hi\\"")', 'pulse_run_command'),
- ).toBe('$ echo "hi"');
+ expect(commandPreview('run_command(command="echo \\"hi\\"")', 'pulse_run_command')).toBe(
+ '$ echo "hi"',
+ );
});
it('rescues earlier args when a quote is left unterminated or a comma is missing', () => {
- expect(
- parseToolInputSummary('read(action="file" path="/x")', 'pulse_read'),
- ).toBe('read file');
- expect(
- parseToolInputSummary('read(action="file", path="unterminated)', 'pulse_read'),
- ).toBe('read unterminated');
+ expect(parseToolInputSummary('read(action="file" path="/x")', 'pulse_read')).toBe('read file');
+ expect(parseToolInputSummary('read(action="file", path="unterminated)', 'pulse_read')).toBe(
+ 'read unterminated',
+ );
});
it('stops cleanly at an early closing paren and preserves a trailing-backslash partial value', () => {
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.test.ts
index 1edf724ff2..f3d0e51939 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/toolPresentation.test.ts
@@ -28,9 +28,7 @@ describe('formatPulseReadInputSummary (read tool)', () => {
});
it('summarizes tail with and without a path', () => {
- expect(readSummary({ action: 'tail', path: '/var/log/syslog' })).toBe(
- 'tail /var/log/syslog',
- );
+ expect(readSummary({ action: 'tail', path: '/var/log/syslog' })).toBe('tail /var/log/syslog');
expect(readSummary({ action: 'tail' })).toBe('tail file');
});
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.branchcov.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.branchcov.test.ts
index 5ca4ead3cf..4c9b213ea2 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.branchcov.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.branchcov.test.ts
@@ -77,26 +77,23 @@ describe('formatTimestamp guard branches', () => {
describe('formatGeneratedAt guard branches', () => {
it('emits a Generated ISO line for a valid date', () => {
- const transcript = render(
- [{ id: 'a1', role: 'assistant', content: 'Hi', timestamp }],
- { generatedAt: new Date('2026-06-06T12:34:56Z') },
- );
+ const transcript = render([{ id: 'a1', role: 'assistant', content: 'Hi', timestamp }], {
+ generatedAt: new Date('2026-06-06T12:34:56Z'),
+ });
expect(transcript).toContain('Generated: 2026-06-06T12:34:56.000Z');
});
it('omits the Generated line for a NaN date', () => {
- const transcript = render(
- [{ id: 'a1', role: 'assistant', content: 'Hi', timestamp }],
- { generatedAt: new Date(NaN) },
- );
+ const transcript = render([{ id: 'a1', role: 'assistant', content: 'Hi', timestamp }], {
+ generatedAt: new Date(NaN),
+ });
expect(transcript).not.toContain('Generated:');
});
it('omits the Generated line when generatedAt is not a Date instance', () => {
- const transcript = render(
- [{ id: 'a1', role: 'assistant', content: 'Hi', timestamp }],
- { generatedAt: 'not-a-date' as unknown as Date },
- );
+ const transcript = render([{ id: 'a1', role: 'assistant', content: 'Hi', timestamp }], {
+ generatedAt: 'not-a-date' as unknown as Date,
+ });
expect(transcript).not.toContain('Generated:');
});
@@ -460,9 +457,7 @@ describe('hasTranscriptMessageContent uncovered branches', () => {
role: 'assistant',
content: '',
timestamp,
- pendingApprovals: [
- { toolId: 't1', toolName: '', command: '', runOnHost: false },
- ],
+ pendingApprovals: [{ toolId: 't1', toolName: '', command: '', runOnHost: false }],
},
]),
).toBe(true);
@@ -533,9 +528,7 @@ describe('appendMessageMetadata uncovered branches', () => {
});
it('emits Time but not Model metadata for a user message', () => {
- const transcript = render([
- { id: 'u1', role: 'user', content: 'Hello', timestamp },
- ]);
+ const transcript = render([{ id: 'u1', role: 'user', content: 'Hello', timestamp }]);
expect(transcript).toContain('Time:');
expect(transcript).not.toContain('Model:');
});
@@ -631,7 +624,13 @@ describe('appendAssistantStreamEvents fallback and guard branches', () => {
it('renders a stopped interruption notice', () => {
const transcript = render([
- { id: 'a1', role: 'assistant', content: 'partial answer', timestamp, interruption: 'stopped' },
+ {
+ id: 'a1',
+ role: 'assistant',
+ content: 'partial answer',
+ timestamp,
+ interruption: 'stopped',
+ },
]);
expect(transcript).toContain('[interrupted] Stopped by user');
});
@@ -794,9 +793,7 @@ describe('formatAssistantTranscript structural edge cases', () => {
});
it('collapses three or more consecutive newlines into two', () => {
- const transcript = render([
- { id: 'u1', role: 'user', content: 'A\n\n\n\n\nB', timestamp },
- ]);
+ const transcript = render([{ id: 'u1', role: 'user', content: 'A\n\n\n\n\nB', timestamp }]);
expect(transcript).not.toMatch(/\n{3,}/);
expect(transcript).toContain('A');
expect(transcript).toContain('B');
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.coverage.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.coverage.test.ts
index 253edbf524..adede7d0a0 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.coverage.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/transcriptExport.coverage.test.ts
@@ -197,10 +197,9 @@ describe('formatModelSwitch', () => {
)[id] ?? id;
it('renders a selected route with the using prefix', () => {
- const transcript = render(
- [{ type: 'model_switch', model: 'm-sel', modelEvent: 'selected' }],
- { getModelRouteLabel: labelFor },
- );
+ const transcript = render([{ type: 'model_switch', model: 'm-sel', modelEvent: 'selected' }], {
+ getModelRouteLabel: labelFor,
+ });
expect(transcript).toContain('[model] using Selected Route');
});
@@ -279,9 +278,9 @@ describe('hasRenderableEvent switch arms', () => {
});
it('renders question only when a question payload exists', () => {
- expect(
- hasContent({ type: 'question', question: { questionId: 'q', questions: [] } }),
- ).toBe(true);
+ expect(hasContent({ type: 'question', question: { questionId: 'q', questions: [] } })).toBe(
+ true,
+ );
expect(hasContent({ type: 'question' })).toBe(false);
});
});
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts
index e535840297..badce9556e 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/useChat.test.ts
@@ -559,7 +559,11 @@ describe('useChat', () => {
expect(chat.messages()).toHaveLength(2);
mockChat.mockResolvedValueOnce(undefined);
- mockUndoLastTurn.mockResolvedValueOnce({ success: true, session_id: 'sess', can_redo: false });
+ mockUndoLastTurn.mockResolvedValueOnce({
+ success: true,
+ session_id: 'sess',
+ can_redo: false,
+ });
await chat.retryMessage(failed!.id);
await new Promise((r) => setTimeout(r, 0));
@@ -947,7 +951,12 @@ describe('useChat', () => {
fireEvent({
type: 'steer_applied',
- data: { client_message_id: 'foreign-row', message_id: 'srv-9', prompt: 'from another tab', turn: 2 },
+ data: {
+ client_message_id: 'foreign-row',
+ message_id: 'srv-9',
+ prompt: 'from another tab',
+ turn: 2,
+ },
});
await new Promise((r) => setTimeout(r, 0));
@@ -1301,9 +1310,7 @@ describe('useChat', () => {
const assistant = chat.messages().find((m) => m.role === 'assistant')!;
expect(assistant.content).toBe('');
- expect(assistant.streamEvents?.filter((event) => event.type === 'content') ?? []).toEqual(
- [],
- );
+ expect(assistant.streamEvents?.filter((event) => event.type === 'content') ?? []).toEqual([]);
dispose();
});
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/workflowStarters.branchcov0712.test.ts b/frontend-modern/src/components/AI/Chat/__tests__/workflowStarters.branchcov0712.test.ts
index 48c0a2ff6a..a552df5280 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/workflowStarters.branchcov0712.test.ts
+++ b/frontend-modern/src/components/AI/Chat/__tests__/workflowStarters.branchcov0712.test.ts
@@ -22,9 +22,7 @@ const one = (prompts: AgentWorkflowPrompt[], context: Record<string, unknown> =
describe('workflowStarterLabel branch coverage', () => {
it('returns the trimmed label when a label is present (normalizeIdentifier trim + truthy arm)', () => {
- const [starter] = one([
- { name: 'pulse_a', label: ' Spaced Label ', arguments: [] },
- ]);
+ const [starter] = one([{ name: 'pulse_a', label: ' Spaced Label ', arguments: [] }]);
expect(starter.label).toBe('Spaced Label');
});
@@ -100,12 +98,17 @@ describe('getAssistantWorkflowStarterResourceId branch coverage', () => {
});
it('rejects every patrol target type so a run/assessment/configuration id is not used', () => {
- expect(getAssistantWorkflowStarterResourceId({ targetType: 'patrol-run', targetId: 'run-1' })).toBe('');
+ expect(
+ getAssistantWorkflowStarterResourceId({ targetType: 'patrol-run', targetId: 'run-1' }),
+ ).toBe('');
expect(
getAssistantWorkflowStarterResourceId({ targetType: 'patrol-assessment', targetId: 'a-1' }),
).toBe('');
expect(
- getAssistantWorkflowStarterResourceId({ targetType: 'patrol-configuration', targetId: 'c-1' }),
+ getAssistantWorkflowStarterResourceId({
+ targetType: 'patrol-configuration',
+ targetId: 'c-1',
+ }),
).toBe('');
});
@@ -167,9 +170,7 @@ describe('getAssistantWorkflowStarterFindingId branch coverage', () => {
});
it('falls back to context.context.findingId via the optional chain', () => {
- expect(getAssistantWorkflowStarterFindingId({ context: { findingId: 'f-ctx' } })).toBe(
- 'f-ctx',
- );
+ expect(getAssistantWorkflowStarterFindingId({ context: { findingId: 'f-ctx' } })).toBe('f-ctx');
});
it('returns empty string when context.context exists but has no findingId', () => {
@@ -188,18 +189,16 @@ describe('getAssistantWorkflowStarterFindingId branch coverage', () => {
describe('resolveWorkflowStarterArgument branch coverage', () => {
it('routes "resourceId" through getAssistantWorkflowStarterResourceId', () => {
- const [starter] = one(
- [{ name: 'p', arguments: [{ name: 'resourceId', required: true }] }],
- { handoffResources: [{ id: 'vm:7' }] },
- );
+ const [starter] = one([{ name: 'p', arguments: [{ name: 'resourceId', required: true }] }], {
+ handoffResources: [{ id: 'vm:7' }],
+ });
expect(starter.arguments).toStrictEqual({ resourceId: 'vm:7' });
});
it('routes "finding_id" through getAssistantWorkflowStarterFindingId', () => {
- const [starter] = one(
- [{ name: 'p', arguments: [{ name: 'finding_id', required: true }] }],
- { findingId: 'f-1' },
- );
+ const [starter] = one([{ name: 'p', arguments: [{ name: 'finding_id', required: true }] }], {
+ findingId: 'f-1',
+ });
expect(starter.arguments).toStrictEqual({ finding_id: 'f-1' });
});
@@ -237,17 +236,14 @@ describe('buildWorkflowStarterArguments branch coverage', () => {
});
it('keeps a resolved optional argument and includes the prompt', () => {
- const [starter] = one(
- [{ name: 'p', arguments: [{ name: 'resourceId', required: false }] }],
- { handoffResources: [{ id: 'vm:1' }] },
- );
+ const [starter] = one([{ name: 'p', arguments: [{ name: 'resourceId', required: false }] }], {
+ handoffResources: [{ id: 'vm:1' }],
+ });
expect(starter.arguments).toStrictEqual({ resourceId: 'vm:1' });
});
it('omits an unresolved optional argument but still includes the prompt with {}', () => {
- const [starter] = one([
- { name: 'p', arguments: [{ name: 'resourceId', required: false }] },
- ]);
+ const [starter] = one([{ name: 'p', arguments: [{ name: 'resourceId', required: false }] }]);
expect(starter).toMatchObject({ name: 'p' });
expect(starter.arguments).toStrictEqual({});
});
diff --git a/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts b/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts
index d2000af04d..0673b0dd78 100644
--- a/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts
+++ b/frontend-modern/src/components/AI/Chat/activeTurnStatus.ts
@@ -628,10 +628,7 @@ export const getAssistantActiveTurnStatus = (
if (statePendingToolCandidate) {
statusCandidates.push(statePendingToolCandidate);
}
- const eventStatusCandidate = latestStreamActivityStatus(
- assistantMessage.streamEvents,
- now,
- );
+ const eventStatusCandidate = latestStreamActivityStatus(assistantMessage.streamEvents, now);
if (eventStatusCandidate) {
statusCandidates.push(eventStatusCandidate);
} else {
diff --git a/frontend-modern/src/components/AI/Chat/aiCodeHighlight.ts b/frontend-modern/src/components/AI/Chat/aiCodeHighlight.ts
index 7a264953e8..829aa86ed6 100644
--- a/frontend-modern/src/components/AI/Chat/aiCodeHighlight.ts
+++ b/frontend-modern/src/components/AI/Chat/aiCodeHighlight.ts
@@ -11,18 +11,17 @@ const loadHighlighter = (): Promise<HLJSApi | null> => {
if (!hljsPromise) {
hljsPromise = (async () => {
try {
- const [core, bash, json, yaml, ini, sql, dockerfile, nginx, plaintext] =
- await Promise.all([
- import('highlight.js/lib/core'),
- import('highlight.js/lib/languages/bash'),
- import('highlight.js/lib/languages/json'),
- import('highlight.js/lib/languages/yaml'),
- import('highlight.js/lib/languages/ini'),
- import('highlight.js/lib/languages/sql'),
- import('highlight.js/lib/languages/dockerfile'),
- import('highlight.js/lib/languages/nginx'),
- import('highlight.js/lib/languages/plaintext'),
- ]);
+ const [core, bash, json, yaml, ini, sql, dockerfile, nginx, plaintext] = await Promise.all([
+ import('highlight.js/lib/core'),
+ import('highlight.js/lib/languages/bash'),
+ import('highlight.js/lib/languages/json'),
+ import('highlight.js/lib/languages/yaml'),
+ import('highlight.js/lib/languages/ini'),
+ import('highlight.js/lib/languages/sql'),
+ import('highlight.js/lib/languages/dockerfile'),
+ import('highlight.js/lib/languages/nginx'),
+ import('highlight.js/lib/languages/plaintext'),
+ ]);
const hljs = core.default;
hljs.registerLanguage('bash', bash.default);
hljs.registerAliases(['sh', 'shell', 'zsh', 'console'], { languageName: 'bash' });
diff --git a/frontend-modern/src/components/AI/Chat/assistantPanelWidth.ts b/frontend-modern/src/components/AI/Chat/assistantPanelWidth.ts
index c721b9fcac..590ea8df0e 100644
--- a/frontend-modern/src/components/AI/Chat/assistantPanelWidth.ts
+++ b/frontend-modern/src/components/AI/Chat/assistantPanelWidth.ts
@@ -32,10 +32,7 @@ export function loadStoredAssistantPanelWidth(storage: Pick<Storage, 'getItem'>)
return Number.isFinite(parsed) ? parsed : null;
}
-export function persistAssistantPanelWidth(
- storage: Pick<Storage, 'setItem'>,
- width: number,
-): void {
+export function persistAssistantPanelWidth(storage: Pick<Storage, 'setItem'>, width: number): void {
try {
storage.setItem(ASSISTANT_PANEL_WIDTH_STORAGE_KEY, String(Math.round(width)));
} catch {
diff --git a/frontend-modern/src/components/AI/Chat/assistantSlashCommands.ts b/frontend-modern/src/components/AI/Chat/assistantSlashCommands.ts
index c8868ab29f..243883b38a 100644
--- a/frontend-modern/src/components/AI/Chat/assistantSlashCommands.ts
+++ b/frontend-modern/src/components/AI/Chat/assistantSlashCommands.ts
@@ -20,11 +20,7 @@ export type AssistantSlashCommandAction =
| 'sessions';
export type AssistantSlashCommandCategory =
- | 'Session'
- | 'Model'
- | 'Transcript'
- | 'Help'
- | 'Developer';
+ 'Session' | 'Model' | 'Transcript' | 'Help' | 'Developer';
export interface AssistantSlashCommand {
action: AssistantSlashCommandAction;
diff --git a/frontend-modern/src/components/AI/Chat/hooks/useChat.ts b/frontend-modern/src/components/AI/Chat/hooks/useChat.ts
index 503fb4aa32..41507034e2 100644
--- a/frontend-modern/src/components/AI/Chat/hooks/useChat.ts
+++ b/frontend-modern/src/components/AI/Chat/hooks/useChat.ts
@@ -295,8 +295,7 @@ export function useChat(options: UseChatOptions = {}) {
};
const isLocalPromptProgressEvent = (event: StreamDisplayEvent) =>
- event.type === 'workflow_status' &&
- isLocalPromptProgressStatus(event.workflowStatus);
+ event.type === 'workflow_status' && isLocalPromptProgressStatus(event.workflowStatus);
const streamEventsWithoutLocalPromptProgressRows = (
events: StreamDisplayEvent[] | undefined,
@@ -1373,7 +1372,10 @@ export function useChat(options: UseChatOptions = {}) {
setMessages((prev) => [
...prev,
{
- id: typeof data.message_id === 'string' && data.message_id ? data.message_id : generateId(),
+ id:
+ typeof data.message_id === 'string' && data.message_id
+ ? data.message_id
+ : generateId(),
role: 'user',
content: prompt,
timestamp: new Date(),
@@ -1884,9 +1886,7 @@ export function useChat(options: UseChatOptions = {}) {
pendingTools: [],
pendingApprovals: [],
pendingQuestions: [],
- streamEvents: streamEventsWithoutUnresolvedInteractiveRows(
- flushedMsg.streamEvents,
- ),
+ streamEvents: streamEventsWithoutUnresolvedInteractiveRows(flushedMsg.streamEvents),
workflowStatus: undefined,
workflowStatusHistory: undefined,
};
@@ -2519,7 +2519,10 @@ export function useChat(options: UseChatOptions = {}) {
// and the user prompt that triggered it from the view AND from the persisted
// session, then re-send that prompt so the conversation shows a single clean
// attempt instead of a dead-end error plus a double-recorded prompt.
- const retryMessage = async (assistantMessageId: string, sendOptionOverrides?: SendMessageOptions) => {
+ const retryMessage = async (
+ assistantMessageId: string,
+ sendOptionOverrides?: SendMessageOptions,
+ ) => {
const msgs = messages();
const idx = msgs.findIndex((m) => m.id === assistantMessageId);
if (idx < 0) return;
@@ -2543,7 +2546,10 @@ export function useChat(options: UseChatOptions = {}) {
try {
await AIChatAPI.undoLastTurn(currentSessionId, { expectedPrompt: prompt });
} catch (error) {
- logger.warn('[useChat] Retry could not remove the previous turn from session history', error);
+ logger.warn(
+ '[useChat] Retry could not remove the previous turn from session history',
+ error,
+ );
}
}
const removeIds = new Set([msgs[userIdx].id, assistantMessageId]);
diff --git a/frontend-modern/src/components/AI/Chat/streamEventGrouping.ts b/frontend-modern/src/components/AI/Chat/streamEventGrouping.ts
index c55c1a626b..4a73aeeffe 100644
--- a/frontend-modern/src/components/AI/Chat/streamEventGrouping.ts
+++ b/frontend-modern/src/components/AI/Chat/streamEventGrouping.ts
@@ -15,9 +15,7 @@ import type { StreamDisplayEvent } from './types';
// Tool / approval / question / pending-tool events are genuine sequence
// boundaries (the model narrates around an action), so they close the open
// content and thinking blocks: text before and after an action stays ordered.
-export const groupStreamEventsForDisplay = (
- events: StreamDisplayEvent[],
-): StreamDisplayEvent[] => {
+export const groupStreamEventsForDisplay = (events: StreamDisplayEvent[]): StreamDisplayEvent[] => {
const grouped: StreamDisplayEvent[] = [];
// Indices of the currently-open content and thinking blocks, or -1 when none
// is open. Only a hard-boundary event resets these.
diff --git a/frontend-modern/src/components/AI/Chat/transcriptExport.ts b/frontend-modern/src/components/AI/Chat/transcriptExport.ts
index 226be5c003..6d10c39d89 100644
--- a/frontend-modern/src/components/AI/Chat/transcriptExport.ts
+++ b/frontend-modern/src/components/AI/Chat/transcriptExport.ts
@@ -96,7 +96,10 @@ const formatToolOutput = (output: unknown): string => {
const text = toolValueText(output).replace(/\r\n/g, '\n').replace(/\r/g, '\n').trim();
if (!text) return '';
const lines = text.split('\n').slice(0, 6);
- const preview = lines.map((line) => line.trimEnd().slice(0, 160)).join('\n').trim();
+ const preview = lines
+ .map((line) => line.trimEnd().slice(0, 160))
+ .join('\n')
+ .trim();
if (!preview) return '';
return text.split('\n').length > lines.length ? `${preview}\n...` : preview;
};
@@ -216,9 +219,7 @@ const appendMessageMetadata = (
) => {
if (options.includeAssistantMetadata === false) return;
const modelRoute =
- message.role === 'assistant'
- ? formatModelRoute(message.model, options.getModelRouteLabel)
- : '';
+ message.role === 'assistant' ? formatModelRoute(message.model, options.getModelRouteLabel) : '';
const metadata = [
message.timestamp ? `Time: ${formatTimestamp(message.timestamp)}` : undefined,
@@ -369,7 +370,10 @@ export const formatAssistantTranscript = (options: AssistantTranscriptOptions):
}
}
- return `${lines.join('\n').replace(/\n{3,}/g, '\n\n').trim()}\n`;
+ return `${lines
+ .join('\n')
+ .replace(/\n{3,}/g, '\n\n')
+ .trim()}\n`;
};
const filenameDatePart = (date: Date): string => {
diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.overdue.test.tsx b/frontend-modern/src/components/AI/__tests__/FindingsPanel.overdue.test.tsx
index d2d4db9b05..1144f2bb3e 100644
--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.overdue.test.tsx
+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.overdue.test.tsx
@@ -129,7 +129,10 @@ beforeEach(() => {
mockState.loadRemediationPlans.mockClear();
if (typeof window.requestAnimationFrame !== 'function') {
window.requestAnimationFrame = ((callback: FrameRequestCallback) =>
- window.setTimeout(() => callback(performance.now()), 0)) as typeof window.requestAnimationFrame;
+ window.setTimeout(
+ () => callback(performance.now()),
+ 0,
+ )) as typeof window.requestAnimationFrame;
}
});
@@ -200,9 +203,7 @@ describe('FindingsPanel overdue commitments filter', () => {
render(() => <FindingsPanel findingsSource="patrol" />);
await waitFor(() => expect(mockState.loadPatrolFindings).toHaveBeenCalled());
- expect(
- screen.queryByRole('button', { name: /overdue commitments/i }),
- ).not.toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /overdue commitments/i })).not.toBeInTheDocument();
});
it('honors filterOverride="overdue" so callers can land directly on the filter', async () => {
diff --git a/frontend-modern/src/components/AI/__tests__/aiChatUtils.test.ts b/frontend-modern/src/components/AI/__tests__/aiChatUtils.test.ts
index e644cba8d7..072f8892d3 100644
--- a/frontend-modern/src/components/AI/__tests__/aiChatUtils.test.ts
+++ b/frontend-modern/src/components/AI/__tests__/aiChatUtils.test.ts
@@ -56,10 +56,12 @@ describe('aiChatUtils', () => {
];
const grouped = utils.groupModelsByProvider(models);
- expect(grouped.get('ollama')?.map((m) => m.id).sort()).toEqual([
- 'gpt-oss-20b',
- 'my-claude-clone',
- ]);
+ expect(
+ grouped
+ .get('ollama')
+ ?.map((m) => m.id)
+ .sort(),
+ ).toEqual(['gpt-oss-20b', 'my-claude-clone']);
expect(grouped.has('openai')).toBe(false);
expect(grouped.has('anthropic')).toBe(false);
});
@@ -143,9 +145,7 @@ describe('aiChatUtils', () => {
// classes — used to be ALLOWED_ATTR; allowing them opens a UI-redress
// surface (overlay attacks, hidden text, etc.).
it('strips class attribute from LLM-supplied markup', () => {
- const output = utils.renderMarkdown(
- '<div class="fixed inset-0 z-50 bg-black">overlay</div>',
- );
+ const output = utils.renderMarkdown('<div class="fixed inset-0 z-50 bg-black">overlay</div>');
expect(output).not.toContain('class="fixed');
expect(output).not.toContain('inset-0');
});
diff --git a/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx b/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx
index ab1365aeae..a7225e9a38 100644
--- a/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx
+++ b/frontend-modern/src/components/Alerts/InvestigateAlertButton.tsx
@@ -54,9 +54,7 @@ export function InvestigateAlertButton(props: InvestigateAlertButtonProps) {
}
const showPatrolOption = () =>
- props.patrolOption === true &&
- !isLocked() &&
- !!(props.alert.resourceId || '').trim();
+ props.patrolOption === true && !isLocked() && !!(props.alert.resourceId || '').trim();
const usesPatrolPrimary = () => showPatrolOption() && props.variant !== 'icon';
const buttonTitle = () =>
isLocked()
diff --git a/frontend-modern/src/components/Alerts/Thresholds/sections/__tests__/CollapsibleSection.test.tsx b/frontend-modern/src/components/Alerts/Thresholds/sections/__tests__/CollapsibleSection.test.tsx
index f04a252e5a..c14fffd64e 100644
--- a/frontend-modern/src/components/Alerts/Thresholds/sections/__tests__/CollapsibleSection.test.tsx
+++ b/frontend-modern/src/components/Alerts/Thresholds/sections/__tests__/CollapsibleSection.test.tsx
@@ -172,9 +172,7 @@ describe('CollapsibleSection', () => {
</CollapsibleSection>
));
- expect(
- screen.queryByText(ALERT_THRESHOLDS_SECTION_DISABLED_LABEL),
- ).not.toBeInTheDocument();
+ expect(screen.queryByText(ALERT_THRESHOLDS_SECTION_DISABLED_LABEL)).not.toBeInTheDocument();
});
it('shows unsaved changes indicator when hasChanges is true', () => {
diff --git a/frontend-modern/src/components/Alerts/ThresholdsTableDockerContainersSection.tsx b/frontend-modern/src/components/Alerts/ThresholdsTableDockerContainersSection.tsx
index eeb64d71f3..be7ad97a86 100644
--- a/frontend-modern/src/components/Alerts/ThresholdsTableDockerContainersSection.tsx
+++ b/frontend-modern/src/components/Alerts/ThresholdsTableDockerContainersSection.tsx
@@ -36,7 +36,9 @@ export function ThresholdsTableDockerContainersSection(props: ThresholdsTableSec
setEditingThresholds={state.setEditingThresholds}
editingNote={state.editingNote}
setEditingNote={state.setEditingNote}
- onBulkEdit={(ids) => state.handleBulkEdit(ids, ['CPU %', 'Memory %', 'Disk %', 'Temp °C'])}
+ onBulkEdit={(ids) =>
+ state.handleBulkEdit(ids, ['CPU %', 'Memory %', 'Disk %', 'Temp °C'])
+ }
formatMetricValue={formatMetricValue}
hasActiveAlert={state.hasActiveAlert}
globalDefaults={{
diff --git a/frontend-modern/src/components/Alerts/ThresholdsTableDockerServiceGapSection.tsx b/frontend-modern/src/components/Alerts/ThresholdsTableDockerServiceGapSection.tsx
index 28749f42f7..bd6de0bf03 100644
--- a/frontend-modern/src/components/Alerts/ThresholdsTableDockerServiceGapSection.tsx
+++ b/frontend-modern/src/components/Alerts/ThresholdsTableDockerServiceGapSection.tsx
@@ -59,7 +59,9 @@ export function ThresholdsTableDockerServiceGapSection(props: ThresholdsTableSec
}}
class="mt-1 w-full rounded-md border border-border bg-surface p-2 text-sm text-base-content focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-200 dark:focus:border-sky-400 dark:focus:ring-sky-600"
/>
- <p class="mt-1 text-xs text-muted">{state.dockerServicePresentation.warningGapDescription}</p>
+ <p class="mt-1 text-xs text-muted">
+ {state.dockerServicePresentation.warningGapDescription}
+ </p>
</div>
<div>
<label
diff --git a/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxBackupsSection.tsx b/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxBackupsSection.tsx
index 020225596c..33f33aecc8 100644
--- a/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxBackupsSection.tsx
+++ b/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxBackupsSection.tsx
@@ -73,7 +73,9 @@ export function ThresholdsTableProxmoxBackupsSection(props: ThresholdsTableSecti
'critical days': prev.criticalDays ?? 0,
};
const nextRecord =
- typeof value === 'function' ? value(currentRecord) : { ...currentRecord, ...value };
+ typeof value === 'function'
+ ? value(currentRecord)
+ : { ...currentRecord, ...value };
return {
...prev,
freshHours:
@@ -120,7 +122,9 @@ export function ThresholdsTableProxmoxBackupsSection(props: ThresholdsTableSecti
<h3 class="text-sm font-semibold text-base-content">
{state.backupOrphanedPresentation.title}
</h3>
- <p class="mt-1 text-xs text-muted">{state.backupOrphanedPresentation.description}</p>
+ <p class="mt-1 text-xs text-muted">
+ {state.backupOrphanedPresentation.description}
+ </p>
</div>
<Toggle
checked={tableProps.backupDefaults().alertOrphaned ?? true}
diff --git a/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxSnapshotsSection.tsx b/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxSnapshotsSection.tsx
index 0cd859d8b8..0f245b8ac2 100644
--- a/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxSnapshotsSection.tsx
+++ b/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxSnapshotsSection.tsx
@@ -59,7 +59,9 @@ export function ThresholdsTableProxmoxSnapshotsSection(props: ThresholdsTableSec
'critical size (gib)': prev.criticalSizeGiB ?? 0,
};
const nextRecord =
- typeof value === 'function' ? value(currentRecord) : { ...currentRecord, ...value };
+ typeof value === 'function'
+ ? value(currentRecord)
+ : { ...currentRecord, ...value };
return {
...prev,
warningDays:
diff --git a/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxStorageSection.tsx b/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxStorageSection.tsx
index 8660caf275..9314066cdc 100644
--- a/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxStorageSection.tsx
+++ b/frontend-modern/src/components/Alerts/ThresholdsTableProxmoxStorageSection.tsx
@@ -60,7 +60,9 @@ export function ThresholdsTableProxmoxStorageSection(props: ThresholdsTableSecti
showDelayColumn={true}
globalDelaySeconds={tableProps.timeThresholds().storage}
metricDelaySeconds={tableProps.metricTimeThresholds().storage ?? {}}
- onMetricDelayChange={(metric, value) => state.updateMetricDelay('storage', metric, value)}
+ onMetricDelayChange={(metric, value) =>
+ state.updateMetricDelay('storage', metric, value)
+ }
factoryDefaults={
tableProps.factoryStorageDefault !== undefined
? { usage: tableProps.factoryStorageDefault }
diff --git a/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx b/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx
index e4a885e5d8..50a6ea7a24 100644
--- a/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx
+++ b/frontend-modern/src/components/Alerts/__tests__/InvestigateAlertButton.test.tsx
@@ -145,7 +145,10 @@ beforeEach(() => {
getUpgradeActionUrlOrFallbackMock.mockReturnValue(getPublicPricingUrl('ai_alerts'));
vi.spyOn(window, 'open').mockImplementation(() => null);
triggerPatrolRunMock.mockReset();
- triggerPatrolRunMock.mockResolvedValue({ success: true, message: 'Triggered targeted Patrol check' });
+ triggerPatrolRunMock.mockResolvedValue({
+ success: true,
+ message: 'Triggered targeted Patrol check',
+ });
notificationStoreMock.success.mockReset();
notificationStoreMock.error.mockReset();
notificationStoreMock.warning.mockReset();
@@ -244,10 +247,7 @@ describe('InvestigateAlertButton', () => {
it('shows locked title when licenseLocked', () => {
render(() => <InvestigateAlertButton alert={makeAlert()} licenseLocked={true} />);
const button = screen.getByRole('button');
- expect(button).toHaveAttribute(
- 'title',
- 'Pro required to ask Pulse Assistant about alerts',
- );
+ expect(button).toHaveAttribute('title', 'Pro required to ask Pulse Assistant about alerts');
});
it('shows unlocked title when not licenseLocked', () => {
diff --git a/frontend-modern/src/components/Alerts/__tests__/alertAssistantHandoffModel.branchcov0712.test.ts b/frontend-modern/src/components/Alerts/__tests__/alertAssistantHandoffModel.branchcov0712.test.ts
index 8b79306806..9e2d197dee 100644
--- a/frontend-modern/src/components/Alerts/__tests__/alertAssistantHandoffModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Alerts/__tests__/alertAssistantHandoffModel.branchcov0712.test.ts
@@ -232,7 +232,7 @@ describe('formatContextLine (exercised via buildAlertAssistantHandoff)', () => {
});
describe('buildAlertAssistantHandoff (node-label, metadata-chain & briefing ternaries)', () => {
- it("falls back to alert.node when nodeDisplayName is undefined (|| chain 2nd arm)", () => {
+ it('falls back to alert.node when nodeDisplayName is undefined (|| chain 2nd arm)', () => {
const handoff = buildHandoff({ node: 'pve2', nodeDisplayName: undefined });
expect(handoff.context.handoffContext).toContain('Node: pve2');
expect(handoff.context.briefing.detailLines).toContain('Node: pve2');
@@ -246,7 +246,7 @@ describe('buildAlertAssistantHandoff (node-label, metadata-chain & briefing tern
expect(handoff.context.briefing.detailLines).toContain('Node: pve2');
});
- it("yields empty nodeLabel when node is falsy (outer ternary false arm) -> drops the Node line", () => {
+ it('yields empty nodeLabel when node is falsy (outer ternary false arm) -> drops the Node line', () => {
const handoff = buildHandoff({ node: '' });
expect(handoff.context.handoffContext).not.toContain('Node:');
expect(handoff.context.briefing.detailLines).not.toContain('Node:');
@@ -254,7 +254,7 @@ describe('buildAlertAssistantHandoff (node-label, metadata-chain & briefing tern
expect(handoff.context.handoffResources[0].node).toBe('');
});
- it("hits the metadata?.resourceType optional-chain false branch when metadata is undefined", () => {
+ it('hits the metadata?.resourceType optional-chain false branch when metadata is undefined', () => {
// makeAlert has no metadata by default; type='cpu' -> targetType inferred from
// the 'vm-101' id via inferAlertTargetTypeFromResourceId.
const handoff = buildHandoff({ type: 'cpu' });
@@ -271,7 +271,7 @@ describe('buildAlertAssistantHandoff (node-label, metadata-chain & briefing tern
expect(handoff.context.targetType).toBe('vm');
});
- it("omits the currentMetric detailLine for a state alert (hasMetricValues false -> briefing ternary false arm)", () => {
+ it('omits the currentMetric detailLine for a state alert (hasMetricValues false -> briefing ternary false arm)', () => {
const handoff = buildHandoff({ type: 'powered-off', value: 0, threshold: 0 });
expect(handoff.context.briefing.detailLines).toEqual([
'Node: PVE Node 1',
@@ -283,21 +283,21 @@ describe('buildAlertAssistantHandoff (node-label, metadata-chain & briefing tern
expect(handoff.context.handoffContext).not.toContain('Threshold:');
});
- it("keeps the currentMetric detailLine for a metric alert (hasMetricValues true -> briefing ternary true arm)", () => {
+ it('keeps the currentMetric detailLine for a metric alert (hasMetricValues true -> briefing ternary true arm)', () => {
const handoff = buildHandoff({ type: 'cpu', value: 92.5, threshold: 80 });
expect(handoff.context.briefing.detailLines).toContain('Current value 92.5%; threshold 80.0%');
expect(handoff.context.handoffContext).toContain('Current Value: 92.5%');
expect(handoff.context.handoffContext).toContain('Threshold: 80.0%');
});
- it("leaves context.vmid undefined when vmid is not supplied", () => {
+ it('leaves context.vmid undefined when vmid is not supplied', () => {
const handoff = buildHandoff();
// The source spreads `vmid` (shorthand) from the optional input, so the key
// exists but holds undefined when the caller omits it.
expect(handoff.context.context.vmid).toBeUndefined();
});
- it("propagates vmid into context when supplied", () => {
+ it('propagates vmid into context when supplied', () => {
const handoff = buildHandoff({}, { vmid: 101 });
expect(handoff.context.context.vmid).toBe(101);
});
diff --git a/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov0712.test.ts b/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov0712.test.ts
index ec619b4c05..9de2594c41 100644
--- a/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov0712.test.ts
@@ -117,9 +117,9 @@ describe('hasCustomAlertResourceGlobalDefaults', () => {
});
it('returns false when a factory key is absent from globalDefaults (current is undefined)', () => {
- expect(
- hasCustomAlertResourceGlobalDefaults({ memory: 90 }, { cpu: 80, memory: 90 }),
- ).toBe(false);
+ expect(hasCustomAlertResourceGlobalDefaults({ memory: 90 }, { cpu: 80, memory: 90 })).toBe(
+ false,
+ );
});
it('returns true when exactly one of many keys differs', () => {
@@ -671,9 +671,9 @@ describe('extract closure — optional-chain and metric-capture branch coverage'
it('reads the diskRead key from editingThresholds when metric is "diskRead"', () => {
const resource = makeResource({ defaults: { diskRead: 10 } });
- expect(getAlertResourceMetricDisplayValue(resource, 'diskRead', { diskRead: 250 }, true)).toBe(
- 250,
- );
+ expect(
+ getAlertResourceMetricDisplayValue(resource, 'diskRead', { diskRead: 250 }, true),
+ ).toBe(250);
});
it('reads the networkOut key from thresholds for a multi-word metric name', () => {
diff --git a/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov2.test.ts b/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov2.test.ts
index 6a0d9af059..d64cda5988 100644
--- a/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Alerts/__tests__/alertResourceTableModel.branchcov2.test.ts
@@ -117,9 +117,9 @@ describe('hasCustomAlertResourceGlobalDefaults', () => {
});
it('returns false when a factory key is absent from globalDefaults (current is undefined)', () => {
- expect(
- hasCustomAlertResourceGlobalDefaults({ memory: 90 }, { cpu: 80, memory: 90 }),
- ).toBe(false);
+ expect(hasCustomAlertResourceGlobalDefaults({ memory: 90 }, { cpu: 80, memory: 90 })).toBe(
+ false,
+ );
});
it('returns true when exactly one of many keys differs', () => {
diff --git a/frontend-modern/src/components/Alerts/__tests__/incidentAssistantHandoffModel.branchcov2.test.ts b/frontend-modern/src/components/Alerts/__tests__/incidentAssistantHandoffModel.branchcov2.test.ts
index 137cb0dcd7..1122f644bb 100644
--- a/frontend-modern/src/components/Alerts/__tests__/incidentAssistantHandoffModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Alerts/__tests__/incidentAssistantHandoffModel.branchcov2.test.ts
@@ -339,10 +339,7 @@ describe('formatContextLine (exercised via buildAlertIncidentAssistantHandoff)',
it('omits the "Message:" context line and briefing detailLine when message is undefined', () => {
const handoff = buildHandoff(makeIncident({ message: undefined }));
expect(handoff.context.handoffContext).not.toContain('Message:');
- expect(handoff.context.briefing.detailLines).toEqual([
- '2 timeline events',
- 'Node: edge-1',
- ]);
+ expect(handoff.context.briefing.detailLines).toEqual(['2 timeline events', 'Node: edge-1']);
});
it('omits the "Node:" context line when node is an empty string (trim -> empty -> undefined)', () => {
diff --git a/frontend-modern/src/components/Alerts/useWebhookConfigState.ts b/frontend-modern/src/components/Alerts/useWebhookConfigState.ts
index a536567c73..94f9316ff3 100644
--- a/frontend-modern/src/components/Alerts/useWebhookConfigState.ts
+++ b/frontend-modern/src/components/Alerts/useWebhookConfigState.ts
@@ -1,11 +1,7 @@
import { createEffect, createSignal } from 'solid-js';
import type { Accessor } from 'solid-js';
-import {
- NotificationsAPI,
- type Webhook,
- type WebhookTemplate,
-} from '@/api/notifications';
+import { NotificationsAPI, type Webhook, type WebhookTemplate } from '@/api/notifications';
import { logger } from '@/utils/logger';
import {
getAlertWebhookCustomFieldInputs,
@@ -145,7 +141,8 @@ export function useWebhookConfigState(props: WebhookConfigProps): WebhookConfigS
}
});
- const currentTemplate = () => templates().find((template) => template.service === formData().service);
+ const currentTemplate = () =>
+ templates().find((template) => template.service === formData().service);
const toggleAllWebhooks = (enabled: boolean) => {
props.webhooks.forEach((webhook) => {
@@ -310,9 +307,7 @@ export function useWebhookConfigState(props: WebhookConfigProps): WebhookConfigS
};
const removeCustomFieldInput = (index: number) => {
- updateCustomFieldInputs((inputs) =>
- inputs.filter((_, currentIndex) => currentIndex !== index),
- );
+ updateCustomFieldInputs((inputs) => inputs.filter((_, currentIndex) => currentIndex !== index));
};
const addCustomFieldInput = () => {
diff --git a/frontend-modern/src/components/Discovery/cliCommand.test.ts b/frontend-modern/src/components/Discovery/cliCommand.test.ts
index 93cbcc444f..8b57eb9780 100644
--- a/frontend-modern/src/components/Discovery/cliCommand.test.ts
+++ b/frontend-modern/src/components/Discovery/cliCommand.test.ts
@@ -4,7 +4,11 @@ import { deriveCliCommand } from './cliCommand';
describe('deriveCliCommand', () => {
it('derives pct exec for a native LXC', () => {
expect(
- deriveCliCommand('system-container', '101', 'Use pulse_control ... directly inside the container.'),
+ deriveCliCommand(
+ 'system-container',
+ '101',
+ 'Use pulse_control ... directly inside the container.',
+ ),
).toBe('pct exec 101 -- bash');
});
@@ -23,7 +27,9 @@ describe('deriveCliCommand', () => {
it('returns null for types without a clean human command (VM, k8s, agent)', () => {
expect(deriveCliCommand('vm', '200', 'Use pulse_control ... inside the VM.')).toBeNull();
- expect(deriveCliCommand('pod', 'web-0', 'Use kubectl exec -n default web-0 -- <cmd>')).toBeNull();
+ expect(
+ deriveCliCommand('pod', 'web-0', 'Use kubectl exec -n default web-0 -- <cmd>'),
+ ).toBeNull();
expect(deriveCliCommand('agent', 'node1', 'Use pulse_control ...')).toBeNull();
});
diff --git a/frontend-modern/src/components/Infrastructure/ClusterDeployBanner.tsx b/frontend-modern/src/components/Infrastructure/ClusterDeployBanner.tsx
index 74a08f2701..71f8635fa5 100644
--- a/frontend-modern/src/components/Infrastructure/ClusterDeployBanner.tsx
+++ b/frontend-modern/src/components/Infrastructure/ClusterDeployBanner.tsx
@@ -52,7 +52,8 @@ export const ClusterDeployBanner: Component<ClusterDeployBannerProps> = (props)
<div class="flex items-center gap-1.5 text-[11px] text-blue-600 dark:text-blue-400">
<InfoIcon class="w-3 h-3" />
<span>
- {info().deployableCount} node{info().deployableCount !== 1 ? 's' : ''} ready for Pulse Agent
+ {info().deployableCount} node{info().deployableCount !== 1 ? 's' : ''} ready for Pulse
+ Agent
</span>
</div>
<button
diff --git a/frontend-modern/src/components/Infrastructure/MaintenanceVerificationSection.tsx b/frontend-modern/src/components/Infrastructure/MaintenanceVerificationSection.tsx
index e71eb1452a..3fa077aad1 100644
--- a/frontend-modern/src/components/Infrastructure/MaintenanceVerificationSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/MaintenanceVerificationSection.tsx
@@ -42,12 +42,9 @@ const STATUS_LABELS: Record<MaintenanceVerificationStatus, string> = {
const STATUS_CLASSES: Record<MaintenanceVerificationStatus, string> = {
pending: 'bg-surface-hover text-base-content',
- healthy:
- 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900 dark:text-emerald-300',
- needs_review:
- 'bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-300',
- failed_verification:
- 'bg-rose-100 text-rose-700 dark:bg-rose-900 dark:text-rose-300',
+ healthy: 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900 dark:text-emerald-300',
+ needs_review: 'bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-300',
+ failed_verification: 'bg-rose-100 text-rose-700 dark:bg-rose-900 dark:text-rose-300',
};
export const MaintenanceVerificationSection: Component<MaintenanceVerificationSectionProps> = (
@@ -63,9 +60,7 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
return res.data ?? [];
} catch (err) {
notificationStore.error(
- err instanceof Error
- ? err.message
- : 'Failed to load Maintenance Verification Reports',
+ err instanceof Error ? err.message : 'Failed to load Maintenance Verification Reports',
);
return [];
}
@@ -91,9 +86,7 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
refresh();
} catch (err) {
notificationStore.error(
- err instanceof Error
- ? err.message
- : 'Failed to rerun maintenance verification',
+ err instanceof Error ? err.message : 'Failed to rerun maintenance verification',
);
} finally {
setRerunning(false);
@@ -109,9 +102,7 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
refresh();
} catch (err) {
notificationStore.error(
- err instanceof Error
- ? err.message
- : 'Failed to mark report reviewed',
+ err instanceof Error ? err.message : 'Failed to mark report reviewed',
);
} finally {
setReviewingId(null);
@@ -126,16 +117,12 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
>
<header class="flex flex-wrap items-center justify-between gap-2">
<div>
- <h3
- id="maintenance-verification-heading"
- class="text-sm font-semibold text-base-content"
- >
+ <h3 id="maintenance-verification-heading" class="text-sm font-semibold text-base-content">
Maintenance verification
</h3>
<p class="text-xs text-muted">
- Pulse runs deterministic checks each time a maintenance window
- ends and writes a Maintenance Verification Report. The result
- sticks here for review.
+ Pulse runs deterministic checks each time a maintenance window ends and writes a
+ Maintenance Verification Report. The result sticks here for review.
</p>
</div>
<button
@@ -153,8 +140,8 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
when={hasReports()}
fallback={
<div class="mt-3 rounded border border-dashed border-border bg-surface-hover p-3 text-xs text-muted">
- No verification reports yet. A report is written automatically the
- next time this resource exits a maintenance window.
+ No verification reports yet. A report is written automatically the next time this
+ resource exits a maintenance window.
</div>
}
>
@@ -175,9 +162,7 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
</span>
<span class="text-xs text-muted">
Window ended{' '}
- {report.windowEndedAt
- ? formatRelativeTime(report.windowEndedAt)
- : 'unknown'}
+ {report.windowEndedAt ? formatRelativeTime(report.windowEndedAt) : 'unknown'}
</span>
</div>
<Show when={!report.userOutcome}>
@@ -193,10 +178,7 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
</Show>
<Show when={report.userOutcome === 'reviewed'}>
<span class="text-[11px] text-muted">
- Reviewed{' '}
- {report.reviewedAt
- ? formatRelativeTime(report.reviewedAt)
- : ''}
+ Reviewed {report.reviewedAt ? formatRelativeTime(report.reviewedAt) : ''}
{report.reviewedBy ? ` by ${report.reviewedBy}` : ''}
</span>
</Show>
@@ -216,15 +198,11 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
<dd>{report.evidence.activeWarningAlerts}</dd>
</div>
<div>
- <dt class="font-medium text-base-content">
- Critical findings
- </dt>
+ <dt class="font-medium text-base-content">Critical findings</dt>
<dd>{report.evidence.activeCriticalFindings}</dd>
</div>
<div>
- <dt class="font-medium text-base-content">
- Warning findings
- </dt>
+ <dt class="font-medium text-base-content">Warning findings</dt>
<dd>{report.evidence.activeWarningFindings}</dd>
</div>
<div>
@@ -235,15 +213,11 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
{(rec) => (
<>
<div>
- <dt class="font-medium text-base-content">
- Metric samples
- </dt>
+ <dt class="font-medium text-base-content">Metric samples</dt>
<dd>{rec().samplesAfterEnd}</dd>
</div>
<div>
- <dt class="font-medium text-base-content">
- Metric trend
- </dt>
+ <dt class="font-medium text-base-content">Metric trend</dt>
<dd>{rec().trend || 'unknown'}</dd>
</div>
</>
@@ -252,15 +226,11 @@ export const MaintenanceVerificationSection: Component<MaintenanceVerificationSe
</dl>
<Show when={report.evidence.operatorStateSummary}>
- <p class="mt-1 text-[11px] text-muted">
- {report.evidence.operatorStateSummary}
- </p>
+ <p class="mt-1 text-[11px] text-muted">{report.evidence.operatorStateSummary}</p>
</Show>
<Show when={report.evidence.patrolRunTodo}>
- <p class="mt-1 text-[11px] italic text-muted">
- {report.evidence.patrolRunTodo}
- </p>
+ <p class="mt-1 text-[11px] italic text-muted">{report.evidence.patrolRunTodo}</p>
</Show>
<Show when={report.userOutcome === 'reviewed' && report.reviewNote}>
diff --git a/frontend-modern/src/components/Infrastructure/ResourceActionHistory.tsx b/frontend-modern/src/components/Infrastructure/ResourceActionHistory.tsx
index 2a29aee4d2..1bcb8a1734 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceActionHistory.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceActionHistory.tsx
@@ -113,8 +113,18 @@ const ActionHistoryRow: Component<{ audit: ActionAuditRecord }> = (props) => {
})()}
</Show>
<Show when={apt()?.facts.length}>
- <dl data-testid="resource-apt-action-facts" class="grid gap-1 rounded border border-border bg-surface px-2 py-1.5 sm:grid-cols-2">
- <For each={apt()?.facts ?? []}>{(fact) => <div class="flex items-start justify-between gap-2"><dt class="text-muted">{fact.label}</dt><dd class="text-right font-medium text-base-content">{fact.value}</dd></div>}</For>
+ <dl
+ data-testid="resource-apt-action-facts"
+ class="grid gap-1 rounded border border-border bg-surface px-2 py-1.5 sm:grid-cols-2"
+ >
+ <For each={apt()?.facts ?? []}>
+ {(fact) => (
+ <div class="flex items-start justify-between gap-2">
+ <dt class="text-muted">{fact.label}</dt>
+ <dd class="text-right font-medium text-base-content">{fact.value}</dd>
+ </div>
+ )}
+ </For>
</dl>
</Show>
<Show when={verificationOutcome()}>
@@ -136,14 +146,33 @@ const ActionHistoryRow: Component<{ audit: ActionAuditRecord }> = (props) => {
</Show>
<Show when={compensation()}>
{(recovery) => (
- <div data-testid="resource-action-recovery-truth" class="rounded border border-border bg-surface px-2 py-1 text-[10px] text-base-content">
- <div class="font-medium">Recovery: {formatActionCapabilityLabel(recovery().status)}</div>
- <div class="mt-0.5 text-muted">Support: {formatActionCapabilityLabel(recovery().support)}</div>
- <Show when={recovery().summary}><div class="mt-0.5">{recovery().summary}</div></Show>
+ <div
+ data-testid="resource-action-recovery-truth"
+ class="rounded border border-border bg-surface px-2 py-1 text-[10px] text-base-content"
+ >
+ <div class="font-medium">
+ Recovery: {formatActionCapabilityLabel(recovery().status)}
+ </div>
+ <div class="mt-0.5 text-muted">
+ Support: {formatActionCapabilityLabel(recovery().support)}
+ </div>
+ <Show when={recovery().summary}>
+ <div class="mt-0.5">{recovery().summary}</div>
+ </Show>
+ </div>
+ )}
+ </Show>
+ <Show when={apt()}>
+ {(presentation) => (
+ <div
+ data-testid="resource-apt-action-next-step"
+ class="rounded border border-blue-200 bg-blue-50 px-2 py-1 text-[10px] text-blue-900 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-200"
+ >
+ <span class="font-medium">Next: </span>
+ {presentation().nextStep}
</div>
)}
</Show>
- <Show when={apt()}>{(presentation) => <div data-testid="resource-apt-action-next-step" class="rounded border border-blue-200 bg-blue-50 px-2 py-1 text-[10px] text-blue-900 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-200"><span class="font-medium">Next: </span>{presentation().nextStep}</div>}</Show>
<Show when={shouldRenderActionAuditVerification(props.audit)}>
{(() => {
const v = verification()!;
@@ -153,7 +182,9 @@ const ActionHistoryRow: Component<{ audit: ActionAuditRecord }> = (props) => {
return (
<div class={`rounded border px-2 py-1 text-[10px] ${toneClass}`}>
<div class="font-medium">
- {v.success ? 'Legacy check passed (source unclassified)' : 'Legacy check failed (source unclassified)'}
+ {v.success
+ ? 'Legacy check passed (source unclassified)'
+ : 'Legacy check failed (source unclassified)'}
</div>
<Show when={v.command}>
<div class="mt-0.5 font-mono text-[10px] opacity-80">{v.command}</div>
diff --git a/frontend-modern/src/components/Infrastructure/ResourceOperatorStateSection.tsx b/frontend-modern/src/components/Infrastructure/ResourceOperatorStateSection.tsx
index 0bf8452ab6..6db534d165 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceOperatorStateSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceOperatorStateSection.tsx
@@ -676,8 +676,8 @@ export const ResourceOperatorStateSection: Component<ResourceOperatorStateSectio
<div class="flex-1">
<label class="text-sm font-medium text-base-content">Automatic actions</label>
<p class="mt-0.5 text-[11px] leading-tight text-muted">
- Choose exactly which actions Patrol may run on this resource. Your Patrol mode,
- live safety checks, remediation locks, and verification still apply.
+ Choose exactly which actions Patrol may run on this resource. Your Patrol mode, live
+ safety checks, remediation locks, and verification still apply.
</p>
</div>
<Toggle
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/MaintenanceVerificationSection.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/MaintenanceVerificationSection.test.ts
index 7a387af02a..fea3998b89 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/MaintenanceVerificationSection.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/MaintenanceVerificationSection.test.ts
@@ -48,7 +48,7 @@ describe('MaintenanceVerificationSection', () => {
});
it('hides the review button once the report has been reviewed', () => {
- expect(sectionSource).toContain("when={!report.userOutcome}");
+ expect(sectionSource).toContain('when={!report.userOutcome}');
expect(sectionSource).toContain("when={report.userOutcome === 'reviewed'}");
});
@@ -64,7 +64,9 @@ describe('maintenanceVerification API client', () => {
});
it('exposes the four operations the section needs', () => {
- expect(apiClientSource).toContain('export async function listMaintenanceVerificationsForResource');
+ expect(apiClientSource).toContain(
+ 'export async function listMaintenanceVerificationsForResource',
+ );
expect(apiClientSource).toContain('export async function reviewMaintenanceVerification');
expect(apiClientSource).toContain('export async function rerunMaintenanceVerification');
});
@@ -80,7 +82,9 @@ describe('maintenanceVerification API client', () => {
describe('ResourceDetailDrawerOverviewTab integration', () => {
it('renders MaintenanceVerificationSection directly under the operator-state section', () => {
expect(overviewTabSource).toContain("from './MaintenanceVerificationSection'");
- expect(overviewTabSource).toContain('<MaintenanceVerificationSection resourceId={resource.id} />');
+ expect(overviewTabSource).toContain(
+ '<MaintenanceVerificationSection resourceId={resource.id} />',
+ );
const operatorIndex = overviewTabSource.indexOf('<ResourceOperatorStateSection');
const verificationIndex = overviewTabSource.indexOf('<MaintenanceVerificationSection');
expect(operatorIndex).toBeGreaterThan(0);
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceActionHistory.verification.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/ResourceActionHistory.verification.test.ts
index 49ff4ea94a..63e8ae2448 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceActionHistory.verification.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceActionHistory.verification.test.ts
@@ -79,23 +79,68 @@ describe('ResourceActionHistory verification rendering', () => {
it('keeps APT execution, verification, recovery, bounded facts, and next step separate without a duplicate legacy card', () => {
cleanup();
const apt = actionAudit({
- request: { requestId: 'apt-request', resourceId: 'proxmox:node:pve-1', capabilityName: 'install_os_updates', reason: 'Resolve pending operating system updates', requestedBy: 'pulse_patrol' },
- plan: { actionId: 'apt-action', requestId: 'apt-request', allowed: true, requiresApproval: true, approvalPolicy: 'admin', rollbackAvailable: false },
- result: { success: false, actionResultV2: {
- version: 2,
- execution: { status: 'inconclusive', summary: 'APT package updates: phase=install; 6 pending before, 3 pending after; package manager health: unhealthy; recovery required: true; reboot required: false' },
- verification: { status: 'contradicted', evidenceClass: 'agent_attested', summary: 'Three updates still remain.' },
- compensation: { support: 'unavailable', status: 'not_available', summary: 'No rollback is available; repair is required.' },
- } },
- verification: { ran: true, success: false, command: 'legacy command must not render', output: 'legacy output must not render' },
+ request: {
+ requestId: 'apt-request',
+ resourceId: 'proxmox:node:pve-1',
+ capabilityName: 'install_os_updates',
+ reason: 'Resolve pending operating system updates',
+ requestedBy: 'pulse_patrol',
+ },
+ plan: {
+ actionId: 'apt-action',
+ requestId: 'apt-request',
+ allowed: true,
+ requiresApproval: true,
+ approvalPolicy: 'admin',
+ rollbackAvailable: false,
+ },
+ result: {
+ success: false,
+ actionResultV2: {
+ version: 2,
+ execution: {
+ status: 'inconclusive',
+ summary:
+ 'APT package updates: phase=install; 6 pending before, 3 pending after; package manager health: unhealthy; recovery required: true; reboot required: false',
+ },
+ verification: {
+ status: 'contradicted',
+ evidenceClass: 'agent_attested',
+ summary: 'Three updates still remain.',
+ },
+ compensation: {
+ support: 'unavailable',
+ status: 'not_available',
+ summary: 'No rollback is available; repair is required.',
+ },
+ },
+ },
+ verification: {
+ ran: true,
+ success: false,
+ command: 'legacy command must not render',
+ output: 'legacy output must not render',
+ },
});
- render(() => ResourceActionHistory({ audits: [apt], count: 1, loadingLabel: 'Actions loaded', error: '', onRetry: () => undefined }));
+ render(() =>
+ ResourceActionHistory({
+ audits: [apt],
+ count: 1,
+ loadingLabel: 'Actions loaded',
+ error: '',
+ onRetry: () => undefined,
+ }),
+ );
const history = within(screen.getByTestId('resource-action-history-section'));
expect(history.getByText('Execution inconclusive')).toBeInTheDocument();
expect(history.getByText('Outcome contradicted')).toBeInTheDocument();
expect(history.getByText('Recovery: Not Available')).toBeInTheDocument();
expect(history.getByText('Known unhealthy')).toBeInTheDocument();
- expect(history.getByText('Do not retry. Repair the host update system, run a fresh scan, and create a new plan only after health is known.')).toBeInTheDocument();
+ expect(
+ history.getByText(
+ 'Do not retry. Repair the host update system, run a fresh scan, and create a new plan only after health is known.',
+ ),
+ ).toBeInTheDocument();
expect(history.queryByText('legacy command must not render')).toBeNull();
expect(history.queryByText('Legacy check failed (source unclassified)')).toBeNull();
expect(screen.getAllByTestId('resource-action-recovery-truth')).toHaveLength(1);
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.docker-container.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.docker-container.test.tsx
index 5c4b0f8613..6dd4347a0c 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.docker-container.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.docker-container.test.tsx
@@ -80,7 +80,12 @@ vi.mock('@/api/resourceActions', () => ({
status: 'legacy_unknown',
scope: { orgId: '', resourceId: '', capabilityName: '' },
authorities: [],
- approvalRequirement: { version: 0, floor: 'admin', quorum: 1, disallowRequester: false },
+ approvalRequirement: {
+ version: 0,
+ floor: 'admin',
+ quorum: 1,
+ disallowRequester: false,
+ },
planningAllowed: false,
requiresApproval: true,
},
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx
index 6316d5a573..231b7a6a9c 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx
@@ -280,9 +280,7 @@ describe('ResourceDetailDrawer service cards', () => {
},
});
- const { getByRole, getByTestId } = render(() => (
- <ResourceDetailDrawer resource={resource} />
- ));
+ const { getByRole, getByTestId } = render(() => <ResourceDetailDrawer resource={resource} />);
fireEvent.click(getByRole('button', { name: 'Show service' }));
fireEvent.click(getByRole('button', { name: 'Show mail flow' }));
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.branchcov.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.branchcov.test.ts
index 191c5472d7..6157ef3b2b 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.branchcov.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/infrastructureSelectors.branchcov.test.ts
@@ -329,9 +329,9 @@ describe('getOutlierEmphasis (branch coverage)', () => {
});
it('returns baseline when stats.max <= 0', () => {
- expect(
- getOutlierEmphasis(5, { median: 0, mad: 0, max: 0, p97: 0, p99: 0, count: 5 }),
- ).toEqual(BASELINE);
+ expect(getOutlierEmphasis(5, { median: 0, mad: 0, max: 0, p97: 0, p99: 0, count: 5 })).toEqual(
+ BASELINE,
+ );
});
describe('small sample path (count < 4)', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceAssistantContextModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceAssistantContextModel.test.ts
index eba687a846..c15ad65b9c 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceAssistantContextModel.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceAssistantContextModel.test.ts
@@ -50,8 +50,6 @@ describe('buildResourceAssistantContext', () => {
expect(context.briefing?.detailLines).toContain(
'Discovery data: Discovery fresh, service Home Assistant, 5 facts',
);
- expect(context.briefing?.statusLabel).toBe(
- 'Read-only context attached · Discovery fresh',
- );
+ expect(context.briefing?.statusLabel).toBe('Read-only context attached · Discovery fresh');
});
});
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDiscoveryModel.branchcov.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDiscoveryModel.branchcov.test.ts
index bca8a4edf9..3908020b54 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDiscoveryModel.branchcov.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDiscoveryModel.branchcov.test.ts
@@ -35,7 +35,9 @@ const baseResource = (overrides: Partial<Resource> = {}): Resource =>
...overrides,
}) as unknown as Resource;
-const discoveryTarget = (overrides: Partial<ResourceDiscoveryTarget> = {}): ResourceDiscoveryTarget =>
+const discoveryTarget = (
+ overrides: Partial<ResourceDiscoveryTarget> = {},
+): ResourceDiscoveryTarget =>
({
resourceType: 'agent',
agentId: 'agent-default',
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerKubernetesModel.branchcov2.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerKubernetesModel.branchcov2.test.ts
index 2211234c07..a5b0716410 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerKubernetesModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerKubernetesModel.branchcov2.test.ts
@@ -105,9 +105,9 @@ describe('containerRow (via Containers section)', () => {
});
it('treats a negative restartCount as zero restarts', () => {
- expect(singleContainerRow({ name: 'c', state: 'running', ready: true, restartCount: -3 })?.value).toBe(
- 'running · ready',
- );
+ expect(
+ singleContainerRow({ name: 'c', state: 'running', ready: true, restartCount: -3 })?.value,
+ ).toBe('running · ready');
});
it('treats whitespace-only state/name/image as absent', () => {
@@ -176,7 +176,9 @@ describe('buildKubernetesDetailsSummary', () => {
it('returns null for a node with neither OS image nor cordon state', () => {
expect(
- buildKubernetesDetailsSummary(makeResource({ id: 'node-3', type: 'k8s-node', kubernetes: {} })),
+ buildKubernetesDetailsSummary(
+ makeResource({ id: 'node-3', type: 'k8s-node', kubernetes: {} }),
+ ),
).toBeNull();
});
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerMetricsHistoryModel.branchcov0712.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerMetricsHistoryModel.branchcov0712.test.ts
index d60d0d56e9..2709d00951 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerMetricsHistoryModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerMetricsHistoryModel.branchcov0712.test.ts
@@ -4,10 +4,7 @@ import {
getResourceMetricsHistoryFallbackMetrics,
getResourceMetricsHistoryTarget,
} from '@/components/Infrastructure/resourceDetailDrawerMetricsHistoryModel';
-import type {
- MetricsHistoryTargetResourceType,
- Resource,
-} from '@/types/resource';
+import type { MetricsHistoryTargetResourceType, Resource } from '@/types/resource';
// Minimal valid Resource fixture; mirrors the baseResource() convention used by
// sibling branchcov tests in this directory.
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.branchcov2.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.branchcov2.test.ts
index e45a853ad2..f55fe0b02c 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.branchcov2.test.ts
@@ -83,8 +83,7 @@ describe('buildKubernetesCapabilityBadges branch coverage', () => {
{
label: 'Node Telemetry (Agent)',
classes: SUPPORTED_BADGE_CLASS,
- title:
- 'Linked Pulse agent provides node uptime, temperature, disk, network, and disk I/O.',
+ title: 'Linked Pulse agent provides node uptime, temperature, disk, network, and disk I/O.',
},
{
label: 'Pod Ephemeral Disk',
@@ -267,9 +266,7 @@ describe('buildHostDetailSummary branch coverage', () => {
});
it('dedupes repeated card names before joining', () => {
- expect(buildHostDetailSummary(['system', 'system', 'hardware'])).toBe(
- 'System and Hardware',
- );
+ expect(buildHostDetailSummary(['system', 'system', 'hardware'])).toBe('System and Hardware');
});
});
@@ -287,9 +284,7 @@ describe('buildAccessSummary branch coverage', () => {
{ href: '/a', label: 'A', compactLabel: 'A', ariaLabel: 'A' },
{ href: '/b', label: 'B', compactLabel: 'B', ariaLabel: 'B' },
];
- expect(buildAccessSummary({ hasWebInterface: true, links })).toBe(
- 'Web interface · 2 links',
- );
+ expect(buildAccessSummary({ hasWebInterface: true, links })).toBe('Web interface · 2 links');
});
it('returns the bare link count when web interface is absent and exactly one link is present', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
index 164d78a232..41e68966b2 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
@@ -47,8 +47,7 @@ describe('resourceDetailDrawerOperationalModel', () => {
label: 'Node Telemetry (Agent)',
classes:
'inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-cyan-100 text-cyan-700 dark:bg-cyan-900 dark:text-cyan-400',
- title:
- 'Linked Pulse agent provides node uptime, temperature, disk, network, and disk I/O.',
+ title: 'Linked Pulse agent provides node uptime, temperature, disk, network, and disk I/O.',
},
{
label: 'Pod CPU/Memory',
@@ -74,13 +73,10 @@ describe('resourceDetailDrawerOperationalModel', () => {
it('surfaces only non-healthy source health summaries', () => {
expect(
- buildSourceSummary(
- ['agent', 'docker'],
- {
- agent: { status: 'healthy' },
- docker: { status: 'degraded' },
- },
- ),
+ buildSourceSummary(['agent', 'docker'], {
+ agent: { status: 'healthy' },
+ docker: { status: 'degraded' },
+ }),
).toEqual({
label: '1/2 degraded',
className: 'text-amber-600 dark:text-amber-400',
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.branchcov.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.branchcov.test.ts
index 18349aadbe..adaac8ec3b 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.branchcov.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.branchcov.test.ts
@@ -397,9 +397,7 @@ describe('formatPbsEvidenceSource (via evidence sourceLabel)', () => {
it('returns the generic "Observed task history" for non-backup task history', () => {
const pbs: PBSPlatformData = {
- jobHealthEvidence: [
- evidence({ id: 'src', family: 'verify', evidenceScope: 'task-history' }),
- ],
+ jobHealthEvidence: [evidence({ id: 'src', family: 'verify', evidenceScope: 'task-history' })],
};
expect(evidenceWithId(pbs, 'src')?.sourceLabel).toBe('Observed task history');
});
@@ -501,9 +499,7 @@ describe('buildPbsEvidenceFreshnessLabel (via evidence freshnessLabel)', () => {
it('falls back to the unix last-run-endtime when the ISO time is absent', () => {
const pbs: PBSPlatformData = {
- jobHealthEvidence: [
- evidence({ id: 'fr', 'last-run-endtime': 1776717000 }),
- ],
+ jobHealthEvidence: [evidence({ id: 'fr', 'last-run-endtime': 1776717000 })],
};
expect(evidenceWithId(pbs, 'fr')?.freshnessLabel).toBe('Last run 2026-04-20T20:30:00Z');
});
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage.test.ts
index ae7708df6f..504135dc16 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage.test.ts
@@ -34,10 +34,7 @@ const sectionLabels = (resource: Resource): string[] =>
const allRows = (resource: Resource): ResourceDetailDrawerTrueNASRow[] =>
buildTrueNASDetailSections(resource).flatMap((section) => section.rows);
-const findRow = (
- resource: Resource,
- label: string,
-): ResourceDetailDrawerTrueNASRow | undefined =>
+const findRow = (resource: Resource, label: string): ResourceDetailDrawerTrueNASRow | undefined =>
allRows(resource).find((row) => row.label === label);
const systemWithService = (service: ResourceTrueNASServiceMeta): Resource =>
@@ -46,8 +43,7 @@ const systemWithService = (service: ResourceTrueNASServiceMeta): Resource =>
const diskResource = (disk: ResourcePhysicalDiskMeta): Resource =>
baseResource({ physicalDisk: disk });
-const storageResource = (storage: ResourceStorageMeta): Resource =>
- baseResource({ storage });
+const storageResource = (storage: ResourceStorageMeta): Resource => baseResource({ storage });
describe('truenasServiceStatus / serviceStatusLabel / serviceStatusTone', () => {
// A single service must resolve to exactly one status row; its label and tone
@@ -169,9 +165,9 @@ describe('truenasServiceStatus / serviceStatusLabel / serviceStatusTone', () =>
describe('storageKindLabel', () => {
it('prefers topology over type', () => {
- expect(
- findRow(storageResource({ topology: 'dataset', type: 'zfs_pool' }), 'Kind')?.value,
- ).toBe('Dataset');
+ expect(findRow(storageResource({ topology: 'dataset', type: 'zfs_pool' }), 'Kind')?.value).toBe(
+ 'Dataset',
+ );
});
it('falls back to type when topology is absent', () => {
@@ -317,9 +313,9 @@ describe('booleanValue (via the VM Autostart flag)', () => {
});
it('returns "Disabled" for false', () => {
- expect(findRow(baseResource({ truenas: { vm: { autostart: false } } }), 'Autostart')?.value).toBe(
- 'Disabled',
- );
+ expect(
+ findRow(baseResource({ truenas: { vm: { autostart: false } } }), 'Autostart')?.value,
+ ).toBe('Disabled');
});
it('returns null (row omitted) for undefined', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage2.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage2.test.ts
index 23035b5301..8542498e2a 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage2.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerTrueNASModel.coverage2.test.ts
@@ -39,10 +39,7 @@ const baseResource = (overrides: Partial<Resource>): Resource =>
const allRows = (resource: Resource): ResourceDetailDrawerTrueNASRow[] =>
buildTrueNASDetailSections(resource).flatMap((section) => section.rows);
-const findRow = (
- resource: Resource,
- label: string,
-): ResourceDetailDrawerTrueNASRow | undefined =>
+const findRow = (resource: Resource, label: string): ResourceDetailDrawerTrueNASRow | undefined =>
allRows(resource).find((row) => row.label === label);
// --- fixture builders -----------------------------------------------------
@@ -174,9 +171,9 @@ describe('summarizeList (via App list rows)', () => {
});
it('appends a +N suffix when values exceed the visible count', () => {
- expect(
- findRow(appRes({ usedHostIps: ['a', 'b', 'c', 'd', 'e'] }), 'Host IPs')?.value,
- ).toBe('a, b, c +2');
+ expect(findRow(appRes({ usedHostIps: ['a', 'b', 'c', 'd', 'e'] }), 'Host IPs')?.value).toBe(
+ 'a, b, c +2',
+ );
});
it('omits the row when the list is empty', () => {
@@ -184,15 +181,15 @@ describe('summarizeList (via App list rows)', () => {
});
it('trims and filters whitespace-only entries', () => {
- expect(
- findRow(appRes({ usedHostIps: [' x ', '', ' ', 'y'] }), 'Host IPs')?.value,
- ).toBe('x, y');
+ expect(findRow(appRes({ usedHostIps: [' x ', '', ' ', 'y'] }), 'Host IPs')?.value).toBe(
+ 'x, y',
+ );
});
it('respects a custom visible count (Images uses 2)', () => {
- expect(
- findRow(appRes({ images: ['img1', 'img2', 'img3', 'img4'] }), 'Images')?.value,
- ).toBe('img1, img2 +2');
+ expect(findRow(appRes({ images: ['img1', 'img2', 'img3', 'img4'] }), 'Images')?.value).toBe(
+ 'img1, img2 +2',
+ );
});
it('shows no suffix when count equals the visible count', () => {
@@ -200,9 +197,9 @@ describe('summarizeList (via App list rows)', () => {
});
it('populates the title attribute with the full list', () => {
- expect(
- findRow(appRes({ usedHostIps: ['a', 'b', 'c', 'd'] }), 'Host IPs')?.title,
- ).toBe('a, b, c, d');
+ expect(findRow(appRes({ usedHostIps: ['a', 'b', 'c', 'd'] }), 'Host IPs')?.title).toBe(
+ 'a, b, c, d',
+ );
});
});
@@ -294,10 +291,8 @@ describe('portLabel (via App "Ports" row)', () => {
describe('appVolumeLabels (via App "Volumes" row)', () => {
it('formats source -> destination', () => {
expect(
- findRow(
- appRes({ volumes: [{ source: '/mnt/tank/app', destination: '/data' }] }),
- 'Volumes',
- )?.value,
+ findRow(appRes({ volumes: [{ source: '/mnt/tank/app', destination: '/data' }] }), 'Volumes')
+ ?.value,
).toBe('/mnt/tank/app -> /data');
});
@@ -314,7 +309,9 @@ describe('appVolumeLabels (via App "Volumes" row)', () => {
});
it('filters volumes where neither source nor destination is present', () => {
- expect(findRow(appRes({ volumes: [{ source: ' ', destination: '' }] }), 'Volumes')).toBeUndefined();
+ expect(
+ findRow(appRes({ volumes: [{ source: ' ', destination: '' }] }), 'Volumes'),
+ ).toBeUndefined();
});
});
@@ -332,9 +329,9 @@ describe('appNetworkLabels (via App "Networks" row)', () => {
});
it('prefers name over id', () => {
- expect(
- findRow(appRes({ networks: [{ name: 'bridge', id: 'net1' }] }), 'Networks')?.value,
- ).toBe('bridge');
+ expect(findRow(appRes({ networks: [{ name: 'bridge', id: 'net1' }] }), 'Networks')?.value).toBe(
+ 'bridge',
+ );
});
it('filters networks where neither name nor id is present', () => {
@@ -378,9 +375,7 @@ describe('formatVMCpu (via VM "vCPU" row)', () => {
describe('formatVMTopology (via VM "Topology" row)', () => {
it('formats cores x threads', () => {
- expect(findRow(vmRes({ cores: 2, threads: 4 }), 'Topology')?.value).toBe(
- '2 cores x 4 threads',
- );
+ expect(findRow(vmRes({ cores: 2, threads: 4 }), 'Topology')?.value).toBe('2 cores x 4 threads');
});
it('formats cores-only', () => {
@@ -492,10 +487,7 @@ describe('storageUsageLabel (via Storage "Usage" row)', () => {
it('prefers used/total over percent', () => {
expect(
- findRow(
- storageRes({}, { disk: { used: 1024, total: 2048, current: 50 } }),
- 'Usage',
- )?.value,
+ findRow(storageRes({}, { disk: { used: 1024, total: 2048, current: 50 } }), 'Usage')?.value,
).toBe('1.00 KB / 2.00 KB');
});
@@ -769,9 +761,9 @@ describe('buildTrueNASAppSections additional branches', () => {
});
it('falls back to containers array length for Containers row', () => {
- expect(
- findRow(appRes({ containers: [{ id: 'c1' }, { id: 'c2' }] }), 'Containers')?.value,
- ).toBe('2');
+ expect(findRow(appRes({ containers: [{ id: 'c1' }, { id: 'c2' }] }), 'Containers')?.value).toBe(
+ '2',
+ );
});
it('prefers humanVersion over version', () => {
@@ -925,7 +917,7 @@ describe('buildTrueNASStorageSections additional branches', () => {
expect(findRow(resource, 'Risk')?.tone).toBe('default');
});
-it('shows Protection reduced (booleanValue) with warning tone when true', () => {
+ it('shows Protection reduced (booleanValue) with warning tone when true', () => {
const row = findRow(storageRes({ protectionReduced: true }), 'Protection reduced');
expect(row?.value).toBe('Enabled');
expect(row?.tone).toBe('warning');
@@ -980,10 +972,7 @@ describe('buildTrueNASSystemSections additional branches', () => {
});
it('shows Storage summary with warning tone', () => {
- const row = findRow(
- systemResource({ storageRiskSummary: 'Pool degraded' }),
- 'Storage summary',
- );
+ const row = findRow(systemResource({ storageRiskSummary: 'Pool degraded' }), 'Storage summary');
expect(row?.value).toBe('Pool degraded');
expect(row?.tone).toBe('warning');
});
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.branchcov0712b.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.branchcov0712b.test.ts
index c6eb873add..0dc44c2a81 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.branchcov0712b.test.ts
@@ -4,10 +4,7 @@ import {
buildVMwareDetailsSummary,
} from '@/components/Infrastructure/resourceDetailDrawerVmwareModel';
import type { DetailRow } from '@/components/shared/detailSectionModel';
-import type {
- ResourceVMwareMeta,
- ResourceVMwareSnapshot,
-} from '@/types/resource';
+import type { ResourceVMwareMeta, ResourceVMwareSnapshot } from '@/types/resource';
// Branch-coverage complement to resourceDetailDrawerVmwareModel.coverage.test.ts.
// Scope is strictly: buildVMwareDetailsSummary, formatMiB, flattenSnapshotRows.
@@ -32,10 +29,8 @@ const findRow = (
const vmSections = (vmware?: Partial<ResourceVMwareMeta>): Sections =>
buildVMwareDetailSections('vm', (vmware ?? {}) as ResourceVMwareMeta);
-const hardwareRow = (
- vmware: Partial<ResourceVMwareMeta>,
- label: string,
-): DetailRow | undefined => findRow(vmSections(vmware), 'Virtual hardware', label);
+const hardwareRow = (vmware: Partial<ResourceVMwareMeta>, label: string): DetailRow | undefined =>
+ findRow(vmSections(vmware), 'Virtual hardware', label);
const snapshotSectionRows = (snapshots: ResourceVMwareSnapshot[]): DetailRow[] =>
findSection(vmSections({ snapshotTree: snapshots }), 'Snapshot tree')?.rows ?? [];
@@ -73,21 +68,19 @@ describe('buildVMwareDetailsSummary (additional branches)', () => {
});
it('counts only vms when the network has vms but no hosts', () => {
- expect(
- buildVMwareDetailsSummary('network', { networkVmNames: ['vm-01', 'vm-02'] }),
- ).toBe('Read-only vCenter context · 2 VMs');
+ expect(buildVMwareDetailsSummary('network', { networkVmNames: ['vm-01', 'vm-02'] })).toBe(
+ 'Read-only vCenter context · 2 VMs',
+ );
});
it('clamps an explicit snapshotCount of 0 to no snapshot part', () => {
- expect(buildVMwareDetailsSummary('vm', { snapshotCount: 0 })).toBe(
- 'Read-only vCenter context',
- );
+ expect(buildVMwareDetailsSummary('vm', { snapshotCount: 0 })).toBe('Read-only vCenter context');
});
it('omits alarm and task parts when both counts are explicitly zero', () => {
- expect(
- buildVMwareDetailsSummary('vm', { activeAlarmCount: 0, recentTaskCount: 0 }),
- ).toBe('Read-only vCenter context');
+ expect(buildVMwareDetailsSummary('vm', { activeAlarmCount: 0, recentTaskCount: 0 })).toBe(
+ 'Read-only vCenter context',
+ );
});
// SUSPECT SOURCE BEHAVIOR (reported, not fixed): the host/vm count chains use
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.coverage.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.coverage.test.ts
index 28a6d3dd21..a63798073d 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.coverage.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerVmwareModel.coverage.test.ts
@@ -24,7 +24,11 @@ type Sections = ReturnType<typeof buildVMwareDetailSections>;
const findSection = (sections: Sections, label: string) =>
sections.find((section) => section.label === label);
-const findRow = (sections: Sections, sectionLabel: string, rowLabel: string): DetailRow | undefined =>
+const findRow = (
+ sections: Sections,
+ sectionLabel: string,
+ rowLabel: string,
+): DetailRow | undefined =>
findSection(sections, sectionLabel)?.rows.find((row) => row.label === rowLabel);
const vmSections = (vmware?: Partial<ResourceVMwareMeta>): Sections =>
@@ -50,28 +54,28 @@ const toolsRow = (vmware: Partial<ResourceVMwareMeta>, label: string): DetailRow
const summary = (vmware?: Partial<ResourceVMwareMeta>): string | null =>
buildVMwareDetailsSummary('vm', (vmware ?? {}) as ResourceVMwareMeta);
-const summaryWithTools = (tools: Partial<ResourceVMwareTools>): string | null =>
- summary({ tools });
+const summaryWithTools = (tools: Partial<ResourceVMwareTools>): string | null => summary({ tools });
const summaryWithHardware = (hardware: Partial<ResourceVMwareHardware>): string | null =>
summary({ hardware });
describe('formatVirtualDiskAddress (via Virtual disks section)', () => {
it('formats a SATA bus:unit address', () => {
- expect(diskRow({ type: 'SATA', sataBus: 1, sataUnit: 2, capacityBytes: 10_737_418_240 })?.value).toBe(
- 'SATA 1:2 · 10 GB',
- );
+ expect(
+ diskRow({ type: 'SATA', sataBus: 1, sataUnit: 2, capacityBytes: 10_737_418_240 })?.value,
+ ).toBe('SATA 1:2 · 10 GB');
});
it('formats an NVMe bus:unit address', () => {
- expect(diskRow({ type: 'NVME', nvmeBus: 0, nvmeUnit: 3, capacityBytes: 10_737_418_240 })?.value).toBe(
- 'NVMe 0:3 · 10 GB',
- );
+ expect(
+ diskRow({ type: 'NVME', nvmeBus: 0, nvmeUnit: 3, capacityBytes: 10_737_418_240 })?.value,
+ ).toBe('NVMe 0:3 · 10 GB');
});
it('formats an IDE primary master address', () => {
expect(
- diskRow({ type: 'IDE', idePrimary: true, ideMaster: true, capacityBytes: 10_737_418_240 })?.value,
+ diskRow({ type: 'IDE', idePrimary: true, ideMaster: true, capacityBytes: 10_737_418_240 })
+ ?.value,
).toBe('IDE primary master · 10 GB');
});
@@ -87,7 +91,9 @@ describe('formatVirtualDiskAddress (via Virtual disks section)', () => {
});
it('falls back to the uppercased type for an unrecognized controller', () => {
- expect(diskRow({ type: 'custom', capacityBytes: 10_737_418_240 })?.value).toBe('CUSTOM · 10 GB');
+ expect(diskRow({ type: 'custom', capacityBytes: 10_737_418_240 })?.value).toBe(
+ 'CUSTOM · 10 GB',
+ );
});
});
@@ -118,9 +124,7 @@ describe('buildVMwareDetailsSummary', () => {
it('counts the snapshot tree when snapshotCount is not a number', () => {
expect(
buildVMwareDetailsSummary('vm', {
- snapshotTree: [
- { snapshot: 's-1', children: [{ snapshot: 's-2' }, { snapshot: 's-3' }] },
- ],
+ snapshotTree: [{ snapshot: 's-1', children: [{ snapshot: 's-2' }, { snapshot: 's-3' }] }],
}),
).toBe('Read-only vCenter context · 3 snapshots');
});
@@ -159,15 +163,15 @@ describe('buildVMwareDetailsSummary', () => {
});
it('includes alarm and task counts', () => {
- expect(
- buildVMwareDetailsSummary('vm', { activeAlarmCount: 2, recentTaskCount: 5 }),
- ).toBe('Read-only vCenter context · 2 alarms · 5 tasks');
+ expect(buildVMwareDetailsSummary('vm', { activeAlarmCount: 2, recentTaskCount: 5 })).toBe(
+ 'Read-only vCenter context · 2 alarms · 5 tasks',
+ );
});
it('omits hardware and tools parts for a non-vm resource type', () => {
- expect(
- buildVMwareDetailsSummary('datastore', { hardware: { version: 'VMX_19' } }),
- ).toBe('Read-only vCenter context');
+ expect(buildVMwareDetailsSummary('datastore', { hardware: { version: 'VMX_19' } })).toBe(
+ 'Read-only vCenter context',
+ );
});
});
@@ -297,11 +301,13 @@ describe('hardwareRows (via Virtual hardware section)', () => {
});
it('surfaces instant clone frozen as a warning row', () => {
- expect(hardwareRow({ hardware: { instantCloneFrozen: true } }, 'Instant clone frozen')).toEqual({
- label: 'Instant clone frozen',
- value: 'Yes',
- tone: 'warning',
- });
+ expect(hardwareRow({ hardware: { instantCloneFrozen: true } }, 'Instant clone frozen')).toEqual(
+ {
+ label: 'Instant clone frozen',
+ value: 'Yes',
+ tone: 'warning',
+ },
+ );
});
it('surfaces enter setup mode as a warning row', () => {
@@ -313,7 +319,9 @@ describe('hardwareRows (via Virtual hardware section)', () => {
});
it('surfaces an upgrade error message as a warning row', () => {
- expect(hardwareRow({ hardware: { upgradeErrorMessage: 'timed out' } }, 'Upgrade error')).toEqual({
+ expect(
+ hardwareRow({ hardware: { upgradeErrorMessage: 'timed out' } }, 'Upgrade error'),
+ ).toEqual({
label: 'Upgrade error',
value: 'timed out',
tone: 'warning',
@@ -512,7 +520,9 @@ describe('formatSnapshotDate (via Snapshot tree rows)', () => {
});
it('returns the raw string for an unparseable date', () => {
- expect(snapshotRows([{ snapshot: 's-1', createdAt: 'not-a-date' }])[0]?.value).toBe('not-a-date');
+ expect(snapshotRows([{ snapshot: 's-1', createdAt: 'not-a-date' }])[0]?.value).toBe(
+ 'not-a-date',
+ );
});
it('formats a valid ISO timestamp in UTC', () => {
@@ -586,8 +596,7 @@ describe('flattenSnapshotRows (via Snapshot tree section)', () => {
state: 'poweredOn',
children: [{ name: 'child', state: 'poweredOn' }],
},
- ])
- .map((row) => row.label),
+ ]).map((row) => row.label),
).toEqual(['root', '- child']);
});
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.branchcov.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.branchcov.test.ts
index ccff3af114..76213a8160 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.branchcov.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailMappers.branchcov.test.ts
@@ -90,9 +90,7 @@ describe('buildMemory', () => {
});
it('uses metric.free over computed free even when fallback.free exists', () => {
- expect(
- buildMemory({ current: 0, total: 100, used: 10, free: 5 }, { free: 90 }).free,
- ).toBe(5);
+ expect(buildMemory({ current: 0, total: 100, used: 10, free: 5 }, { free: 90 }).free).toBe(5);
});
});
@@ -246,9 +244,7 @@ describe('toAgentDisks', () => {
describe('toNodeFromProxmox', () => {
it('returns null when platformData has no proxmox block', () => {
- expect(
- toNodeFromProxmox({ ...baseProxmoxResource(), platformData: { agent: {} } }),
- ).toBeNull();
+ expect(toNodeFromProxmox({ ...baseProxmoxResource(), platformData: { agent: {} } })).toBeNull();
});
it('returns null when platformData is absent entirely', () => {
@@ -284,9 +280,7 @@ describe('toNodeFromProxmox', () => {
it('falls back to "now" when lastSeen is not finite', () => {
const before = Date.now();
- const node = toNodeFromProxmox(
- baseProxmoxResource({ lastSeen: Number.NaN }),
- );
+ const node = toNodeFromProxmox(baseProxmoxResource({ lastSeen: Number.NaN }));
const after = Date.now();
expect(node?.lastSeen).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/);
@@ -509,7 +503,10 @@ describe('formatGPUStatsLabel (observed via buildTemperatureRows GPU rows)', ()
it('falls back to "GPU <index+1>" when id is whitespace-only', () => {
const rows = buildTemperatureRows({
- gpu: [{ id: ' ', name: 'Integrated' }, { id: '5', name: 'Discrete' }],
+ gpu: [
+ { id: ' ', name: 'Integrated' },
+ { id: '5', name: 'Discrete' },
+ ],
});
const labels = rows.map((r) => r.label);
expect(labels).toEqual(['GPU 1', 'GPU 5']);
@@ -534,7 +531,9 @@ describe('formatPowerWatts (observed via buildTemperatureRows power rows)', () =
it('drops the row for a non-finite value (empty string filters out)', () => {
expect(findPower({ powerWatts: { cpu: Number.NaN } }, 'CPU Power')).toBeUndefined();
- expect(findPower({ powerWatts: { cpu: Number.POSITIVE_INFINITY } }, 'CPU Power')).toBeUndefined();
+ expect(
+ findPower({ powerWatts: { cpu: Number.POSITIVE_INFINITY } }, 'CPU Power'),
+ ).toBeUndefined();
});
});
@@ -554,9 +553,7 @@ describe('buildTemperatureRows (remaining uncovered branches)', () => {
it('emits a thermal row whose valueTitle omits "via <source>" when source is absent', () => {
const rows = buildTemperatureRows({ thermalState: { pressure: 'nominal' } });
- expect(rows).toEqual([
- { label: 'Thermal pressure', value: 'Nominal', valueTitle: 'Nominal' },
- ]);
+ expect(rows).toEqual([{ label: 'Thermal pressure', value: 'Nominal', valueTitle: 'Nominal' }]);
});
it('filters out limitsPercent entries >= 100 and non-finite entries', () => {
@@ -592,9 +589,7 @@ describe('buildTemperatureRows (remaining uncovered branches)', () => {
const rows = buildTemperatureRows({
smart: [{ device: 'sda', temperature: 42 }],
});
- expect(rows).toEqual([
- { label: 'Disk sda', value: '42°C', valueTitle: '42.0°C' },
- ]);
+ expect(rows).toEqual([{ label: 'Disk sda', value: '42°C', valueTitle: '42.0°C' }]);
});
it('skips standby disks', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceHealthPresentation.branchcov0712.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceHealthPresentation.branchcov0712.test.ts
index 8c62cbb71c..175b2b3e8c 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceHealthPresentation.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceHealthPresentation.branchcov0712.test.ts
@@ -156,7 +156,9 @@ describe('getResourceHealthIssuePresentation', () => {
storage: {
risk: {
level: 'critical',
- reasons: [{ code: 'storage_down', severity: 'critical', summary: 'Storage risk reason A' }],
+ reasons: [
+ { code: 'storage_down', severity: 'critical', summary: 'Storage risk reason A' },
+ ],
},
},
}),
@@ -170,7 +172,9 @@ describe('getResourceHealthIssuePresentation', () => {
agent: {
storageRisk: {
level: 'critical',
- reasons: [{ code: 'agent_disk', severity: 'critical', summary: 'Agent storage risk reason' }],
+ reasons: [
+ { code: 'agent_disk', severity: 'critical', summary: 'Agent storage risk reason' },
+ ],
},
},
}),
@@ -207,7 +211,11 @@ describe('getResourceHealthIssuePresentation', () => {
}),
);
expect(result?.primary).toBe('Storage posture');
- expect(result?.details).toStrictEqual(['Storage risk', 'Storage protection', 'Storage rebuild']);
+ expect(result?.details).toStrictEqual([
+ 'Storage risk',
+ 'Storage protection',
+ 'Storage rebuild',
+ ]);
});
it('surfaces all four agent storage summaries (posture primary, rest as details)', () => {
diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerPresentation.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerPresentation.ts
index f396c79dbd..c764f1a530 100644
--- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerPresentation.ts
+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerPresentation.ts
@@ -1,5 +1,3 @@
export type ResourceDetailDrawerPresentation = 'full' | 'table-row';
-export const DEFAULT_RESOURCE_DETAIL_DRAWER_PRESENTATION: ResourceDetailDrawerPresentation =
- 'full';
-
+export const DEFAULT_RESOURCE_DETAIL_DRAWER_PRESENTATION: ResourceDetailDrawerPresentation = 'full';
diff --git a/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts b/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts
index 014e29bcd6..5567ad386a 100644
--- a/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts
+++ b/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts
@@ -2,10 +2,7 @@ import type { Resource } from '@/types/resource';
import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';
import type { IODistributionStats } from '@/components/Infrastructure/infrastructureSelectors';
import type { PBSPlatformData, PMGPlatformData } from './resourceDetailMappers';
-import {
- getPbsActivitySummary,
- getPbsJobTotal,
-} from './resourceDetailDrawerServiceModel';
+import { getPbsActivitySummary, getPbsJobTotal } from './resourceDetailDrawerServiceModel';
type PBSServiceData = PBSPlatformData;
type PMGServiceData = PMGPlatformData;
@@ -42,8 +39,7 @@ export const isResourceOnline = (resource: Resource) => {
export const getPBSTableRow = (resource: Resource): PBSTableRow | null => {
if (resource.type !== 'pbs') return null;
const platformData = resource.platformData as
- | { pbs?: PBSServiceData; pmg?: PMGServiceData }
- | undefined;
+ { pbs?: PBSServiceData; pmg?: PMGServiceData } | undefined;
const pbs = platformData?.pbs;
const totalJobs = getPbsJobTotal(pbs);
const activitySummary = getPbsActivitySummary(pbs);
@@ -63,8 +59,7 @@ export const getPBSTableRow = (resource: Resource): PBSTableRow | null => {
export const getPMGTableRow = (resource: Resource): PMGTableRow | null => {
if (resource.type !== 'pmg') return null;
const platformData = resource.platformData as
- | { pbs?: PBSServiceData; pmg?: PMGServiceData }
- | undefined;
+ { pbs?: PBSServiceData; pmg?: PMGServiceData } | undefined;
const pmg = platformData?.pmg;
const health = pmg?.connectionHealth?.trim() || null;
const backlog = (pmg?.queueDeferred || 0) + (pmg?.queueHold || 0);
@@ -80,10 +75,7 @@ export const getPMGTableRow = (resource: Resource): PMGTableRow | null => {
};
};
-export const getOutlierEmphasis = (
- value: number,
- stats: IODistributionStats,
-): IOEmphasis => {
+export const getOutlierEmphasis = (value: number, stats: IODistributionStats): IOEmphasis => {
if (!Number.isFinite(value) || value <= 0 || stats.max <= 0) {
return { className: 'text-muted', showOutlierHint: false };
}
diff --git a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
index 1281bb4077..75a5b7e3f7 100644
--- a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
+++ b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
@@ -86,14 +86,7 @@ import {
import { getResourceHealthIssuePresentation } from './resourceHealthPresentation';
type DrawerTab =
- | 'overview'
- | 'history'
- | 'discovery'
- | 'mail'
- | 'namespaces'
- | 'deployments'
- | 'swarm'
- | 'debug';
+ 'overview' | 'history' | 'discovery' | 'mail' | 'namespaces' | 'deployments' | 'swarm' | 'debug';
interface ResourceDrawerDiscoverySourceKey {
type: DiscoveryResourceType;
diff --git a/frontend-modern/src/components/SecurityWarning.tsx b/frontend-modern/src/components/SecurityWarning.tsx
index 259c28388b..e898719ae4 100644
--- a/frontend-modern/src/components/SecurityWarning.tsx
+++ b/frontend-modern/src/components/SecurityWarning.tsx
@@ -156,7 +156,9 @@ export const SecurityWarning: Component = () => {
</div>
<p class="text-sm text-base-content mt-1">
- <span class={warningPresentation().messageClass}>{warningPresentation().message}</span>
+ <span class={warningPresentation().messageClass}>
+ {warningPresentation().message}
+ </span>
</p>
<Show when={showDetails()}>
@@ -164,34 +166,49 @@ export const SecurityWarning: Component = () => {
<div class="text-xs space-y-1">
<div class="flex items-center gap-2">
<span
- class={getSecurityFeatureStatePresentation(status()!.credentialsEncrypted).className}
+ class={
+ getSecurityFeatureStatePresentation(status()!.credentialsEncrypted)
+ .className
+ }
>
{getSecurityFeatureStatePresentation(status()!.credentialsEncrypted).label}
</span>
<span>Credentials encrypted at rest</span>
</div>
<div class="flex items-center gap-2">
- <span class={getSecurityFeatureStatePresentation(status()!.exportProtected).className}>
+ <span
+ class={
+ getSecurityFeatureStatePresentation(status()!.exportProtected).className
+ }
+ >
{getSecurityFeatureStatePresentation(status()!.exportProtected).label}
</span>
<span>Export requires authentication</span>
</div>
<div class="flex items-center gap-2">
<span
- class={getSecurityFeatureStatePresentation(status()!.hasAuthentication).className}
+ class={
+ getSecurityFeatureStatePresentation(status()!.hasAuthentication).className
+ }
>
{getSecurityFeatureStatePresentation(status()!.hasAuthentication).label}
</span>
<span>Authentication enabled</span>
</div>
<div class="flex items-center gap-2">
- <span class={getSecurityFeatureStatePresentation(status()!.hasHTTPS).className}>
+ <span
+ class={getSecurityFeatureStatePresentation(status()!.hasHTTPS).className}
+ >
{getSecurityFeatureStatePresentation(status()!.hasHTTPS).label}
</span>
<span>HTTPS connection</span>
</div>
<div class="flex items-center gap-2">
- <span class={getSecurityFeatureStatePresentation(status()!.hasAuditLogging).className}>
+ <span
+ class={
+ getSecurityFeatureStatePresentation(status()!.hasAuditLogging).className
+ }
+ >
{getSecurityFeatureStatePresentation(status()!.hasAuditLogging).label}
</span>
<span>Audit logging enabled</span>
diff --git a/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx b/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
index 33e5f01d3d..9617290cc8 100644
--- a/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
+++ b/frontend-modern/src/components/Settings/AIRuntimeControlsSection.tsx
@@ -301,8 +301,8 @@ export const AIAssistantCommandAccessSection: Component<AIRuntimeControlsSection
</Show>
</div>
<p class="text-[10px] text-muted">
- This controls actions started from Assistant chat only. Patrol handles infrastructure
- work from the Patrol page.
+ This controls actions started from Assistant chat only. Patrol handles infrastructure work
+ from the Patrol page.
</p>
<FormSelect
diff --git a/frontend-modern/src/components/Settings/ChangePasswordModal.tsx b/frontend-modern/src/components/Settings/ChangePasswordModal.tsx
index e7ae85efd1..bd2bc828aa 100644
--- a/frontend-modern/src/components/Settings/ChangePasswordModal.tsx
+++ b/frontend-modern/src/components/Settings/ChangePasswordModal.tsx
@@ -116,7 +116,13 @@ export const ChangePasswordModal: Component<ChangePasswordModalProps> = (props)
title="Close"
class="text-slate-400 hover:text-muted disabled:opacity-50"
>
- <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
+ <svg
+ class="w-6 h-6"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ >
<path
stroke-linecap="round"
stroke-linejoin="round"
diff --git a/frontend-modern/src/components/Settings/CommercialBillingSections.tsx b/frontend-modern/src/components/Settings/CommercialBillingSections.tsx
index bcd45b702b..d6952351d9 100644
--- a/frontend-modern/src/components/Settings/CommercialBillingSections.tsx
+++ b/frontend-modern/src/components/Settings/CommercialBillingSections.tsx
@@ -83,7 +83,9 @@ export const CommercialUsageMeters: Component<CommercialUsageMetersProps> = (pro
<span>{item.label}</span>
<span>
{item.current}
- {typeof item.limit === 'number' ? ` / ${item.limit}` : ` / ${NOT_METERED_USAGE_LABEL}`}
+ {typeof item.limit === 'number'
+ ? ` / ${item.limit}`
+ : ` / ${NOT_METERED_USAGE_LABEL}`}
</span>
</div>
<Show when={typeof item.limit === 'number'}>
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
index 97df4948ac..6e794778bc 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx
@@ -159,12 +159,7 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
</Show>
</div>
<Show when={(props.mode ?? 'add') === 'add'}>
- <Button
- type="button"
- variant="outline"
- size="xs"
- onClick={reopenProbe}
- >
+ <Button type="button" variant="outline" size="xs" onClick={reopenProbe}>
← Back to API probe
</Button>
</Show>
@@ -179,12 +174,7 @@ export const ConnectionEditor: Component<ConnectionEditorProps> = (props) => {
}
>
<div class="border-b border-border bg-surface-alt px-4 py-2">
- <Button
- type="button"
- variant="outline"
- size="xs"
- onClick={props.onBackToCatalog}
- >
+ <Button type="button" variant="outline" size="xs" onClick={props.onBackToCatalog}>
← Back to source types
</Button>
</div>
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx
index 26ade20b0c..56ea12dfd5 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx
@@ -351,9 +351,7 @@ export const AvailabilityTargetSlot: Component<AvailabilityTargetSlotProps> = (p
<FormSelect
label="Link to resource (optional)"
value={form().linkedResourceId}
- onChange={(event) =>
- updateForm({ linkedResourceId: event.currentTarget.value })
- }
+ onChange={(event) => updateForm({ linkedResourceId: event.currentTarget.value })}
fieldClass="sm:col-span-2"
help="Link this check to a known resource so its status appears on that resource's row. Leave empty to attach only when its IP address or full hostname has one exact match."
>
diff --git a/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx b/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
index 8ef5d41df6..2036f0f129 100644
--- a/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx
@@ -20,11 +20,7 @@ import {
import { useInfrastructureOperationsContext } from './useInfrastructureOperationsState';
export type InfrastructureInstallerFocus =
- | 'agent'
- | 'linux-host'
- | 'unraid'
- | 'docker'
- | 'kubernetes';
+ 'agent' | 'linux-host' | 'unraid' | 'docker' | 'kubernetes';
interface InfrastructureInstallerSectionProps {
focus?: InfrastructureInstallerFocus;
@@ -302,9 +298,8 @@ export const InfrastructureInstallerSection: Component<InfrastructureInstallerSe
<li class="flex items-start">
<span class="mr-2 mt-0.5 text-emerald-500">✓</span>
<span>
- Read-only by default. Assistant chat actions and host shell stay off until you
- opt in per host from{' '}
- <span class="font-medium">Settings → Infrastructure</span>.
+ Read-only by default. Assistant chat actions and host shell stay off until you opt
+ in per host from <span class="font-medium">Settings → Infrastructure</span>.
</span>
</li>
<li class="flex items-start">
diff --git a/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx b/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
index 696195df8d..318fbc76ca 100644
--- a/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
+++ b/frontend-modern/src/components/Settings/NetworkBoundarySettingsSection.tsx
@@ -147,9 +147,7 @@ export const NetworkBoundarySettingsSection: Component<NetworkBoundarySettingsSe
</svg>
Embedding
</h4>
- <p class="text-xs text-muted">
- Allow Pulse to be embedded in iframes (e.g., Homepage)
- </p>
+ <p class="text-xs text-muted">Allow Pulse to be embedded in iframes (e.g., Homepage)</p>
<div class="space-y-3">
<div class="flex items-center gap-2">
<input
diff --git a/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx b/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
index 148d70812b..494ac77aed 100644
--- a/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/NetworkSettingsPanel.tsx
@@ -5,10 +5,7 @@ import type { NetworkSettingsPanelProps } from './networkSettingsModel';
export const NetworkSettingsPanel: Component<NetworkSettingsPanelProps> = (props) => {
return (
- <SettingsPanel
- title="Network"
- noPadding
- >
+ <SettingsPanel title="Network" noPadding>
<NetworkBoundarySettingsSection {...props} />
</SettingsPanel>
);
diff --git a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
index 051be990e7..8ed1bdd4b9 100644
--- a/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
+++ b/frontend-modern/src/components/Settings/NodeModalMonitoringSection.tsx
@@ -82,7 +82,8 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
<p class="text-sm text-muted">
Pulse tracks all supported Proxmox VE resources by default — virtual machines,
containers, storage, and backups — so you always get full visibility without extra
- configuration. Disable individual collectors below to reduce API load or trim workload noise.
+ configuration. Disable individual collectors below to reduce API load or trim workload
+ noise.
</p>
<label class="flex items-start gap-2 text-sm text-base-content">
@@ -223,8 +224,8 @@ export const NodeModalMonitoringSection: Component<NodeModalMonitoringSectionPro
</div>
<Show when={!state.temperatureMonitoringEnabledValue()}>
<p class="mt-3 rounded border border-blue-200 bg-blue-50 p-2 text-xs text-blue-700 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200">
- Pulse will skip SSH temperature polling for this node. Existing monitoring readings
- will stop refreshing.
+ Pulse will skip SSH temperature polling for this node. Existing monitoring
+ readings will stop refreshing.
</p>
</Show>
<Show when={modalProps.temperatureMonitoringLocked}>
diff --git a/frontend-modern/src/components/Settings/OrganizationOverviewLoadingState.tsx b/frontend-modern/src/components/Settings/OrganizationOverviewLoadingState.tsx
index 7aa4889c63..5283f76a11 100644
--- a/frontend-modern/src/components/Settings/OrganizationOverviewLoadingState.tsx
+++ b/frontend-modern/src/components/Settings/OrganizationOverviewLoadingState.tsx
@@ -21,11 +21,7 @@ export const OrganizationOverviewLoadingState: Component = () => (
<SettingsSkeletonTable
titleWidth="w-24"
rows={3}
- cells={[
- { class: 'h-4 w-40' },
- { class: 'h-4 w-14', radius: 'full' },
- { class: 'h-4 w-24' },
- ]}
+ cells={[{ class: 'h-4 w-40' }, { class: 'h-4 w-14', radius: 'full' }, { class: 'h-4 w-24' }]}
/>
</SettingsLoadingSkeleton>
);
diff --git a/frontend-modern/src/components/Settings/OrganizationOverviewPanel.tsx b/frontend-modern/src/components/Settings/OrganizationOverviewPanel.tsx
index 1e298293cb..54d7d3ec38 100644
--- a/frontend-modern/src/components/Settings/OrganizationOverviewPanel.tsx
+++ b/frontend-modern/src/components/Settings/OrganizationOverviewPanel.tsx
@@ -30,11 +30,7 @@ export const OrganizationOverviewPanel: Component<OrganizationOverviewPanelProps
}
>
<div class="space-y-6">
- <SettingsPanel
- title="Organization Overview"
- noPadding
- bodyClass="divide-y divide-border"
- >
+ <SettingsPanel title="Organization Overview" noPadding bodyClass="divide-y divide-border">
<Show when={!state.loading()} fallback={<OrganizationOverviewLoadingState />}>
<Show when={state.org()}>
<OrganizationOverviewDetailsSection state={state} />
diff --git a/frontend-modern/src/components/Settings/OrganizationSharingPanel.tsx b/frontend-modern/src/components/Settings/OrganizationSharingPanel.tsx
index 774af1ee3c..a9e034bf8b 100644
--- a/frontend-modern/src/components/Settings/OrganizationSharingPanel.tsx
+++ b/frontend-modern/src/components/Settings/OrganizationSharingPanel.tsx
@@ -31,11 +31,7 @@ export const OrganizationSharingPanel: Component<OrganizationSharingPanelProps>
}
>
<div class="space-y-6">
- <SettingsPanel
- title="Organization Sharing"
- noPadding
- bodyClass="divide-y divide-border"
- >
+ <SettingsPanel title="Organization Sharing" noPadding bodyClass="divide-y divide-border">
<Show when={!state.loading()} fallback={<OrganizationSharingLoadingState />}>
<OrganizationSharingCreateSection state={state} />
<OrganizationOutgoingSharesSection state={state} />
diff --git a/frontend-modern/src/components/Settings/ReportingPanel.tsx b/frontend-modern/src/components/Settings/ReportingPanel.tsx
index 402bb46072..7a740783b8 100644
--- a/frontend-modern/src/components/Settings/ReportingPanel.tsx
+++ b/frontend-modern/src/components/Settings/ReportingPanel.tsx
@@ -50,7 +50,15 @@ function FormField(props: FormFieldProps) {
);
}
-const WEEKDAY_OPTIONS = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];
+const WEEKDAY_OPTIONS = [
+ 'monday',
+ 'tuesday',
+ 'wednesday',
+ 'thursday',
+ 'friday',
+ 'saturday',
+ 'sunday',
+];
export function ReportingPanel() {
const {
@@ -296,11 +304,17 @@ export function ReportingPanel() {
<div class="space-y-1">
<h4 class="text-base font-semibold text-base-content">Scheduled reports</h4>
<p class="text-sm text-muted">
- Send recurring client performance reports using the same resource scope and branding as generated reports.
+ Send recurring client performance reports using the same resource scope and
+ branding as generated reports.
</p>
</div>
<div class="flex flex-wrap gap-2">
- <Button variant="secondary" size="sm" class="gap-2" onClick={reloadReportSchedules}>
+ <Button
+ variant="secondary"
+ size="sm"
+ class="gap-2"
+ onClick={reloadReportSchedules}
+ >
<RefreshCw size={16} />
Refresh
</Button>
@@ -322,10 +336,13 @@ export function ReportingPanel() {
when={reportSchedules().length > 0}
fallback={
<div class="flex flex-col gap-3 border border-dashed border-base-300 p-4 sm:flex-row sm:items-center sm:justify-between">
- <p class="text-sm text-muted">
- No scheduled reports are configured yet.
- </p>
- <Button variant="secondary" size="sm" class="gap-2" onClick={startCreateSchedule}>
+ <p class="text-sm text-muted">No scheduled reports are configured yet.</p>
+ <Button
+ variant="secondary"
+ size="sm"
+ class="gap-2"
+ onClick={startCreateSchedule}
+ >
<Plus size={16} />
Create schedule
</Button>
@@ -358,19 +375,34 @@ export function ReportingPanel() {
<For each={reportSchedules()}>
{(schedule) => (
<tr>
- <td class="truncate px-3 py-2 font-medium text-base-content" title={schedule.name}>
+ <td
+ class="truncate px-3 py-2 font-medium text-base-content"
+ title={schedule.name}
+ >
{schedule.name}
</td>
- <td class="truncate px-3 py-2 text-muted" title={reportScheduleCadenceLabel(schedule)}>
+ <td
+ class="truncate px-3 py-2 text-muted"
+ title={reportScheduleCadenceLabel(schedule)}
+ >
{reportScheduleCadenceLabel(schedule)}
</td>
- <td class="truncate px-3 py-2 text-muted" title={reportScheduleScopeLabel(schedule)}>
+ <td
+ class="truncate px-3 py-2 text-muted"
+ title={reportScheduleScopeLabel(schedule)}
+ >
{reportScheduleScopeLabel(schedule)}
</td>
- <td class="truncate px-3 py-2 text-muted" title={reportScheduleDeliveryLabel(schedule)}>
+ <td
+ class="truncate px-3 py-2 text-muted"
+ title={reportScheduleDeliveryLabel(schedule)}
+ >
{reportScheduleDeliveryLabel(schedule)}
</td>
- <td class="truncate px-3 py-2 text-muted" title={schedule.last_error || ''}>
+ <td
+ class="truncate px-3 py-2 text-muted"
+ title={schedule.last_error || ''}
+ >
<div class="truncate">{reportScheduleLastRunLabel(schedule)}</div>
<Show when={schedule.last_run_at}>
<div class="truncate text-xs text-muted">
@@ -463,7 +495,11 @@ export function ReportingPanel() {
<FormSelect
label="Cadence"
value={scheduleForm().cadenceType}
- onChange={(e) => updateScheduleForm({ cadenceType: e.currentTarget.value as 'monthly' | 'weekly' })}
+ onChange={(e) =>
+ updateScheduleForm({
+ cadenceType: e.currentTarget.value as 'monthly' | 'weekly',
+ })
+ }
>
<option value="monthly">Monthly</option>
<option value="weekly">Weekly</option>
@@ -477,7 +513,9 @@ export function ReportingPanel() {
onChange={(e) => updateScheduleForm({ weekday: e.currentTarget.value })}
>
<For each={WEEKDAY_OPTIONS}>
- {(day) => <option value={day}>{day[0].toUpperCase() + day.slice(1)}</option>}
+ {(day) => (
+ <option value={day}>{day[0].toUpperCase() + day.slice(1)}</option>
+ )}
</For>
</FormSelect>
}
@@ -489,7 +527,9 @@ export function ReportingPanel() {
max="28"
class={formControl}
value={scheduleForm().dayOfMonth}
- onInput={(e) => updateScheduleForm({ dayOfMonth: Number(e.currentTarget.value) })}
+ onInput={(e) =>
+ updateScheduleForm({ dayOfMonth: Number(e.currentTarget.value) })
+ }
/>
</FormField>
</Show>
@@ -504,7 +544,9 @@ export function ReportingPanel() {
<FormSelect
label="Format"
value={scheduleForm().format}
- onChange={(e) => updateScheduleForm({ format: e.currentTarget.value as ReportingFormat })}
+ onChange={(e) =>
+ updateScheduleForm({ format: e.currentTarget.value as ReportingFormat })
+ }
>
<option value="pdf">PDF</option>
<option value="csv">CSV</option>
@@ -535,7 +577,11 @@ export function ReportingPanel() {
<FormSelect
label="Delivery"
value={scheduleForm().deliveryMethod}
- onChange={(e) => updateScheduleForm({ deliveryMethod: e.currentTarget.value as 'email' | 'disk' })}
+ onChange={(e) =>
+ updateScheduleForm({
+ deliveryMethod: e.currentTarget.value as 'email' | 'disk',
+ })
+ }
>
<option value="email">Email recipients</option>
<option value="disk">Save to disk</option>
@@ -547,13 +593,18 @@ export function ReportingPanel() {
max="120"
class={formControl}
value={scheduleForm().retentionCount}
- onInput={(e) => updateScheduleForm({ retentionCount: Number(e.currentTarget.value) })}
+ onInput={(e) =>
+ updateScheduleForm({ retentionCount: Number(e.currentTarget.value) })
+ }
/>
</FormField>
</div>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
- <FormField label="Email recipients" helpText="Blank uses the existing email notification recipients">
+ <FormField
+ label="Email recipients"
+ helpText="Blank uses the existing email notification recipients"
+ >
<input
type="text"
class={formControl}
@@ -585,7 +636,9 @@ export function ReportingPanel() {
<input
type="checkbox"
checked={scheduleForm().saveToDisk}
- onChange={(e) => updateScheduleForm({ saveToDisk: e.currentTarget.checked })}
+ onChange={(e) =>
+ updateScheduleForm({ saveToDisk: e.currentTarget.checked })
+ }
/>
Save copy
</label>
diff --git a/frontend-modern/src/components/Settings/SecurityPostureSummary.tsx b/frontend-modern/src/components/Settings/SecurityPostureSummary.tsx
index 2a7a272b07..74496ad7a8 100644
--- a/frontend-modern/src/components/Settings/SecurityPostureSummary.tsx
+++ b/frontend-modern/src/components/Settings/SecurityPostureSummary.tsx
@@ -101,7 +101,9 @@ export const SecurityPostureSummary: Component<SecurityPostureSummaryProps> = (p
<div class="flex items-center justify-between">
<p class="text-xs text-muted">{item.description}</p>
<Show when={item.critical && !item.enabled}>
- <span class={`text-[10px] font-medium uppercase ${card.criticalLabelClassName}`}>
+ <span
+ class={`text-[10px] font-medium uppercase ${card.criticalLabelClassName}`}
+ >
Critical
</span>
</Show>
diff --git a/frontend-modern/src/components/Settings/SuggestProfileModal.tsx b/frontend-modern/src/components/Settings/SuggestProfileModal.tsx
index ad1f11c333..746121a621 100644
--- a/frontend-modern/src/components/Settings/SuggestProfileModal.tsx
+++ b/frontend-modern/src/components/Settings/SuggestProfileModal.tsx
@@ -243,7 +243,13 @@ export const SuggestProfileModal: Component<SuggestProfileModalProps> = (props)
title="Close"
class="p-1.5 rounded-md text-slate-500 hover:text-base-content hover:bg-surface-hover"
>
- <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
+ <svg
+ class="w-5 h-5"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke="currentColor"
+ aria-hidden="true"
+ >
<path
stroke-linecap="round"
stroke-linejoin="round"
@@ -461,7 +467,9 @@ export const SuggestProfileModal: Component<SuggestProfileModalProps> = (props)
<div class="text-[11px] text-muted mt-1">
Default{' '}
{hasAgentProfileSuggestionValue(setting.defaultValue)
- ? formatAgentProfileSuggestionValue(setting.defaultValue)
+ ? formatAgentProfileSuggestionValue(
+ setting.defaultValue,
+ )
: 'n/a'}
</div>
</Show>
@@ -503,7 +511,9 @@ export const SuggestProfileModal: Component<SuggestProfileModalProps> = (props)
{(def) => (
<div class="flex items-center justify-between text-xs text-muted">
<span class="font-mono">{def.key}</span>
- <span>{formatAgentProfileSuggestionValue(def.defaultValue)}</span>
+ <span>
+ {formatAgentProfileSuggestionValue(def.defaultValue)}
+ </span>
</div>
)}
</For>
diff --git a/frontend-modern/src/components/Settings/UpdateHistorySection.tsx b/frontend-modern/src/components/Settings/UpdateHistorySection.tsx
index d17fa825b3..66b2c29f4e 100644
--- a/frontend-modern/src/components/Settings/UpdateHistorySection.tsx
+++ b/frontend-modern/src/components/Settings/UpdateHistorySection.tsx
@@ -192,13 +192,13 @@ export const UpdateHistorySection: Component = () => {
</div>
<div class="px-6 py-4 space-y-3 text-sm text-base-content">
<p>
- This restores the binary, configuration, and data from the backup taken before
- the update to {formatVersionLabel(entry().version_to)} on{' '}
+ This restores the binary, configuration, and data from the backup taken before the
+ update to {formatVersionLabel(entry().version_to)} on{' '}
{formatTimestamp(entry().timestamp)}.
</p>
<p>
- Settings and alert changes made since that backup will be reverted, and Pulse
- will restart to complete the rollback.
+ Settings and alert changes made since that backup will be reverted, and Pulse will
+ restart to complete the rollback.
</p>
</div>
<div class="px-6 py-4 bg-surface-alt border-t border-border flex items-center justify-end gap-3">
diff --git a/frontend-modern/src/components/Settings/UpdateInstallGuide.tsx b/frontend-modern/src/components/Settings/UpdateInstallGuide.tsx
index 11dd3bd4d6..0c8c4f85e0 100644
--- a/frontend-modern/src/components/Settings/UpdateInstallGuide.tsx
+++ b/frontend-modern/src/components/Settings/UpdateInstallGuide.tsx
@@ -170,8 +170,7 @@ export const UpdateInstallGuide: Component<UpdateInstallGuideProps> = (props) =>
}
>
<p class="text-xs text-blue-700 dark:text-blue-300">
- Updates are managed through Docker. Use these commands to check for and apply
- updates:
+ Updates are managed through Docker. Use these commands to check for and apply updates:
</p>
<div class="space-y-2">
<CopyCommandBlock
@@ -194,8 +193,7 @@ export const UpdateInstallGuide: Component<UpdateInstallGuideProps> = (props) =>
<Show when={props.versionInfo?.isSourceBuild}>
<div class="rounded-md border border-blue-200 bg-blue-50 p-3 dark:border-blue-800 dark:bg-blue-900">
<p class="text-xs text-blue-800 dark:text-blue-200">
- <strong>Built from source:</strong> Pull the latest code from git and rebuild to
- update.
+ <strong>Built from source:</strong> Pull the latest code from git and rebuild to update.
</p>
</div>
</Show>
@@ -244,7 +242,7 @@ export const UpdateInstallGuide: Component<UpdateInstallGuideProps> = (props) =>
? 'cursor-not-allowed bg-green-400 text-white dark:bg-green-600'
: readinessBlocked()
? 'cursor-not-allowed bg-red-200 text-red-800 dark:bg-red-900 dark:text-red-200'
- : 'bg-green-600 text-white hover:bg-green-700'
+ : 'bg-green-600 text-white hover:bg-green-700'
}`}
>
<Show
diff --git a/frontend-modern/src/components/Settings/__tests__/AgentIntegrationsPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/AgentIntegrationsPanel.test.tsx
index b6f6723823..16b9f7aca7 100644
--- a/frontend-modern/src/components/Settings/__tests__/AgentIntegrationsPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/AgentIntegrationsPanel.test.tsx
@@ -216,9 +216,7 @@ describe('AgentIntegrationsPanel', () => {
'false',
);
expect(screen.getAllByRole('link', { name: 'Choose Patrol mode' })).toHaveLength(1);
- expect(
- screen.queryByRole('heading', { name: 'Connector setup' }),
- ).not.toBeInTheDocument();
+ expect(screen.queryByRole('heading', { name: 'Connector setup' })).not.toBeInTheDocument();
expect(screen.queryByRole('link', { name: 'Create token' })).not.toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: 'Show connector setup' }));
@@ -235,12 +233,9 @@ describe('AgentIntegrationsPanel', () => {
PATROL_CONTROL_PATH,
);
expect(
- screen.getByText(
- 'Required before agents can request Patrol work',
- {
- exact: false,
- },
- ),
+ screen.getByText('Required before agents can request Patrol work', {
+ exact: false,
+ }),
).toBeInTheDocument();
expect(screen.getByText('Step 2')).toBeInTheDocument();
expect(screen.getByText('Create a scoped token')).toBeInTheDocument();
diff --git a/frontend-modern/src/components/Settings/__tests__/OrganizationOverviewPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/OrganizationOverviewPanel.test.tsx
index edd9475a36..99b907b5b5 100644
--- a/frontend-modern/src/components/Settings/__tests__/OrganizationOverviewPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/OrganizationOverviewPanel.test.tsx
@@ -138,7 +138,9 @@ describe('OrganizationOverviewPanel', () => {
renderPanel();
- expect(screen.getByText('Organization settings are not available on this server.')).toBeInTheDocument();
+ expect(
+ screen.getByText('Organization settings are not available on this server.'),
+ ).toBeInTheDocument();
expect(orgGetMock).not.toHaveBeenCalled();
expect(listMembersMock).not.toHaveBeenCalled();
});
diff --git a/frontend-modern/src/components/Settings/__tests__/SecurityOverviewPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/SecurityOverviewPanel.test.tsx
index 6443da9556..00003d05e7 100644
--- a/frontend-modern/src/components/Settings/__tests__/SecurityOverviewPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/SecurityOverviewPanel.test.tsx
@@ -25,7 +25,10 @@ describe('SecurityOverviewPanel', () => {
expect(screen.getByText('Recommended hardening steps')).toBeInTheDocument();
expect(screen.getByText('Plan HTTPS before live use')).toBeInTheDocument();
expect(screen.getByText('Create an API token')).toBeInTheDocument();
- expect(screen.getAllByText('Open API Access')[0]).toHaveAttribute('href', '/settings/security/api');
+ expect(screen.getAllByText('Open API Access')[0]).toHaveAttribute(
+ 'href',
+ '/settings/security/api',
+ );
expect(screen.getByText('Open security guide')).toHaveAttribute('href', '/docs/SECURITY.md');
expect(screen.getAllByText('Recommended')).toHaveLength(2);
});
diff --git a/frontend-modern/src/components/Settings/__tests__/UpdateInstallGuide.test.tsx b/frontend-modern/src/components/Settings/__tests__/UpdateInstallGuide.test.tsx
index 146d303281..7b90bd65ab 100644
--- a/frontend-modern/src/components/Settings/__tests__/UpdateInstallGuide.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/UpdateInstallGuide.test.tsx
@@ -100,7 +100,8 @@ describe('UpdateInstallGuide', () => {
id: 'agent-token-scopes',
status: 'blocked',
title: 'Agent token scopes',
- summary: 'Registered agents exist, but no loaded API token grants agent reporting scope.',
+ summary:
+ 'Registered agents exist, but no loaded API token grants agent reporting scope.',
},
],
},
@@ -175,9 +176,7 @@ describe('UpdateInstallGuide', () => {
));
expect(screen.getByText(`PULSE_IMAGE='${pinnedRef}' docker compose pull`)).toBeInTheDocument();
- expect(
- screen.getByText(`PULSE_IMAGE='${pinnedRef}' docker compose up -d`),
- ).toBeInTheDocument();
+ expect(screen.getByText(`PULSE_IMAGE='${pinnedRef}' docker compose up -d`)).toBeInTheDocument();
expect(screen.queryByText(/docker pull rcourtman\/pulse/)).not.toBeInTheDocument();
});
diff --git a/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0712.test.ts b/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0712.test.ts
index 94af5a2ad8..4fc18d329d 100644
--- a/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0712.test.ts
@@ -65,15 +65,15 @@ describe('readPlatformNumber (via tokenRevokedAtForResource)', () => {
});
it('returns 0 for a finite zero (not treated as missing)', () => {
- expect(
- tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 0 } })),
- ).toBe(0);
+ expect(tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 0 } }))).toBe(
+ 0,
+ );
});
it('returns a negative finite number verbatim', () => {
- expect(
- tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: -42 } })),
- ).toBe(-42);
+ expect(tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: -42 } }))).toBe(
+ -42,
+ );
});
it.each([Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY])(
@@ -127,16 +127,14 @@ describe('readPlatformData (via tokenRevokedAtForResource)', () => {
describe('readNestedPlatformField (via tokenRevokedAtForResource)', () => {
it('returns the field directly from platformData when present at the top level', () => {
- expect(
- tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 111 } })),
- ).toBe(111);
+ expect(tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 111 } }))).toBe(
+ 111,
+ );
});
it('falls through to platformData.agent.<field> when not at the top level', () => {
expect(
- tokenRevokedAtForResource(
- makeResource({ platformData: { agent: { tokenRevokedAt: 222 } } }),
- ),
+ tokenRevokedAtForResource(makeResource({ platformData: { agent: { tokenRevokedAt: 222 } } })),
).toBe(222);
});
@@ -162,9 +160,7 @@ describe('readNestedPlatformField (via tokenRevokedAtForResource)', () => {
it('returns undefined when agent is an object without the field and docker is absent', () => {
expect(
- tokenRevokedAtForResource(
- makeResource({ platformData: { agent: { unrelated: true } } }),
- ),
+ tokenRevokedAtForResource(makeResource({ platformData: { agent: { unrelated: true } } })),
).toBeUndefined();
});
@@ -293,7 +289,9 @@ describe('getAPITokenDialogName', () => {
});
it('combines prefix and suffix when the name is blank and both are set', () => {
- expect(getAPITokenDialogName(makeToken({ name: '', prefix: 'pl', suffix: 'xy' }))).toBe('pl…xy');
+ expect(getAPITokenDialogName(makeToken({ name: '', prefix: 'pl', suffix: 'xy' }))).toBe(
+ 'pl…xy',
+ );
});
it('returns "untitled token" when name, prefix, and suffix are all blank', () => {
@@ -620,9 +618,7 @@ describe('appendUsageEntry (via buildDockerTokenUsage)', () => {
platformData: { docker: { hostSourceId: 'rt-shared', tokenId: 't1' } },
});
expect(buildDockerTokenUsage([a, b])).toStrictEqual(
- new Map([
- ['t1', { count: 1, items: [{ id: 'rt-shared', label: 'Docker One' }] }],
- ]),
+ new Map([['t1', { count: 1, items: [{ id: 'rt-shared', label: 'Docker One' }] }]]),
);
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0713.test.ts b/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0713.test.ts
index 035e2df632..e4d64c372f 100644
--- a/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0713.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov0713.test.ts
@@ -81,23 +81,19 @@ const makeToken = (overrides: Partial<APITokenRecord> = {}): APITokenRecord => (
describe('readPlatformString (via tokenIdForResource)', () => {
it('returns a non-empty string verbatim', () => {
- expect(
- tokenIdForResource(makeResource({ platformData: { tokenId: 'tok-abc' } })),
- ).toBe('tok-abc');
+ expect(tokenIdForResource(makeResource({ platformData: { tokenId: 'tok-abc' } }))).toBe(
+ 'tok-abc',
+ );
});
it('returns undefined for an empty string (length === 0)', () => {
- expect(
- tokenIdForResource(makeResource({ platformData: { tokenId: '' } })),
- ).toBeUndefined();
+ expect(tokenIdForResource(makeResource({ platformData: { tokenId: '' } }))).toBeUndefined();
});
it('returns undefined for a whitespace-only string (still length > 0, not trimmed)', () => {
// readPlatformString intentionally does NOT trim; a blank-but-non-empty
// string is returned verbatim, proving it is distinct from the empty arm.
- expect(
- tokenIdForResource(makeResource({ platformData: { tokenId: ' ' } })),
- ).toBe(' ');
+ expect(tokenIdForResource(makeResource({ platformData: { tokenId: ' ' } }))).toBe(' ');
});
it.each([42, 0, true, false, null, ['array'], { k: 'v' }])(
@@ -154,9 +150,7 @@ describe('tokenIdForResource', () => {
describe('revokedTokenIdForResource', () => {
it('returns a non-empty revokedTokenId string verbatim from the top level', () => {
expect(
- revokedTokenIdForResource(
- makeResource({ platformData: { revokedTokenId: 'revoked-1' } }),
- ),
+ revokedTokenIdForResource(makeResource({ platformData: { revokedTokenId: 'revoked-1' } })),
).toBe('revoked-1');
});
@@ -341,8 +335,7 @@ describe('groupAPITokenScopes', () => {
it('routes specific known scopes to their expected groups', () => {
const groups = groupAPITokenScopes();
- const valuesFor = (group: string) =>
- groups.find(([g]) => g === group)?.[1].map((o) => o.value);
+ const valuesFor = (group: string) => groups.find(([g]) => g === group)?.[1].map((o) => o.value);
expect(valuesFor('Monitoring')).toStrictEqual([MONITORING_READ_SCOPE, 'monitoring:write']);
expect(valuesFor('Security')).toStrictEqual([AUDIT_READ_SCOPE]);
expect(valuesFor('Agents')).toContain(DOCKER_REPORT_SCOPE);
@@ -552,8 +545,7 @@ describe('getAPITokenScopePresets (full structure)', () => {
id: API_TOKEN_PULSE_INTELLIGENCE_AGENT_PRESET_ID,
label: API_TOKEN_PATROL_EXTERNAL_AGENT_PRESET_LABEL,
scopes: ['monitoring:read', 'ai:execute'],
- description:
- 'Scopes for connected agents that read Pulse context and request Patrol work.',
+ description: 'Scopes for connected agents that read Pulse context and request Patrol work.',
});
// Base presets still follow in canonical order after the inserted preset.
expect(presets.map((p) => p.id)).toStrictEqual([
diff --git a/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov2.test.ts b/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov2.test.ts
index 3d0cffc02b..65418e451f 100644
--- a/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/apiTokenManagerModel.branchcov2.test.ts
@@ -65,15 +65,15 @@ describe('readPlatformNumber (via tokenRevokedAtForResource)', () => {
});
it('returns 0 for a finite zero (not treated as missing)', () => {
- expect(
- tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 0 } })),
- ).toBe(0);
+ expect(tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 0 } }))).toBe(
+ 0,
+ );
});
it('returns a negative finite number verbatim', () => {
- expect(
- tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: -42 } })),
- ).toBe(-42);
+ expect(tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: -42 } }))).toBe(
+ -42,
+ );
});
it.each([Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY])(
@@ -127,16 +127,14 @@ describe('readPlatformData (via tokenRevokedAtForResource)', () => {
describe('readNestedPlatformField (via tokenRevokedAtForResource)', () => {
it('returns the field directly from platformData when present at the top level', () => {
- expect(
- tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 111 } })),
- ).toBe(111);
+ expect(tokenRevokedAtForResource(makeResource({ platformData: { tokenRevokedAt: 111 } }))).toBe(
+ 111,
+ );
});
it('falls through to platformData.agent.<field> when not at the top level', () => {
expect(
- tokenRevokedAtForResource(
- makeResource({ platformData: { agent: { tokenRevokedAt: 222 } } }),
- ),
+ tokenRevokedAtForResource(makeResource({ platformData: { agent: { tokenRevokedAt: 222 } } })),
).toBe(222);
});
@@ -162,9 +160,7 @@ describe('readNestedPlatformField (via tokenRevokedAtForResource)', () => {
it('returns undefined when agent is an object without the field and docker is absent', () => {
expect(
- tokenRevokedAtForResource(
- makeResource({ platformData: { agent: { unrelated: true } } }),
- ),
+ tokenRevokedAtForResource(makeResource({ platformData: { agent: { unrelated: true } } })),
).toBeUndefined();
});
@@ -293,7 +289,9 @@ describe('getAPITokenDialogName', () => {
});
it('combines prefix and suffix when the name is blank and both are set', () => {
- expect(getAPITokenDialogName(makeToken({ name: '', prefix: 'pl', suffix: 'xy' }))).toBe('pl…xy');
+ expect(getAPITokenDialogName(makeToken({ name: '', prefix: 'pl', suffix: 'xy' }))).toBe(
+ 'pl…xy',
+ );
});
it('returns "untitled token" when name, prefix, and suffix are all blank', () => {
@@ -474,9 +472,7 @@ describe('appendUsageEntry (via buildDockerTokenUsage)', () => {
platformData: { docker: { hostSourceId: 'rt-shared', tokenId: 't1' } },
});
expect(buildDockerTokenUsage([a, b])).toStrictEqual(
- new Map([
- ['t1', { count: 1, items: [{ id: 'rt-shared', label: 'Docker One' }] }],
- ]),
+ new Map([['t1', { count: 1, items: [{ id: 'rt-shared', label: 'Docker One' }] }]]),
);
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/availabilitySettingsModel.branchcov2.test.ts b/frontend-modern/src/components/Settings/__tests__/availabilitySettingsModel.branchcov2.test.ts
index 92db8578dd..8cdfd1cd1a 100644
--- a/frontend-modern/src/components/Settings/__tests__/availabilitySettingsModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/availabilitySettingsModel.branchcov2.test.ts
@@ -19,10 +19,7 @@ import {
getAvailabilityTargetMethodLabel,
getAvailabilityTargetStatusLabel,
} from '../availabilitySettingsModel';
-import type {
- AvailabilityProbeStatus,
- AvailabilityTarget,
-} from '@/api/availabilityTargets';
+import type { AvailabilityProbeStatus, AvailabilityTarget } from '@/api/availabilityTargets';
// ---- Fixtures ---------------------------------------------------------------
// Mirrors the sibling availabilitySettingsModel.test.ts factory shape so the
@@ -38,9 +35,7 @@ const target = (overrides: Partial<AvailabilityTarget> = {}): AvailabilityTarget
...overrides,
});
-const status = (
- overrides: Partial<AvailabilityProbeStatus> = {},
-): AvailabilityProbeStatus => ({
+const status = (overrides: Partial<AvailabilityProbeStatus> = {}): AvailabilityProbeStatus => ({
targetId: 'mqtt-broker',
name: 'MQTT broker',
address: 'mqtt.local',
@@ -86,7 +81,7 @@ describe('getAvailabilityTargetStatusLabel', () => {
).toBe('Online');
});
- it("returns the trimmed lastError for an unavailable target with one (|| left operand)", () => {
+ it('returns the trimmed lastError for an unavailable target with one (|| left operand)', () => {
expect(
getAvailabilityTargetStatusLabel(
target({
@@ -143,7 +138,7 @@ describe('getAvailabilityTargetKindLabel', () => {
// the final fallback arm (icmp / https / tcp-without-port).
describe('getAvailabilityTargetAddressLabel', () => {
- it("prepends a leading slash to an http path that lacks one (ternary else arm)", () => {
+ it('prepends a leading slash to an http path that lacks one (ternary else arm)', () => {
expect(
getAvailabilityTargetAddressLabel(
target({ protocol: 'http', address: 'http://api.local', path: 'v1/health' }),
@@ -151,7 +146,7 @@ describe('getAvailabilityTargetAddressLabel', () => {
).toBe('http://api.local/v1/health');
});
- it("returns the address verbatim when it already ends with the path (endsWith guard)", () => {
+ it('returns the address verbatim when it already ends with the path (endsWith guard)', () => {
expect(
getAvailabilityTargetAddressLabel(
target({ protocol: 'http', address: 'http://api.local/health', path: '/health' }),
@@ -159,7 +154,7 @@ describe('getAvailabilityTargetAddressLabel', () => {
).toBe('http://api.local/health');
});
- it("returns the address verbatim for http when path is undefined (path falsy arm)", () => {
+ it('returns the address verbatim for http when path is undefined (path falsy arm)', () => {
expect(
getAvailabilityTargetAddressLabel(
target({ protocol: 'http', address: 'http://api.local', path: undefined }),
@@ -167,7 +162,7 @@ describe('getAvailabilityTargetAddressLabel', () => {
).toBe('http://api.local');
});
- it("returns the address verbatim for http when path is whitespace-only (trim -> falsy arm)", () => {
+ it('returns the address verbatim for http when path is whitespace-only (trim -> falsy arm)', () => {
expect(
getAvailabilityTargetAddressLabel(
target({ protocol: 'http', address: 'http://api.local', path: ' ' }),
@@ -183,7 +178,7 @@ describe('getAvailabilityTargetAddressLabel', () => {
).toBe('http://api.local/health');
});
- it("returns the address verbatim for tcp without a port (port falsy arm)", () => {
+ it('returns the address verbatim for tcp without a port (port falsy arm)', () => {
expect(
getAvailabilityTargetAddressLabel(
target({ protocol: 'tcp', address: 'mqtt.local', port: undefined }),
@@ -191,7 +186,7 @@ describe('getAvailabilityTargetAddressLabel', () => {
).toBe('mqtt.local');
});
- it("returns the address verbatim for icmp (final fallback arm)", () => {
+ it('returns the address verbatim for icmp (final fallback arm)', () => {
expect(
getAvailabilityTargetAddressLabel(
target({ protocol: 'icmp', address: '10.0.0.1', port: undefined }),
@@ -199,7 +194,7 @@ describe('getAvailabilityTargetAddressLabel', () => {
).toBe('10.0.0.1');
});
- it("returns the address verbatim for https (final fallback arm; no https special-case)", () => {
+ it('returns the address verbatim for https (final fallback arm; no https special-case)', () => {
expect(
getAvailabilityTargetAddressLabel(
target({ protocol: 'https', address: 'https://api.local', path: '/health' }),
@@ -228,11 +223,11 @@ describe('getAvailabilityTargetMethodLabel', () => {
expect(getAvailabilityTargetMethodLabel(target({ protocol: 'http' }))).toBe('HTTP check');
});
- it("uppercases an unrecognised but valid protocol via the default arm (https)", () => {
+ it('uppercases an unrecognised but valid protocol via the default arm (https)', () => {
expect(getAvailabilityTargetMethodLabel(target({ protocol: 'https' }))).toBe('HTTPS');
});
- it("uppercases an arbitrary protocol string via the default arm (cast)", () => {
+ it('uppercases an arbitrary protocol string via the default arm (cast)', () => {
expect(
getAvailabilityTargetMethodLabel(
target({ protocol: 'grpc' as unknown as AvailabilityTarget['protocol'] }),
@@ -263,7 +258,7 @@ describe('getAvailabilityTargetAddKind', () => {
).toBeUndefined();
});
- it("returns undefined when the targetKind param does not normalise to a known kind (invalid kind guard)", () => {
+ it('returns undefined when the targetKind param does not normalise to a known kind (invalid kind guard)', () => {
expect(
getAvailabilityTargetAddKind(
'/settings/monitoring/availability',
diff --git a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.branchcov.test.ts b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.branchcov.test.ts
index 2eb78d7a56..aa90ea5985 100644
--- a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.branchcov.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.branchcov.test.ts
@@ -167,7 +167,12 @@ describe('agentAttachmentProblem', () => {
});
it.each([
- ['unreachable', 'Agent unreachable', 'Pulse cannot currently reach the agent on this host.', 'critical'],
+ [
+ 'unreachable',
+ 'Agent unreachable',
+ 'Pulse cannot currently reach the agent on this host.',
+ 'critical',
+ ],
['unauthorized', 'Agent unauthorized', 'The Pulse Agent token is being rejected.', 'critical'],
['pending', 'Agent pending first report', 'The Pulse Agent has not reported yet.', 'warning'],
] as const satisfies ReadonlyArray<[ConnectionState, string, string, 'critical' | 'warning']>)(
@@ -198,10 +203,13 @@ describe('agentAttachmentProblem', () => {
},
);
- it.each(['active', 'paused'] as const)('returns undefined for the non-problem state %s', (state) => {
- vi.setSystemTime(PINNED_NOW);
- expect(agentAttachmentProblem(connectionFixture({ state }))).toBeUndefined();
- });
+ it.each(['active', 'paused'] as const)(
+ 'returns undefined for the non-problem state %s',
+ (state) => {
+ vi.setSystemTime(PINNED_NOW);
+ expect(agentAttachmentProblem(connectionFixture({ state }))).toBeUndefined();
+ },
+ );
});
// ---- connectionAgentVersionPresentation -------------------------------------
@@ -240,7 +248,11 @@ describe('connectionAgentVersionPresentation', () => {
// update branch short-circuits; the plain agent-version branch also needs
// a current version, so the expected-version ("Version target") branch wins.
const presentation = connectionAgentVersionPresentation(
- connectionFixture({ agentVersion: ' ', expectedAgentVersion: '6.0.3', agentUpdateAvailable: true }),
+ connectionFixture({
+ agentVersion: ' ',
+ expectedAgentVersion: '6.0.3',
+ agentUpdateAvailable: true,
+ }),
);
expect(presentation?.badgeLabel).toBe('Version target');
expect(presentation?.detail).toBe('6.0.3');
@@ -248,7 +260,11 @@ describe('connectionAgentVersionPresentation', () => {
it('renders the agent-version badge when the flag is set but the expected version is blank', () => {
const presentation = connectionAgentVersionPresentation(
- connectionFixture({ agentVersion: '6.0.0', expectedAgentVersion: '', agentUpdateAvailable: true }),
+ connectionFixture({
+ agentVersion: '6.0.0',
+ expectedAgentVersion: '',
+ agentUpdateAvailable: true,
+ }),
);
expect(presentation?.badgeLabel).toBe('Agent version');
expect(presentation?.detail).toBe('6.0.0');
@@ -256,7 +272,11 @@ describe('connectionAgentVersionPresentation', () => {
it('renders the neutral agent-version badge when no update is flagged', () => {
const presentation = connectionAgentVersionPresentation(
- connectionFixture({ agentVersion: '6.0.0', expectedAgentVersion: '6.0.3', agentUpdateAvailable: false }),
+ connectionFixture({
+ agentVersion: '6.0.0',
+ expectedAgentVersion: '6.0.3',
+ agentUpdateAvailable: false,
+ }),
);
expect(presentation).toMatchObject({ badgeLabel: 'Agent version', detail: '6.0.0' });
expect(presentation?.badgeClassName).not.toContain('amber');
@@ -300,7 +320,11 @@ describe('connectionAgentVersionPresentation', () => {
describe('connectionAgentEndpointDisplay (remaining branches)', () => {
it('skips a hostname that equals the name case-insensitively and falls through to a distinct address', () => {
const endpoint = connectionAgentEndpointDisplay(
- connectionFixture({ name: 'Host-1', address: '10.0.0.7', agentIdentity: { hostname: 'host-1' } }),
+ connectionFixture({
+ name: 'Host-1',
+ address: '10.0.0.7',
+ agentIdentity: { hostname: 'host-1' },
+ }),
);
// hostname 'host-1' lowercased equals name 'Host-1' lowercased -> skipped;
// address '10.0.0.7' is distinct -> returned.
@@ -310,7 +334,12 @@ describe('connectionAgentEndpointDisplay (remaining branches)', () => {
it('returns null when no reportIp, alias, hostname, or address is available', () => {
expect(
connectionAgentEndpointDisplay(
- connectionFixture({ name: 'host-1', address: '', agentIdentity: undefined, hostAliases: [] }),
+ connectionFixture({
+ name: 'host-1',
+ address: '',
+ agentIdentity: undefined,
+ hostAliases: [],
+ }),
),
).toBeNull();
});
@@ -367,13 +396,17 @@ describe('prettifyPlatform (via connectionAgentIdentitySummary)', () => {
describe('connectionAgentHostProfileLabel (via connectionAgentIdentitySummary)', () => {
it('returns the manifest family for a known host profile', () => {
expect(
- connectionAgentIdentitySummary(connectionFixture({ agentIdentity: { hostProfile: 'unraid' } })),
+ connectionAgentIdentitySummary(
+ connectionFixture({ agentIdentity: { hostProfile: 'unraid' } }),
+ ),
).toBe('Unraid');
});
it('resolves a host-profile alias token to its family', () => {
expect(
- connectionAgentIdentitySummary(connectionFixture({ agentIdentity: { hostProfile: 'unraid-os' } })),
+ connectionAgentIdentitySummary(
+ connectionFixture({ agentIdentity: { hostProfile: 'unraid-os' } }),
+ ),
).toBe('Unraid');
});
@@ -381,7 +414,9 @@ describe('connectionAgentHostProfileLabel (via connectionAgentIdentitySummary)',
// 'centos' has no manifest family and is not a canonical platform case, so
// the default arm of prettifyPlatform returns the trimmed value verbatim.
expect(
- connectionAgentIdentitySummary(connectionFixture({ agentIdentity: { hostProfile: 'centos' } })),
+ connectionAgentIdentitySummary(
+ connectionFixture({ agentIdentity: { hostProfile: 'centos' } }),
+ ),
).toBe('centos');
});
@@ -421,20 +456,43 @@ describe('connectionAgentHostProfileLabel (via connectionAgentIdentitySummary)',
describe('configDriftSignal (via fleetGovernanceSignalsForConnection)', () => {
it.each([
['current', 'Config current', 'Desired and applied configuration fingerprints match.', 'ok'],
- ['drifted', 'Config drift', 'Desired and applied configuration fingerprints do not match.', 'warning'],
- ['pending', 'Config pending', 'Pulse is waiting for applied configuration confirmation.', 'warning'],
+ [
+ 'drifted',
+ 'Config drift',
+ 'Desired and applied configuration fingerprints do not match.',
+ 'warning',
+ ],
+ [
+ 'pending',
+ 'Config pending',
+ 'Pulse is waiting for applied configuration confirmation.',
+ 'warning',
+ ],
['paused', 'Config paused', 'Configuration rollout is paused for this source.', 'muted'],
- ['unknown', 'Config unknown', 'Pulse does not yet have enough config fingerprint data.', 'warning'],
- ['not-applicable', 'No config drift', 'This source is not governed by desired/applied config rollout.', 'muted'],
+ [
+ 'unknown',
+ 'Config unknown',
+ 'Pulse does not yet have enough config fingerprint data.',
+ 'warning',
+ ],
+ [
+ 'not-applicable',
+ 'No config drift',
+ 'This source is not governed by desired/applied config rollout.',
+ 'muted',
+ ],
] as const satisfies ReadonlyArray<
[ConnectionFleetConfigDriftStatus, string, string, FleetGovernanceSignalTone]
- >)('uses the fallback detail when configDrift %s carries no reason', (status, label, detail, tone) => {
- const signal = signalByKey(
- connectionFixture({ fleet: fleetFixture({ configDrift: { status } }) }),
- 'config-drift',
- );
- expect(signal).toMatchObject({ key: 'config-drift', label, detail, tone });
- });
+ >)(
+ 'uses the fallback detail when configDrift %s carries no reason',
+ (status, label, detail, tone) => {
+ const signal = signalByKey(
+ connectionFixture({ fleet: fleetFixture({ configDrift: { status } }) }),
+ 'config-drift',
+ );
+ expect(signal).toMatchObject({ key: 'config-drift', label, detail, tone });
+ },
+ );
it('honours an explicit reason over the fallback copy (pending case)', () => {
const signal = signalByKey(
@@ -455,18 +513,26 @@ describe('rolloutSignal (via fleetGovernanceSignalsForConnection)', () => {
['current', 'Rollout current', 'The rollout state is current.', 'ok'],
['pending', 'Rollout pending', 'The staged rollout is waiting for confirmation.', 'warning'],
['paused', 'Rollout paused', 'The staged rollout is paused.', 'warning'],
- ['blocked', 'Rollout blocked', 'The rollout is blocked by the current connection state.', 'critical'],
+ [
+ 'blocked',
+ 'Rollout blocked',
+ 'The rollout is blocked by the current connection state.',
+ 'critical',
+ ],
['unknown', 'Rollout unknown', 'Pulse has not classified staged rollout state yet.', 'warning'],
['not-applicable', 'No rollout', 'This source does not use staged rollout control.', 'muted'],
] as const satisfies ReadonlyArray<
[ConnectionFleetRolloutStatus, string, string, FleetGovernanceSignalTone]
- >)('uses the fallback detail when rollout %s carries no reason', (status, label, detail, tone) => {
- const signal = signalByKey(
- connectionFixture({ fleet: fleetFixture({ rollout: { status } }) }),
- 'rollout',
- );
- expect(signal).toMatchObject({ key: 'rollout', label, detail, tone });
- });
+ >)(
+ 'uses the fallback detail when rollout %s carries no reason',
+ (status, label, detail, tone) => {
+ const signal = signalByKey(
+ connectionFixture({ fleet: fleetFixture({ rollout: { status } }) }),
+ 'rollout',
+ );
+ expect(signal).toMatchObject({ key: 'rollout', label, detail, tone });
+ },
+ );
it('honours an explicit reason over the fallback copy (pending case)', () => {
const signal = signalByKey(
@@ -488,8 +554,18 @@ describe('rolloutSignal (via fleetGovernanceSignalsForConnection)', () => {
describe('credentialHealthSignal (via fleetGovernanceSignalsForConnection)', () => {
it.each([
- ['expiring', 'Credentials expiring', 'The credential is approaching its configured expiration.', 'warning'],
- ['not-applicable', 'No credentials', 'This source does not use a stored credential path.', 'muted'],
+ [
+ 'expiring',
+ 'Credentials expiring',
+ 'The credential is approaching its configured expiration.',
+ 'warning',
+ ],
+ [
+ 'not-applicable',
+ 'No credentials',
+ 'This source does not use a stored credential path.',
+ 'muted',
+ ],
] as const satisfies ReadonlyArray<
[ConnectionFleetCredentialHealthStatus, string, string, FleetGovernanceSignalTone]
>)('maps credential-health status %s to its fixed signal', (status, label, detail, tone) => {
diff --git a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.coverage.test.ts b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.coverage.test.ts
index 7ff4ced962..304a9dbd79 100644
--- a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.coverage.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.coverage.test.ts
@@ -43,7 +43,9 @@ const connectionFixture = (overrides: Partial<Connection> = {}): Connection => (
// fields (configDrift/rollout/credentialHealth/commandPolicy) are left
// undefined so the *FromFleet derivation paths are exercised unless a test
// overrides them explicitly.
-const fleetFixture = (overrides: Partial<ConnectionFleetGovernance> = {}): ConnectionFleetGovernance => ({
+const fleetFixture = (
+ overrides: Partial<ConnectionFleetGovernance> = {},
+): ConnectionFleetGovernance => ({
enrollmentState: 'enrolled',
livenessState: 'active',
versionDrift: 'current',
@@ -119,9 +121,9 @@ describe('isIPv4Literal (via connectionAgentEndpointDisplay)', () => {
it('skips whitespace-only aliases before the first valid literal', () => {
// Empty/whitespace aliases are skipped by trim(), then the first valid
// literal wins.
- expect(
- connectionAgentEndpointDisplay(aliasConnection([' ', '', '10.0.0.5'])),
- ).toBe('10.0.0.5');
+ expect(connectionAgentEndpointDisplay(aliasConnection([' ', '', '10.0.0.5']))).toBe(
+ '10.0.0.5',
+ );
});
it('trims surrounding whitespace from a candidate before matching', () => {
@@ -208,7 +210,13 @@ describe('fleetSignalClassName', () => {
);
it('always embeds the shared layout prefix', () => {
- for (const tone of ['ok', 'info', 'warning', 'critical', 'muted'] as FleetGovernanceSignalTone[]) {
+ for (const tone of [
+ 'ok',
+ 'info',
+ 'warning',
+ 'critical',
+ 'muted',
+ ] as FleetGovernanceSignalTone[]) {
expect(fleetSignalClassName(tone).startsWith(PREFIX)).toBe(true);
}
});
@@ -288,7 +296,11 @@ describe('rolloutFromFleet (via fleetGovernanceSignalsForConnection)', () => {
}),
'rollout',
);
- expect(signal).toMatchObject({ label: 'Rollout blocked', detail: 'halted by operator', tone: 'critical' });
+ expect(signal).toMatchObject({
+ label: 'Rollout blocked',
+ detail: 'halted by operator',
+ tone: 'critical',
+ });
});
it.each(['configured', 'reported'] as ConnectionFleetConfigRollout[])(
@@ -345,16 +357,15 @@ describe('credentialHealthFromFleet (via fleetGovernanceSignalsForConnection)',
['invalid', 'Credentials invalid', 'critical'],
['paused', 'Credentials paused', 'muted'],
['unknown', 'Credentials unknown', 'warning'],
- ] as const satisfies ReadonlyArray<[ConnectionFleetCredentialStatus, string, FleetGovernanceSignalTone]>)(
- 'derives the credential-health signal from credentialStatus %s',
- (status, label, tone) => {
- const signal = signalByKey(
- connectionFixture({ fleet: fleetFixture({ credentialStatus: status }) }),
- 'credential-health',
- );
- expect(signal).toMatchObject({ label, tone });
- },
- );
+ ] as const satisfies ReadonlyArray<
+ [ConnectionFleetCredentialStatus, string, FleetGovernanceSignalTone]
+ >)('derives the credential-health signal from credentialStatus %s', (status, label, tone) => {
+ const signal = signalByKey(
+ connectionFixture({ fleet: fleetFixture({ credentialStatus: status }) }),
+ 'credential-health',
+ );
+ expect(signal).toMatchObject({ label, tone });
+ });
it('surfaces credential-health for non-agent API sources too', () => {
// credentialHealth is source-agnostic: it appears even when agent-fleet
@@ -435,7 +446,9 @@ describe('commandPolicyFromFleet (via fleetGovernanceSignalsForConnection)', ()
['enabled', 'Remote control enabled', 'info'],
['disabled', 'Remote control disabled', 'info'],
['not-applicable', 'No remote control', 'muted'],
- ] as const satisfies ReadonlyArray<[ConnectionFleetRemoteControl, string, FleetGovernanceSignalTone]>)(
+ ] as const satisfies ReadonlyArray<
+ [ConnectionFleetRemoteControl, string, FleetGovernanceSignalTone]
+ >)(
'derives the command-policy signal from remoteControl %s (enforcement not-applicable)',
(remoteControl, label, tone) => {
const signal = signalByKey(
@@ -525,16 +538,15 @@ describe('versionSignal (via fleetGovernanceSignalsForConnection)', () => {
['current', 'Version current', 'ok'],
['unknown', 'Version unknown', 'muted'],
['not-applicable', 'No agent version', 'muted'],
- ] as const satisfies ReadonlyArray<[ConnectionFleetVersionDrift, string, FleetGovernanceSignalTone]>)(
- 'maps version drift %s to its signal',
- (state, label, tone) => {
- const signal = signalByKey(
- connectionFixture({ fleet: fleetFixture({ versionDrift: state }) }),
- 'version',
- );
- expect(signal).toMatchObject({ key: 'version', label, tone });
- },
- );
+ ] as const satisfies ReadonlyArray<
+ [ConnectionFleetVersionDrift, string, FleetGovernanceSignalTone]
+ >)('maps version drift %s to its signal', (state, label, tone) => {
+ const signal = signalByKey(
+ connectionFixture({ fleet: fleetFixture({ versionDrift: state }) }),
+ 'version',
+ );
+ expect(signal).toMatchObject({ key: 'version', label, tone });
+ });
});
// ---- fleetGovernanceSignalsForConnection (orchestrator) --------------------
diff --git a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts
index a5f7e40550..df8ebdec6b 100644
--- a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts
@@ -25,88 +25,88 @@ const connectionFixture = (overrides: Partial<Connection> = {}): Connection => (
});
describe('visibleFleetGovernanceSignals', () => {
- it('surfaces the failed module and its operator-facing reason', () => {
- const signals = fleetGovernanceSignalsForConnection(
- connectionFixture({
- agentModules: [
- {
- name: 'docker',
- enabled: true,
- state: 'retrying',
- lastError: 'cannot connect to /var/run/docker.sock',
- updatedAt: '2026-07-09T12:00:00Z',
- },
- ],
- fleet: {
- enrollmentState: 'enrolled',
- livenessState: 'active',
- versionDrift: 'current',
- adapterHealth: 'degraded',
- configRollout: 'reported',
- credentialStatus: 'verified',
- updateStatus: 'current',
- remoteControl: 'disabled',
- },
- }),
- );
+ it('surfaces the failed module and its operator-facing reason', () => {
+ const signals = fleetGovernanceSignalsForConnection(
+ connectionFixture({
+ agentModules: [
+ {
+ name: 'docker',
+ enabled: true,
+ state: 'retrying',
+ lastError: 'cannot connect to /var/run/docker.sock',
+ updatedAt: '2026-07-09T12:00:00Z',
+ },
+ ],
+ fleet: {
+ enrollmentState: 'enrolled',
+ livenessState: 'active',
+ versionDrift: 'current',
+ adapterHealth: 'degraded',
+ configRollout: 'reported',
+ credentialStatus: 'verified',
+ updateStatus: 'current',
+ remoteControl: 'disabled',
+ },
+ }),
+ );
- expect(visibleFleetGovernanceSignals(signals)).toEqual(
- expect.arrayContaining([
- expect.objectContaining({
- key: 'module-health',
- label: 'Docker module retrying',
- detail: 'cannot connect to /var/run/docker.sock',
- tone: 'warning',
- }),
- ]),
- );
- });
+ expect(visibleFleetGovernanceSignals(signals)).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ key: 'module-health',
+ label: 'Docker module retrying',
+ detail: 'cannot connect to /var/run/docker.sock',
+ tone: 'warning',
+ }),
+ ]),
+ );
+ });
- it('keeps updater failures and disabled auto-update actionable', () => {
- const failed = fleetGovernanceSignalsForConnection(
- connectionFixture({
- agentUpdate: {
- state: 'error',
- autoUpdate: true,
- lastError: 'signature verification failed',
- },
- fleet: {
- enrollmentState: 'enrolled',
- livenessState: 'active',
- versionDrift: 'behind',
- adapterHealth: 'healthy',
- configRollout: 'reported',
- credentialStatus: 'verified',
- updateStatus: 'failed',
- remoteControl: 'disabled',
- },
- }),
- );
- const disabled = fleetGovernanceSignalsForConnection(
- connectionFixture({
- fleet: {
- enrollmentState: 'enrolled',
- livenessState: 'active',
- versionDrift: 'behind',
- adapterHealth: 'healthy',
- configRollout: 'reported',
- credentialStatus: 'verified',
- updateStatus: 'disabled',
- remoteControl: 'disabled',
- },
- }),
- );
+ it('keeps updater failures and disabled auto-update actionable', () => {
+ const failed = fleetGovernanceSignalsForConnection(
+ connectionFixture({
+ agentUpdate: {
+ state: 'error',
+ autoUpdate: true,
+ lastError: 'signature verification failed',
+ },
+ fleet: {
+ enrollmentState: 'enrolled',
+ livenessState: 'active',
+ versionDrift: 'behind',
+ adapterHealth: 'healthy',
+ configRollout: 'reported',
+ credentialStatus: 'verified',
+ updateStatus: 'failed',
+ remoteControl: 'disabled',
+ },
+ }),
+ );
+ const disabled = fleetGovernanceSignalsForConnection(
+ connectionFixture({
+ fleet: {
+ enrollmentState: 'enrolled',
+ livenessState: 'active',
+ versionDrift: 'behind',
+ adapterHealth: 'healthy',
+ configRollout: 'reported',
+ credentialStatus: 'verified',
+ updateStatus: 'disabled',
+ remoteControl: 'disabled',
+ },
+ }),
+ );
- expect(failed.find((signal) => signal.key === 'updates')).toMatchObject({
- label: 'Agent update failed',
- detail: 'signature verification failed',
- tone: 'critical',
- });
- expect(disabled.find((signal) => signal.key === 'updates')).toMatchObject({
- label: 'Auto-update off',
- tone: 'warning',
- });
- });
+ expect(failed.find((signal) => signal.key === 'updates')).toMatchObject({
+ label: 'Agent update failed',
+ detail: 'signature verification failed',
+ tone: 'critical',
+ });
+ expect(disabled.find((signal) => signal.key === 'updates')).toMatchObject({
+ label: 'Auto-update off',
+ tone: 'warning',
+ });
+ });
it('hides passive agent config fingerprint handshakes while preserving raw fleet facts', () => {
const rawSignals = fleetGovernanceSignalsForConnection(
diff --git a/frontend-modern/src/components/Settings/__tests__/dataHandlingPanelModel.test.ts b/frontend-modern/src/components/Settings/__tests__/dataHandlingPanelModel.test.ts
index fa9e0c0508..fead31b8ee 100644
--- a/frontend-modern/src/components/Settings/__tests__/dataHandlingPanelModel.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/dataHandlingPanelModel.test.ts
@@ -67,4 +67,3 @@ describe('dataHandlingPanelModel', () => {
expect(model.redactionItems).toEqual([]);
});
});
-
diff --git a/frontend-modern/src/components/Settings/__tests__/diagnosticsModel.branchcov2.test.ts b/frontend-modern/src/components/Settings/__tests__/diagnosticsModel.branchcov2.test.ts
index 61698afcb5..41dd142b82 100644
--- a/frontend-modern/src/components/Settings/__tests__/diagnosticsModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/diagnosticsModel.branchcov2.test.ts
@@ -409,9 +409,8 @@ describe('sanitizeDiagnosticsData / dockerAgents', () => {
} as DockerAgentsDiagnosticWithExtras,
});
- const attention = (
- sanitized.dockerAgents as unknown as DockerAgentsDiagnosticWithExtras
- ).attention;
+ const attention = (sanitized.dockerAgents as unknown as DockerAgentsDiagnosticWithExtras)
+ .attention;
expect(attention).toStrictEqual([
{
agentId: 'docker-host-1',
@@ -566,9 +565,7 @@ describe('sanitizeDiagnosticsData / snapshot arrays', () => {
} as DiagnosticsDataWithSnapshots);
const out = sanitized as unknown as DiagnosticsDataWithSnapshots;
- expect(out.guestSnapshots).toStrictEqual([
- { instance: 'node-1', status: 'running' },
- ]);
+ expect(out.guestSnapshots).toStrictEqual([{ instance: 'node-1', status: 'running' }]);
});
it('stamps an instance placeholder on every memorySources entry', () => {
@@ -578,9 +575,7 @@ describe('sanitizeDiagnosticsData / snapshot arrays', () => {
} as DiagnosticsDataWithSnapshots);
const out = sanitized as unknown as DiagnosticsDataWithSnapshots;
- expect(out.memorySources).toStrictEqual([
- { instance: 'node-1', source: 'balloon' },
- ]);
+ expect(out.memorySources).toStrictEqual([{ instance: 'node-1', source: 'balloon' }]);
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov2.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov2.test.ts
index ad698a7e76..ebaff2dbd6 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureAgentUpdateCommandsModel.branchcov2.test.ts
@@ -218,7 +218,9 @@ describe('connectionDisplayName (via target.displayName)', () => {
agentIdentity: { hostname: 'real-hostname', platform: 'linux' },
});
- const targets = collectInfrastructureAgentUpdateTargets([row({ attachedConnections: [agent] })]);
+ const targets = collectInfrastructureAgentUpdateTargets([
+ row({ attachedConnections: [agent] }),
+ ]);
expect(targets[0]?.displayName).toBe('real-hostname');
});
@@ -231,7 +233,9 @@ describe('connectionDisplayName (via target.displayName)', () => {
agentIdentity: undefined,
});
- const targets = collectInfrastructureAgentUpdateTargets([row({ attachedConnections: [agent] })]);
+ const targets = collectInfrastructureAgentUpdateTargets([
+ row({ attachedConnections: [agent] }),
+ ]);
expect(targets[0]?.displayName).toBe('named-host');
});
@@ -244,7 +248,9 @@ describe('connectionDisplayName (via target.displayName)', () => {
agentIdentity: { hostname: ' ', platform: 'linux' },
});
- const targets = collectInfrastructureAgentUpdateTargets([row({ attachedConnections: [agent] })]);
+ const targets = collectInfrastructureAgentUpdateTargets([
+ row({ attachedConnections: [agent] }),
+ ]);
expect(targets[0]?.displayName).toBe('named-host');
});
@@ -257,7 +263,9 @@ describe('connectionDisplayName (via target.displayName)', () => {
agentIdentity: { hostname: ' ', platform: 'linux' },
});
- const targets = collectInfrastructureAgentUpdateTargets([row({ attachedConnections: [agent] })]);
+ const targets = collectInfrastructureAgentUpdateTargets([
+ row({ attachedConnections: [agent] }),
+ ]);
expect(targets[0]?.displayName).toBe('10.0.0.4');
});
@@ -270,7 +278,9 @@ describe('connectionDisplayName (via target.displayName)', () => {
agentIdentity: { hostname: '', platform: 'linux' },
});
- const targets = collectInfrastructureAgentUpdateTargets([row({ attachedConnections: [agent] })]);
+ const targets = collectInfrastructureAgentUpdateTargets([
+ row({ attachedConnections: [agent] }),
+ ]);
expect(targets[0]?.displayName).toBe('agent:h5');
});
@@ -362,7 +372,9 @@ describe('expectedVersionFor (via target.expectedVersion)', () => {
agentUpdateAvailable: true,
});
- const targets = collectInfrastructureAgentUpdateTargets([row({ attachedConnections: [agent] })]);
+ const targets = collectInfrastructureAgentUpdateTargets([
+ row({ attachedConnections: [agent] }),
+ ]);
expect(targets[0]?.expectedVersion).toBe('6.0.1');
});
@@ -392,7 +404,9 @@ describe('expectedVersionFor (via target.expectedVersion)', () => {
agentUpdateAvailable: true,
});
- const targets = collectInfrastructureAgentUpdateTargets([row({ attachedConnections: [agent] })]);
+ const targets = collectInfrastructureAgentUpdateTargets([
+ row({ attachedConnections: [agent] }),
+ ]);
expect(targets[0]?.expectedVersion).toBeUndefined();
});
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureImportPlanModel.branchcov.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureImportPlanModel.branchcov.test.ts
index c9c01ebecf..1e9200aac1 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureImportPlanModel.branchcov.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureImportPlanModel.branchcov.test.ts
@@ -80,7 +80,7 @@ describe('nodeTypeToMonitoredSource / nodeTypeToResourceType (pmg arm)', () => {
// ---- hostnameFromEndpoint ---------------------------------------------------
describe('hostnameFromEndpoint (via plan.hostname)', () => {
- it("returns an empty hostname when the endpoint is empty", () => {
+ it('returns an empty hostname when the endpoint is empty', () => {
// formData.host empty AND probe host empty => endpoint '' => hostname ''.
const plan = buildNodeImportPlan(
'pve',
@@ -92,7 +92,7 @@ describe('hostnameFromEndpoint (via plan.hostname)', () => {
expect(plan?.hostname).toBe('');
});
- it("parses a scheme-less host by implicitly prepending https://", () => {
+ it('parses a scheme-less host by implicitly prepending https://', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'tower.local:8006' }),
@@ -104,7 +104,7 @@ describe('hostnameFromEndpoint (via plan.hostname)', () => {
expect(plan?.hostname).toBe('tower.local');
});
- it("falls back to manual host stripping when the URL cannot be parsed", () => {
+ it('falls back to manual host stripping when the URL cannot be parsed', () => {
// 'bad:host' makes `new URL('https://bad:host')` throw (invalid port); the
// catch arm strips any scheme, drops the path, then drops the port.
const plan = buildNodeImportPlan(
@@ -122,17 +122,19 @@ describe('hostnameFromEndpoint (via plan.hostname)', () => {
// `normalizeEndpoint(formData.host) || endpointFromCandidate(candidate)`.
describe('endpointFromCandidate (via plan.endpoint with empty formData.host)', () => {
- it("normalizes (trims) the probe candidate host", () => {
+ it('normalizes (trims) the probe candidate host', () => {
const plan = buildNodeImportPlan(
'pbs',
makeForm('pbs', { host: '' }),
- probeCandidate(makeProbe({ type: 'pbs', host: ' https://backup.local:8007 ', port: 8007 })),
+ probeCandidate(
+ makeProbe({ type: 'pbs', host: ' https://backup.local:8007 ', port: 8007 }),
+ ),
);
expect(plan?.endpoint).toBe('https://backup.local:8007');
});
- it("prefers the discovery server hostname when present", () => {
+ it('prefers the discovery server hostname when present', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { host: '' }),
@@ -142,7 +144,7 @@ describe('endpointFromCandidate (via plan.endpoint with empty formData.host)', (
expect(plan?.endpoint).toBe('https://host.local:8006');
});
- it("falls back to the IP when the discovery hostname is an empty string", () => {
+ it('falls back to the IP when the discovery hostname is an empty string', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { host: '' }),
@@ -152,7 +154,7 @@ describe('endpointFromCandidate (via plan.endpoint with empty formData.host)', (
expect(plan?.endpoint).toBe('https://10.0.0.20:8006');
});
- it("falls back to the IP when the discovery hostname is undefined", () => {
+ it('falls back to the IP when the discovery hostname is undefined', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { host: '' }),
@@ -166,7 +168,7 @@ describe('endpointFromCandidate (via plan.endpoint with empty formData.host)', (
// ---- versionFromCandidate ---------------------------------------------------
describe('versionFromCandidate (via plan.detectedVersion)', () => {
- it("joins product and version hints for a probe candidate", () => {
+ it('joins product and version hints for a probe candidate', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -176,7 +178,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('Proxmox VE 9.1');
});
- it("returns only the product when the version hint is absent", () => {
+ it('returns only the product when the version hint is absent', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -186,7 +188,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('Proxmox VE');
});
- it("returns only the version when the product hint is absent", () => {
+ it('returns only the version when the product hint is absent', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -196,7 +198,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('9.1');
});
- it("uses the generic fallback when hints are missing entirely", () => {
+ it('uses the generic fallback when hints are missing entirely', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -206,7 +208,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('Detected API endpoint');
});
- it("uses the generic fallback when both hints trim to empty", () => {
+ it('uses the generic fallback when both hints trim to empty', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -216,7 +218,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('Detected API endpoint');
});
- it("joins server version and release for a discovery candidate", () => {
+ it('joins server version and release for a discovery candidate', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -226,7 +228,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('Proxmox VE 8.4');
});
- it("returns only the server version when release is undefined", () => {
+ it('returns only the server version when release is undefined', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -236,7 +238,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('Proxmox VE');
});
- it("returns only the release when version is empty", () => {
+ it('returns only the release when version is empty', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -246,7 +248,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
expect(plan?.detectedVersion).toBe('9.0');
});
- it("returns an empty detected version when both version and release are empty", () => {
+ it('returns an empty detected version when both version and release are empty', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -260,7 +262,7 @@ describe('versionFromCandidate (via plan.detectedVersion)', () => {
// ---- candidateLabel ---------------------------------------------------------
describe('candidateLabel (via plan.candidateLabel and steps[0].detail)', () => {
- it("describes a probe candidate with its host", () => {
+ it('describes a probe candidate with its host', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -272,7 +274,7 @@ describe('candidateLabel (via plan.candidateLabel and steps[0].detail)', () => {
expect(plan?.steps[0]?.detail).toBe(plan?.candidateLabel);
});
- it("describes a discovery candidate using its hostname", () => {
+ it('describes a discovery candidate using its hostname', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -282,7 +284,7 @@ describe('candidateLabel (via plan.candidateLabel and steps[0].detail)', () => {
expect(plan?.candidateLabel).toBe('Discovery candidate at node7.local:8006');
});
- it("falls back to the IP in the discovery label when hostname is empty", () => {
+ it('falls back to the IP in the discovery label when hostname is empty', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -292,7 +294,7 @@ describe('candidateLabel (via plan.candidateLabel and steps[0].detail)', () => {
expect(plan?.candidateLabel).toBe('Discovery candidate at 10.0.0.5:8006');
});
- it("falls back to the IP in the discovery label when hostname is undefined", () => {
+ it('falls back to the IP in the discovery label when hostname is undefined', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
@@ -306,34 +308,47 @@ describe('candidateLabel (via plan.candidateLabel and steps[0].detail)', () => {
// ---- credentialLabel --------------------------------------------------------
describe('credentialLabel (via plan.credentialLabel and steps[1].detail)', () => {
- it("emits the password-validation message when authType is password", () => {
+ it('emits the password-validation message when authType is password', () => {
// authType === 'password' short-circuits ahead of setupMode.
const plan = buildNodeImportPlan(
'pve',
- makeForm('pve', { name: 'x', host: 'https://x.local', authType: 'password', setupMode: 'auto' }),
+ makeForm('pve', {
+ name: 'x',
+ host: 'https://x.local',
+ authType: 'password',
+ setupMode: 'auto',
+ }),
probeCandidate(makeProbe()),
);
- expect(plan?.credentialLabel).toBe(
- 'Validate username and password credentials before saving.',
- );
+ expect(plan?.credentialLabel).toBe('Validate username and password credentials before saving.');
expect(plan?.steps[1]?.detail).toBe(plan?.credentialLabel);
});
- it("emits the API-token message for token + manual setup", () => {
+ it('emits the API-token message for token + manual setup', () => {
const plan = buildNodeImportPlan(
'pve',
- makeForm('pve', { name: 'x', host: 'https://x.local', authType: 'token', setupMode: 'manual' }),
+ makeForm('pve', {
+ name: 'x',
+ host: 'https://x.local',
+ authType: 'token',
+ setupMode: 'manual',
+ }),
probeCandidate(makeProbe()),
);
expect(plan?.credentialLabel).toBe('Validate the supplied API token before saving.');
});
- it("emits the agent handoff message for token + agent setup", () => {
+ it('emits the agent handoff message for token + agent setup', () => {
const plan = buildNodeImportPlan(
'pve',
- makeForm('pve', { name: 'x', host: 'https://x.local', authType: 'token', setupMode: 'agent' }),
+ makeForm('pve', {
+ name: 'x',
+ host: 'https://x.local',
+ authType: 'token',
+ setupMode: 'agent',
+ }),
probeCandidate(makeProbe()),
);
@@ -342,7 +357,7 @@ describe('credentialLabel (via plan.credentialLabel and steps[1].detail)', () =>
);
});
- it("emits the inventory-setup fallback for token + auto setup", () => {
+ it('emits the inventory-setup fallback for token + auto setup', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local', authType: 'token', setupMode: 'auto' }),
@@ -358,7 +373,7 @@ describe('credentialLabel (via plan.credentialLabel and steps[1].detail)', () =>
// ---- coverageLabel ----------------------------------------------------------
describe('coverageLabel (via plan.coverageLabel)', () => {
- it("lists only the SMART-disks collector when it is the sole enabled PVE collector", () => {
+ it('lists only the SMART-disks collector when it is the sole enabled PVE collector', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', {
@@ -376,7 +391,7 @@ describe('coverageLabel (via plan.coverageLabel)', () => {
expect(plan?.coverageLabel).toBe('SMART disks');
});
- it("joins a selected subset of PVE collectors in declared order", () => {
+ it('joins a selected subset of PVE collectors in declared order', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', {
@@ -394,7 +409,7 @@ describe('coverageLabel (via plan.coverageLabel)', () => {
expect(plan?.coverageLabel).toBe('VMs, storage');
});
- it("reports no Proxmox collectors when every PVE toggle is off", () => {
+ it('reports no Proxmox collectors when every PVE toggle is off', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', {
@@ -412,7 +427,7 @@ describe('coverageLabel (via plan.coverageLabel)', () => {
expect(plan?.coverageLabel).toBe('No Proxmox collectors selected');
});
- it("reports no PBS collectors when every PBS toggle is off", () => {
+ it('reports no PBS collectors when every PBS toggle is off', () => {
const plan = buildNodeImportPlan(
'pbs',
makeForm('pbs', {
@@ -430,7 +445,7 @@ describe('coverageLabel (via plan.coverageLabel)', () => {
expect(plan?.coverageLabel).toBe('No PBS collectors selected');
});
- it("lists the default PMG collectors in declared order", () => {
+ it('lists the default PMG collectors in declared order', () => {
const plan = buildNodeImportPlan(
'pmg',
makeForm('pmg', { name: 'x', host: 'https://x.local' }),
@@ -441,7 +456,7 @@ describe('coverageLabel (via plan.coverageLabel)', () => {
expect(plan?.coverageLabel).toBe('mail stats, queues, quarantine');
});
- it("reports no PMG collectors when every PMG toggle is off", () => {
+ it('reports no PMG collectors when every PMG toggle is off', () => {
const plan = buildNodeImportPlan(
'pmg',
makeForm('pmg', {
@@ -462,19 +477,19 @@ describe('coverageLabel (via plan.coverageLabel)', () => {
// ---- buildNodeImportPlan guards + wiring -----------------------------------
describe('buildNodeImportPlan guards and wiring', () => {
- it("returns null when the candidate is null", () => {
+ it('returns null when the candidate is null', () => {
const plan = buildNodeImportPlan('pve', makeForm('pve'), null);
expect(plan).toBeNull();
});
- it("returns null when the candidate is undefined", () => {
+ it('returns null when the candidate is undefined', () => {
const plan = buildNodeImportPlan('pve', makeForm('pve'), undefined);
expect(plan).toBeNull();
});
- it("omits the preview request when both endpoint and derived name are empty", () => {
+ it('omits the preview request when both endpoint and derived name are empty', () => {
// Empty formData.host + empty probe host => endpoint '' => hostname ''.
// Empty name => deriveNameFromHost('') === '' => name ''.
const plan = buildNodeImportPlan(
@@ -486,7 +501,7 @@ describe('buildNodeImportPlan guards and wiring', () => {
expect(plan.previewRequest).toBeNull();
});
- it("derives the node name from the endpoint host when formData.name is empty", () => {
+ it('derives the node name from the endpoint host when formData.name is empty', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: '', host: 'https://node7.local:8006' }),
@@ -499,7 +514,7 @@ describe('buildNodeImportPlan guards and wiring', () => {
expect(plan?.previewRequest?.candidate.resource_id).toBe('node7.local');
});
- it("composes the signature from source, candidate, version, name, endpoint, auth, setup, coverage", () => {
+ it('composes the signature from source, candidate, version, name, endpoint, auth, setup, coverage', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', {
@@ -530,7 +545,7 @@ describe('buildNodeImportPlan guards and wiring', () => {
);
});
- it("emits the five canonical steps in order", () => {
+ it('emits the five canonical steps in order', () => {
const plan = buildNodeImportPlan(
'pve',
makeForm('pve', { name: 'x', host: 'https://x.local' }),
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.branchcov.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.branchcov.test.ts
index f2f5a9f07f..b760f9842a 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.branchcov.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.branchcov.test.ts
@@ -99,15 +99,15 @@ describe('getPowerShellInstallProfileEnvFromFlags', () => {
});
it('produces both assignments for the proxmox-pve profile flags', () => {
- expect(getPowerShellInstallProfileEnvFromFlags(['--enable-proxmox', '--proxmox-type pve'])).toEqual(
- [`$env:PULSE_ENABLE_PROXMOX="true"`, `$env:PULSE_PROXMOX_TYPE="pve"`],
- );
+ expect(
+ getPowerShellInstallProfileEnvFromFlags(['--enable-proxmox', '--proxmox-type pve']),
+ ).toEqual([`$env:PULSE_ENABLE_PROXMOX="true"`, `$env:PULSE_PROXMOX_TYPE="pve"`]);
});
it('produces both assignments for the proxmox-pbs profile flags', () => {
- expect(getPowerShellInstallProfileEnvFromFlags(['--enable-proxmox', '--proxmox-type pbs'])).toEqual(
- [`$env:PULSE_ENABLE_PROXMOX="true"`, `$env:PULSE_PROXMOX_TYPE="pbs"`],
- );
+ expect(
+ getPowerShellInstallProfileEnvFromFlags(['--enable-proxmox', '--proxmox-type pbs']),
+ ).toEqual([`$env:PULSE_ENABLE_PROXMOX="true"`, `$env:PULSE_PROXMOX_TYPE="pbs"`]);
});
it('does not recognize the "--proxmox-type=<value>" equals form', () => {
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.coverage.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.coverage.test.ts
index f800731c6c..da884e0482 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.coverage.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureOperationsModel.coverage.test.ts
@@ -60,7 +60,7 @@ describe('shellQuoteArg', () => {
});
it('preserves spaces and double quotes without escaping them', () => {
- expect(shellQuoteArg('say "hi" now')).toBe("'say \"hi\" now'");
+ expect(shellQuoteArg('say "hi" now')).toBe('\'say "hi" now\'');
});
it('keeps shell metacharacters literal inside the single quotes', () => {
@@ -117,9 +117,7 @@ describe('getRowReportingSummary', () => {
it('lower-cases only the first surface label and wraps a single item', () => {
expect(
- getRowReportingSummary(
- makeRow({ surfaces: [surface('Host telemetry', 'agent')] }),
- ),
+ getRowReportingSummary(makeRow({ surfaces: [surface('Host telemetry', 'agent')] })),
).toBe('Pulse is receiving host telemetry from this item.');
});
@@ -152,11 +150,9 @@ describe('getRowReportingSummary', () => {
it('keeps an empty first label empty rather than lower-casing nothing', () => {
// sentenceCaseSurfaceLabel guards label.length === 0; an empty first label
// therefore flows through unchanged, producing a double-space gap.
- expect(
- getRowReportingSummary(
- makeRow({ surfaces: [surface('', 'agent')] }),
- ),
- ).toBe('Pulse is receiving from this item.');
+ expect(getRowReportingSummary(makeRow({ surfaces: [surface('', 'agent')] }))).toBe(
+ 'Pulse is receiving from this item.',
+ );
});
it('does not mutate labels that are not in the first position', () => {
diff --git a/frontend-modern/src/components/Settings/__tests__/infrastructureSettingsModel.branchcov2.test.ts b/frontend-modern/src/components/Settings/__tests__/infrastructureSettingsModel.branchcov2.test.ts
index ace0169fc7..975d0bb657 100644
--- a/frontend-modern/src/components/Settings/__tests__/infrastructureSettingsModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/infrastructureSettingsModel.branchcov2.test.ts
@@ -44,8 +44,7 @@ const makeNode = (overrides: Record<string, unknown>): NodeConfigWithStatus =>
}) as unknown as NodeConfigWithStatus;
/** Minimal `Resource` carrying only the identity fields the matcher reads. */
-const makeResource = (id: string, name: string): Resource =>
- ({ id, name }) as unknown as Resource;
+const makeResource = (id: string, name: string): Resource => ({ id, name }) as unknown as Resource;
/** A fully-populated `ClusterEndpoint` with overridable fields. */
const makeEndpoint = (overrides: Partial<ClusterEndpoint> = {}): ClusterEndpoint => ({
@@ -152,7 +151,12 @@ describe('collectRepresentedDiscoveryHosts', () => {
it('buckets each platform type into its own set, normalizing name + host + guestURL', () => {
const result = collectRepresentedDiscoveryHosts([
- makeNode({ type: 'pve', name: 'pve-name', host: 'https://10.0.0.1:8006', guestURL: 'https://10.0.0.1:8006' }),
+ makeNode({
+ type: 'pve',
+ name: 'pve-name',
+ host: 'https://10.0.0.1:8006',
+ guestURL: 'https://10.0.0.1:8006',
+ }),
makeNode({ type: 'pbs', name: 'pbs-name', host: '10.0.0.2:8007' }),
makeNode({ type: 'pmg', name: 'pmg-name', host: 'pmg-host' }),
]);
@@ -173,7 +177,12 @@ describe('collectRepresentedDiscoveryHosts', () => {
it('no-ops cluster aggregation when clusterEndpoints is explicitly undefined (addClusterEndpointHosts undefined arm)', () => {
const result = collectRepresentedDiscoveryHosts([
- makeNode({ type: 'pve', name: 'cluster', host: 'https://primary:8006', clusterEndpoints: undefined }),
+ makeNode({
+ type: 'pve',
+ name: 'cluster',
+ host: 'https://primary:8006',
+ clusterEndpoints: undefined,
+ }),
]);
// `'clusterEndpoints' in node` is true, but `endpoints?.forEach` is a no-op.
expect(result.pve).toStrictEqual(new Set(['cluster', 'primary']));
@@ -181,7 +190,12 @@ describe('collectRepresentedDiscoveryHosts', () => {
it('no-ops cluster aggregation when clusterEndpoints is an empty array', () => {
const result = collectRepresentedDiscoveryHosts([
- makeNode({ type: 'pve', name: 'cluster', host: 'https://primary:8006', clusterEndpoints: [] }),
+ makeNode({
+ type: 'pve',
+ name: 'cluster',
+ host: 'https://primary:8006',
+ clusterEndpoints: [],
+ }),
]);
expect(result.pve).toStrictEqual(new Set(['cluster', 'primary']));
});
@@ -260,9 +274,7 @@ describe('filterRepresentedDiscoveredServers', () => {
],
nodes,
);
- expect(filtered).toEqual([
- { ip: '10.0.0.99', port: 8006, type: 'pve', version: '8.2.2' },
- ]);
+ expect(filtered).toEqual([{ ip: '10.0.0.99', port: 8006, type: 'pve', version: '8.2.2' }]);
});
it('removes a server whose hostname is represented even when its IP is not (hostname arm)', () => {
@@ -291,9 +303,7 @@ describe('filterRepresentedDiscoveredServers', () => {
[{ ip: '10.0.0.99', port: 8006, type: 'pve', version: '8.2.2' }],
nodes,
);
- expect(filtered).toEqual([
- { ip: '10.0.0.99', port: 8006, type: 'pve', version: '8.2.2' },
- ]);
+ expect(filtered).toEqual([{ ip: '10.0.0.99', port: 8006, type: 'pve', version: '8.2.2' }]);
});
it('keeps a server whose IP normalizes to null when nothing represents its hostname (normalizedIP falsy arm)', () => {
@@ -313,9 +323,7 @@ describe('filterRepresentedDiscoveredServers', () => {
[{ ip: '10.0.0.5', port: 8007, type: 'pbs', version: '3.0.1' }],
nodes,
);
- expect(filtered).toEqual([
- { ip: '10.0.0.5', port: 8007, type: 'pbs', version: '3.0.1' },
- ]);
+ expect(filtered).toEqual([{ ip: '10.0.0.5', port: 8007, type: 'pbs', version: '3.0.1' }]);
});
});
@@ -323,10 +331,7 @@ describe('filterRepresentedDiscoveredServers', () => {
describe('matchConfiguredNodeToResource', () => {
it('returns undefined when nodeResources is undefined', () => {
- const result = matchConfiguredNodeToResource(
- makeNode({ id: 'a', name: 'a' }),
- undefined,
- );
+ const result = matchConfiguredNodeToResource(makeNode({ id: 'a', name: 'a' }), undefined);
expect(result).toBeUndefined();
});
@@ -346,10 +351,10 @@ describe('matchConfiguredNodeToResource', () => {
it('matches when resource.name === configNode.name (ids differ)', () => {
const matched = makeResource('r1', 'shared-name');
- const result = matchConfiguredNodeToResource(
- makeNode({ id: 'c1', name: 'shared-name' }),
- [matched, makeResource('r2', 'other')],
- );
+ const result = matchConfiguredNodeToResource(makeNode({ id: 'c1', name: 'shared-name' }), [
+ matched,
+ makeResource('r2', 'other'),
+ ]);
expect(result).toBe(matched);
});
@@ -357,38 +362,32 @@ describe('matchConfiguredNodeToResource', () => {
// configNode.name 'host.lan' and resource.name 'host' differ literally and
// by id, but both strip to 'host'.
const matched = makeResource('r1', 'host');
- const result = matchConfiguredNodeToResource(
- makeNode({ id: 'c1', name: 'host.lan' }),
- [matched],
- );
+ const result = matchConfiguredNodeToResource(makeNode({ id: 'c1', name: 'host.lan' }), [
+ matched,
+ ]);
expect(result).toBe(matched);
});
it('matches when resource.id contains configNode.name', () => {
// id 'prefix-sub-suffix' includes 'sub'; names differ; bases differ.
const matched = makeResource('prefix-sub-suffix', 'unrelated');
- const result = matchConfiguredNodeToResource(
- makeNode({ id: 'c1', name: 'sub' }),
- [matched],
- );
+ const result = matchConfiguredNodeToResource(makeNode({ id: 'c1', name: 'sub' }), [matched]);
expect(result).toBe(matched);
});
it('matches when configNode.name contains resource.name', () => {
// 'bigname'.includes('big'); id and name and bases all differ.
const matched = makeResource('r1', 'big');
- const result = matchConfiguredNodeToResource(
- makeNode({ id: 'c1', name: 'bigname' }),
- [matched],
- );
+ const result = matchConfiguredNodeToResource(makeNode({ id: 'c1', name: 'bigname' }), [
+ matched,
+ ]);
expect(result).toBe(matched);
});
it('returns undefined when no predicate matches', () => {
- const result = matchConfiguredNodeToResource(
- makeNode({ id: 'c1', name: 'zzz' }),
- [makeResource('r1', 'yyy')],
- );
+ const result = matchConfiguredNodeToResource(makeNode({ id: 'c1', name: 'zzz' }), [
+ makeResource('r1', 'yyy'),
+ ]);
expect(result).toBeUndefined();
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/nodeModalModel.branchcov0712.test.ts b/frontend-modern/src/components/Settings/__tests__/nodeModalModel.branchcov0712.test.ts
index b31cd0444a..8ecd293cb7 100644
--- a/frontend-modern/src/components/Settings/__tests__/nodeModalModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/nodeModalModel.branchcov0712.test.ts
@@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest';
import type { ClusterEndpoint } from '@/types/nodes';
-import {
- buildClusterEndpointOverridesPayload,
- deriveNameFromHost,
-} from '../nodeModalModel';
+import { buildClusterEndpointOverridesPayload, deriveNameFromHost } from '../nodeModalModel';
// Same fixture builder shape as the sibling nodeModalModel.test.ts suite so the
// private comparison/trim branches under test are driven through the single
@@ -120,9 +117,9 @@ describe('buildClusterEndpointOverridesPayload', () => {
it('includes multiple changed members in order and skips an unchanged middle member', () => {
const endpoints = [
- endpoint('pve1'), // no saved override -> '' !== '10.0.0.11' -> changed
- endpoint('pve2', '10.0.0.2'), // '10.0.0.2' === '10.0.0.2' -> unchanged (skipped)
- endpoint('pve3', '10.0.0.3'), // '10.0.0.33' !== '10.0.0.3' -> changed
+ endpoint('pve1'), // no saved override -> '' !== '10.0.0.11' -> changed
+ endpoint('pve2', '10.0.0.2'), // '10.0.0.2' === '10.0.0.2' -> unchanged (skipped)
+ endpoint('pve3', '10.0.0.3'), // '10.0.0.33' !== '10.0.0.3' -> changed
];
const payload = buildClusterEndpointOverridesPayload(endpoints, {
pve1: '10.0.0.11',
diff --git a/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts b/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts
index d88be9e46f..8952e2d4a9 100644
--- a/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts
@@ -8,7 +8,9 @@ import {
describe('reporting inventory export model', () => {
it('builds a VM inventory export filename', () => {
const now = new Date('2026-03-20T12:34:56.000Z');
- expect(buildVMInventoryExportFilename(now, 'csv', 'vm-inventory', 'utc_yyyymmdd')).toBe('vm-inventory-20260320.csv');
+ expect(buildVMInventoryExportFilename(now, 'csv', 'vm-inventory', 'utc_yyyymmdd')).toBe(
+ 'vm-inventory-20260320.csv',
+ );
});
it('builds the canonical VM inventory export request', () => {
diff --git a/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts b/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts
index c25f9ef452..710efdd555 100644
--- a/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts
@@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest';
import type { SelectedResource } from '../ResourcePicker';
-import {
- buildReportingRequest,
- getReportingRangeStart,
-} from '../reportingPanelModel';
+import { buildReportingRequest, getReportingRangeStart } from '../reportingPanelModel';
import type { ReportingPerformanceReportDefinition } from '../reportingCatalogModel';
import {
buildReportSchedulePayload,
@@ -64,15 +61,18 @@ describe('reporting panel model', () => {
},
];
- const request = buildReportingRequest({
- end: now.toISOString(),
- format: 'pdf',
- metricType: 'cpu',
- now,
- resources,
- start: '2026-03-19T12:34:56.000Z',
- title: '',
- }, performanceDefinition);
+ const request = buildReportingRequest(
+ {
+ end: now.toISOString(),
+ format: 'pdf',
+ metricType: 'cpu',
+ now,
+ resources,
+ start: '2026-03-19T12:34:56.000Z',
+ title: '',
+ },
+ performanceDefinition,
+ );
expect(request.filename).toBe('report-agent-1-20260320.pdf');
expect(request.request.init).toBeUndefined();
@@ -98,15 +98,18 @@ describe('reporting panel model', () => {
},
];
- const request = buildReportingRequest({
- end: now.toISOString(),
- format: 'csv',
- metricType: '',
- now,
- resources,
- start: '2026-03-19T12:34:56.000Z',
- title: '',
- }, performanceDefinition);
+ const request = buildReportingRequest(
+ {
+ end: now.toISOString(),
+ format: 'csv',
+ metricType: '',
+ now,
+ resources,
+ start: '2026-03-19T12:34:56.000Z',
+ title: '',
+ },
+ performanceDefinition,
+ );
expect(request.filename).toBe('fleet-report-20260320.csv');
expect(request.request.url).toBe('/api/admin/reports/generate-multi');
@@ -170,15 +173,18 @@ describe('reporting panel model', () => {
},
];
- const request = buildReportingRequest({
- end: now.toISOString(),
- format: 'pdf',
- metricType: '',
- now,
- resources,
- start: '2026-03-19T12:34:56.000Z',
- title: 'Custom report title',
- }, performanceDefinition);
+ const request = buildReportingRequest(
+ {
+ end: now.toISOString(),
+ format: 'pdf',
+ metricType: '',
+ now,
+ resources,
+ start: '2026-03-19T12:34:56.000Z',
+ title: 'Custom report title',
+ },
+ performanceDefinition,
+ );
expect(request.request.url).toContain('title=Custom+report+title');
});
@@ -254,15 +260,18 @@ describe('reporting panel model', () => {
},
];
- const request = buildReportingRequest({
- end: now.toISOString(),
- format: 'pdf',
- metricType: '',
- now,
- resources,
- start: '2026-03-19T12:34:56.000Z',
- title: '',
- }, performanceDefinition);
+ const request = buildReportingRequest(
+ {
+ end: now.toISOString(),
+ format: 'pdf',
+ metricType: '',
+ now,
+ resources,
+ start: '2026-03-19T12:34:56.000Z',
+ title: '',
+ },
+ performanceDefinition,
+ );
expect(request.filename).toBe('report-lab-node-quotedvm-20260320.pdf');
});
diff --git a/frontend-modern/src/components/Settings/__tests__/reportingSchedulesModel.branchcov2.test.ts b/frontend-modern/src/components/Settings/__tests__/reportingSchedulesModel.branchcov2.test.ts
index 8d24ee2ff6..5bd81037f7 100644
--- a/frontend-modern/src/components/Settings/__tests__/reportingSchedulesModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/reportingSchedulesModel.branchcov2.test.ts
@@ -130,15 +130,30 @@ describe('normalizeReportSchedule', () => {
it('passes through fully-populated truthy values unchanged on the happy path', () => {
const schedule = makeSchedule({
enabled: true,
- cadence: { type: 'weekly', day_of_month: 20, weekday: 'friday', time: '17:30', timezone: 'Europe/Paris' },
- scope: { resources: [{ resourceType: 'vm', resourceId: 'v1', name: 'web' }], tags: ['tier1'] },
+ cadence: {
+ type: 'weekly',
+ day_of_month: 20,
+ weekday: 'friday',
+ time: '17:30',
+ timezone: 'Europe/Paris',
+ },
+ scope: {
+ resources: [{ resourceType: 'vm', resourceId: 'v1', name: 'web' }],
+ tags: ['tier1'],
+ },
format: 'csv',
delivery: { method: 'disk', to: ['ops@x'], attach: true, save_to_disk: true },
retention_count: 7,
});
expect(normalizeReportSchedule(schedule)).toMatchObject({
enabled: true,
- cadence: { type: 'weekly', day_of_month: 20, weekday: 'friday', time: '17:30', timezone: 'Europe/Paris' },
+ cadence: {
+ type: 'weekly',
+ day_of_month: 20,
+ weekday: 'friday',
+ time: '17:30',
+ timezone: 'Europe/Paris',
+ },
format: 'csv',
delivery: { method: 'disk', to: ['ops@x'], attach: true, save_to_disk: true },
retention_count: 7,
@@ -155,8 +170,11 @@ describe('normalizeReportSchedule', () => {
it('keeps day_of_month of 0 (nullish coalescing does not default on falsy numbers)', () => {
expect(
- normalizeReportSchedule(makeSchedule({ cadence: { type: 'monthly', day_of_month: 0, time: '09:00', timezone: 'UTC' } })).cadence
- .day_of_month,
+ normalizeReportSchedule(
+ makeSchedule({
+ cadence: { type: 'monthly', day_of_month: 0, time: '09:00', timezone: 'UTC' },
+ }),
+ ).cadence.day_of_month,
).toBe(0);
});
@@ -180,14 +198,26 @@ describe('normalizeReportSchedule', () => {
it('classifies an unknown cadence type as monthly', () => {
const schedule = makeSchedule({
- cadence: { type: 'daily' as unknown as 'monthly', day_of_month: 3, time: '08:00', timezone: 'UTC' },
+ cadence: {
+ type: 'daily' as unknown as 'monthly',
+ day_of_month: 3,
+ time: '08:00',
+ timezone: 'UTC',
+ },
});
expect(normalizeReportSchedule(schedule).cadence.type).toBe('monthly');
});
it('defaults weekday/time/timezone via || when they are empty strings', () => {
const schedule = makeSchedule({
- cadence: { type: 'monthly', day_of_month: 1, weekday: '', time: '', timezone: '', day_of_month_ignored: true } as unknown as ReportSchedule['cadence'],
+ cadence: {
+ type: 'monthly',
+ day_of_month: 1,
+ weekday: '',
+ time: '',
+ timezone: '',
+ day_of_month_ignored: true,
+ } as unknown as ReportSchedule['cadence'],
});
expect(normalizeReportSchedule(schedule).cadence).toMatchObject({
weekday: 'monday',
@@ -198,13 +228,17 @@ describe('normalizeReportSchedule', () => {
it('keeps scope arrays when they are arrays, and replaces them when not', () => {
const kept = normalizeReportSchedule(
- makeSchedule({ scope: { resources: [{ resourceType: 'vm', resourceId: 'v1' }], tags: ['a'] } }),
+ makeSchedule({
+ scope: { resources: [{ resourceType: 'vm', resourceId: 'v1' }], tags: ['a'] },
+ }),
);
expect(kept.scope.resources).toHaveLength(1);
expect(kept.scope.tags).toEqual(['a']);
const replaced = normalizeReportSchedule(
- makeSchedule({ scope: { resources: null as unknown as [], tags: 'nope' as unknown as string[] } }),
+ makeSchedule({
+ scope: { resources: null as unknown as [], tags: 'nope' as unknown as string[] },
+ }),
);
expect(replaced.scope.resources).toStrictEqual([]);
expect(replaced.scope.tags).toStrictEqual([]);
@@ -218,12 +252,20 @@ describe('normalizeReportSchedule', () => {
});
it('classifies delivery method as disk only for disk, email otherwise', () => {
- expect(normalizeReportSchedule(makeSchedule({ delivery: { method: 'disk', attach: true, save_to_disk: true } })).delivery.method).toBe(
- 'disk',
- );
expect(
normalizeReportSchedule(
- makeSchedule({ delivery: { method: 'carrier-pigeon' as unknown as 'email', attach: true, save_to_disk: true } }),
+ makeSchedule({ delivery: { method: 'disk', attach: true, save_to_disk: true } }),
+ ).delivery.method,
+ ).toBe('disk');
+ expect(
+ normalizeReportSchedule(
+ makeSchedule({
+ delivery: {
+ method: 'carrier-pigeon' as unknown as 'email',
+ attach: true,
+ save_to_disk: true,
+ },
+ }),
).delivery.method,
).toBe('email');
});
@@ -231,11 +273,22 @@ describe('normalizeReportSchedule', () => {
it('defaults delivery.to to [] when missing and keeps it when an array', () => {
expect(
normalizeReportSchedule(
- makeSchedule({ delivery: { method: 'email', to: undefined as unknown as string[], attach: true, save_to_disk: true } }),
+ makeSchedule({
+ delivery: {
+ method: 'email',
+ to: undefined as unknown as string[],
+ attach: true,
+ save_to_disk: true,
+ },
+ }),
).delivery.to,
).toStrictEqual([]);
expect(
- normalizeReportSchedule(makeSchedule({ delivery: { method: 'email', to: ['a@b'], attach: true, save_to_disk: true } })).delivery.to,
+ normalizeReportSchedule(
+ makeSchedule({
+ delivery: { method: 'email', to: ['a@b'], attach: true, save_to_disk: true },
+ }),
+ ).delivery.to,
).toEqual(['a@b']);
});
@@ -247,7 +300,13 @@ describe('normalizeReportSchedule', () => {
expect(allFalse.delivery.save_to_disk).toBe(false);
const defaults = normalizeReportSchedule(
- makeSchedule({ delivery: { method: 'email', attach: undefined as unknown as boolean, save_to_disk: undefined as unknown as boolean } }),
+ makeSchedule({
+ delivery: {
+ method: 'email',
+ attach: undefined as unknown as boolean,
+ save_to_disk: undefined as unknown as boolean,
+ },
+ }),
);
expect(defaults.delivery.attach).toBe(true);
expect(defaults.delivery.save_to_disk).toBe(true);
@@ -356,15 +415,27 @@ describe('scheduleToSelectedResources', () => {
describe('buildReportSchedulePayload', () => {
it('emits day_of_month and omits weekday for a monthly form', () => {
- const payload = buildReportSchedulePayload(makeForm({ cadenceType: 'monthly', dayOfMonth: 12 }), [
- makeResource(),
- ]);
- expect(payload.cadence).toMatchObject({ type: 'monthly', day_of_month: 12, weekday: undefined });
+ const payload = buildReportSchedulePayload(
+ makeForm({ cadenceType: 'monthly', dayOfMonth: 12 }),
+ [makeResource()],
+ );
+ expect(payload.cadence).toMatchObject({
+ type: 'monthly',
+ day_of_month: 12,
+ weekday: undefined,
+ });
});
it('emits weekday and omits day_of_month for a weekly form', () => {
- const payload = buildReportSchedulePayload(makeForm({ cadenceType: 'weekly', weekday: 'wednesday' }), []);
- expect(payload.cadence).toMatchObject({ type: 'weekly', weekday: 'wednesday', day_of_month: undefined });
+ const payload = buildReportSchedulePayload(
+ makeForm({ cadenceType: 'weekly', weekday: 'wednesday' }),
+ [],
+ );
+ expect(payload.cadence).toMatchObject({
+ type: 'weekly',
+ weekday: 'wednesday',
+ day_of_month: undefined,
+ });
});
it('falls back to UTC when the timezone trims to empty', () => {
@@ -373,10 +444,9 @@ describe('buildReportSchedulePayload', () => {
});
it('trims the schedule name and maps resources into the scope', () => {
- const payload = buildReportSchedulePayload(
- makeForm({ name: ' trimmed ' }),
- [makeResource({ id: 'r1', type: 'agent', name: 'host' })],
- );
+ const payload = buildReportSchedulePayload(makeForm({ name: ' trimmed ' }), [
+ makeResource({ id: 'r1', type: 'agent', name: 'host' }),
+ ]);
expect(payload.name).toBe('trimmed');
expect(payload.scope.resources).toStrictEqual([
{ resourceType: 'agent', resourceId: 'r1', name: 'host' },
@@ -394,11 +464,22 @@ describe('buildReportSchedulePayload', () => {
it('forwards format, delivery flags, and retention_count verbatim', () => {
const payload = buildReportSchedulePayload(
- makeForm({ format: 'csv', deliveryMethod: 'disk', attach: false, saveToDisk: false, retentionCount: 3 }),
+ makeForm({
+ format: 'csv',
+ deliveryMethod: 'disk',
+ attach: false,
+ saveToDisk: false,
+ retentionCount: 3,
+ }),
[],
);
expect(payload.format).toBe('csv');
- expect(payload.delivery).toStrictEqual({ method: 'disk', to: [], attach: false, save_to_disk: false });
+ expect(payload.delivery).toStrictEqual({
+ method: 'disk',
+ to: [],
+ attach: false,
+ save_to_disk: false,
+ });
expect(payload.retention_count).toBe(3);
});
});
@@ -519,14 +600,18 @@ describe('reportScheduleScopeLabel', () => {
describe('reportScheduleDeliveryLabel', () => {
it('returns "Save to disk" for the disk method', () => {
expect(
- reportScheduleDeliveryLabel(makeSchedule({ delivery: { method: 'disk', attach: true, save_to_disk: true } })),
+ reportScheduleDeliveryLabel(
+ makeSchedule({ delivery: { method: 'disk', attach: true, save_to_disk: true } }),
+ ),
).toBe('Save to disk');
});
it('renders the singular recipient form for one email recipient', () => {
expect(
reportScheduleDeliveryLabel(
- makeSchedule({ delivery: { method: 'email', to: ['ops@x'], attach: true, save_to_disk: true } }),
+ makeSchedule({
+ delivery: { method: 'email', to: ['ops@x'], attach: true, save_to_disk: true },
+ }),
),
).toBe('1 email recipient');
});
@@ -534,7 +619,9 @@ describe('reportScheduleDeliveryLabel', () => {
it('renders the plural recipient form for multiple email recipients', () => {
expect(
reportScheduleDeliveryLabel(
- makeSchedule({ delivery: { method: 'email', to: ['a@x', 'b@x'], attach: true, save_to_disk: true } }),
+ makeSchedule({
+ delivery: { method: 'email', to: ['a@x', 'b@x'], attach: true, save_to_disk: true },
+ }),
),
).toBe('2 email recipients');
});
@@ -567,7 +654,9 @@ describe('reportScheduleLastRunLabel', () => {
it('surfaces last_error for a failed run', () => {
expect(
- reportScheduleLastRunLabel(makeSchedule({ last_run_status: 'failed', last_error: 'timeout' })),
+ reportScheduleLastRunLabel(
+ makeSchedule({ last_run_status: 'failed', last_error: 'timeout' }),
+ ),
).toBe('Failed: timeout');
});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0712c.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0712c.test.ts
index c314643c42..1bb69e9078 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0712c.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0712c.test.ts
@@ -16,9 +16,7 @@ const hasFeatures =
// `tabFeatureRequirements`. Driving every entry guarantees the
// `tabFeatureRequirements[tab]` lookup -> defined-array arm is exercised for
// each key, not just a representative sample.
-const allGatedTabs = Object.entries(tabFeatureRequirements) as Array<
- [SettingsTab, string[]]
->;
+const allGatedTabs = Object.entries(tabFeatureRequirements) as Array<[SettingsTab, string[]]>;
// A spread of real catalog tabs that are intentionally ABSENT from
// `tabFeatureRequirements`; each must resolve to `undefined` on lookup and
@@ -182,6 +180,12 @@ describe('isTabLocked - defensive behavior for out-of-map tabs', () => {
const unknownTab = 'totally-not-a-real-tab' as unknown as SettingsTab;
expect(isTabLocked(unknownTab, hasFeatures([]), () => true)).toBe(false);
// Also confirm the runtime-unloaded path is equally safe.
- expect(isTabLocked(unknownTab, () => true, () => false)).toBe(false);
+ expect(
+ isTabLocked(
+ unknownTab,
+ () => true,
+ () => false,
+ ),
+ ).toBe(false);
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0713.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0713.test.ts
index e6e1c955f0..f424d9f910 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0713.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsFeatureGates.branchcov0713.test.ts
@@ -16,7 +16,12 @@
import { describe, expect, it } from 'vitest';
import type { SettingsTab } from '../settingsNavigationModel';
-import { getTabLockReason, isFeatureLocked, isTabLocked, tabFeatureRequirements } from '../settingsFeatureGates';
+import {
+ getTabLockReason,
+ isFeatureLocked,
+ isTabLocked,
+ tabFeatureRequirements,
+} from '../settingsFeatureGates';
// ---- Helpers ---------------------------------------------------------------
// Mirrors the `hasFeatures` factory used by the sibling branchcov0712c test so
@@ -31,9 +36,7 @@ const hasFeatures =
// `tabFeatureRequirements`. Driving every entry guarantees the
// `tabFeatureRequirements[tab]` lookup -> defined-array arm is exercised for
// each key, not just a representative sample.
-const allGatedTabs = Object.entries(tabFeatureRequirements) as Array<
- [SettingsTab, string[]]
->;
+const allGatedTabs = Object.entries(tabFeatureRequirements) as Array<[SettingsTab, string[]]>;
/**
* Wraps `hasFeatures` with a call-sink so tests can assert guard ORDERING —
@@ -71,7 +74,13 @@ const EXPECTED_LOCK_REASON: Partial<Record<SettingsTab, string>> = {
describe('isFeatureLocked - direct branch coverage', () => {
// Guard 1, `!features` arm: `features` is `undefined`.
it('returns false when features is undefined (first guard: !features)', () => {
- expect(isFeatureLocked(undefined, () => false, () => true)).toBe(false);
+ expect(
+ isFeatureLocked(
+ undefined,
+ () => false,
+ () => true,
+ ),
+ ).toBe(false);
});
// Guard 1, `!features` arm: deliberately-malformed `null` input violates the
@@ -79,33 +88,55 @@ describe('isFeatureLocked - direct branch coverage', () => {
// mode clean. `!null` is true so the function must short-circuit to false.
it('returns false when features is null (cast; !features covers nullish)', () => {
const features = null as unknown as Parameters<typeof isFeatureLocked>[0];
- expect(isFeatureLocked(features, () => false, () => true)).toBe(false);
+ expect(
+ isFeatureLocked(
+ features,
+ () => false,
+ () => true,
+ ),
+ ).toBe(false);
});
// Guard 1, `features.length === 0` arm.
it('returns false when features is an empty array (length === 0 arm)', () => {
- expect(isFeatureLocked([], () => false, () => true)).toBe(false);
+ expect(
+ isFeatureLocked(
+ [],
+ () => false,
+ () => true,
+ ),
+ ).toBe(false);
});
// Guard 2, `!runtimeCapabilitiesLoaded()` arm: populated features but the
// license/capability state has not resolved yet -> must not lock.
it('returns false when features are present but runtime is not loaded', () => {
- expect(isFeatureLocked(['relay'], () => false, () => false)).toBe(false);
+ expect(
+ isFeatureLocked(
+ ['relay'],
+ () => false,
+ () => false,
+ ),
+ ).toBe(false);
});
// Guard 3, `every()` -> true arm: `!true === false` (unlocked).
it('returns false when every required feature is held and runtime is loaded', () => {
expect(
- isFeatureLocked(['relay', 'multi_tenant'], hasFeatures(['relay', 'multi_tenant']), () => true),
+ isFeatureLocked(
+ ['relay', 'multi_tenant'],
+ hasFeatures(['relay', 'multi_tenant']),
+ () => true,
+ ),
).toBe(false);
});
// Guard 3, `every()` -> false arm: `!false === true` (LOCKED). This is the
// only branch that returns true.
it('returns true when the first required feature is missing (every -> false)', () => {
- expect(isFeatureLocked(['relay', 'multi_tenant'], hasFeatures(['multi_tenant']), () => true)).toBe(
- true,
- );
+ expect(
+ isFeatureLocked(['relay', 'multi_tenant'], hasFeatures(['multi_tenant']), () => true),
+ ).toBe(true);
});
it('returns true when only the first of several required features is held', () => {
@@ -184,17 +215,15 @@ describe('isTabLocked - predicate short-circuit (complements branchcov0712c)', (
describe('getTabLockReason - branch coverage', () => {
// Guard 1: tab NOT present in tabFeatureRequirements -> `undefined` -> null.
- it.each(
- [
- 'infrastructure-systems',
- 'system-general',
- 'system-network',
- 'api',
- 'support-diagnostics',
- 'security-overview',
- 'security-audit',
- ] as SettingsTab[],
- )('returns null for non-gated tab %s (lookup -> undefined)', (tab) => {
+ it.each([
+ 'infrastructure-systems',
+ 'system-general',
+ 'system-network',
+ 'api',
+ 'support-diagnostics',
+ 'security-overview',
+ 'security-audit',
+ ] as SettingsTab[])('returns null for non-gated tab %s (lookup -> undefined)', (tab) => {
expect(getTabLockReason(tab, hasFeatures([]), () => true)).toBeNull();
});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov0713.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov0713.test.ts
index a77cfb29ca..75bb4d5b64 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov0713.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsNavVisibility.branchcov0713.test.ts
@@ -75,9 +75,7 @@ vi.mock('../settingsFeatureGates', async (importActual) => {
hasFeature: Parameters<typeof actual.isTabLocked>[1],
runtimeCapabilitiesLoaded: Parameters<typeof actual.isTabLocked>[2],
): boolean =>
- tab === LOCKED_TAB
- ? true
- : actual.isTabLocked(tab, hasFeature, runtimeCapabilitiesLoaded),
+ tab === LOCKED_TAB ? true : actual.isTabLocked(tab, hasFeature, runtimeCapabilitiesLoaded),
};
});
@@ -164,7 +162,10 @@ describe('shouldBlockSettingsRouteItem - hideWhenCommercialHidden unresolved arm
// system-billing carries only hideWhenCommercialHidden, so an unresolved
// policy engages this gate before any feature/capability gate is consulted.
expect(
- shouldBlockSettingsRouteItem('system-billing', createContext({ presentationPolicyResolved: false })),
+ shouldBlockSettingsRouteItem(
+ 'system-billing',
+ createContext({ presentationPolicyResolved: false }),
+ ),
).toBe(true);
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsNavigationModel.branchcov.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsNavigationModel.branchcov.test.ts
index f16e7781cb..f26341c130 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsNavigationModel.branchcov.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsNavigationModel.branchcov.test.ts
@@ -184,7 +184,9 @@ describe('normalizeSettingsPath (exercised via resolveCanonicalSettingsPath)', (
});
it("defends against a null runtime input by treating it as '' (the `path || ''` arm)", () => {
- expect(resolveCanonicalSettingsPath(null as unknown as string)).toBe('/settings/infrastructure');
+ expect(resolveCanonicalSettingsPath(null as unknown as string)).toBe(
+ '/settings/infrastructure',
+ );
});
it("defends against an undefined runtime input by treating it as '' (the `path || ''` arm)", () => {
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsPanelRegistryContext.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsPanelRegistryContext.test.ts
index 6e68023ae0..a7f51251cf 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsPanelRegistryContext.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsPanelRegistryContext.test.ts
@@ -11,14 +11,12 @@ const noopSetter: Setter<boolean> = () => false;
const systemPanels: SettingsSystemPanels = {
systemGeneralPanel: () => null,
- getNetworkPanelProps: () => ({} as ReturnType<SettingsSystemPanels['getNetworkPanelProps']>),
- getRecoveryPanelProps: () => ({} as ReturnType<SettingsSystemPanels['getRecoveryPanelProps']>),
- getUpdatesPanelProps: () => ({} as ReturnType<SettingsSystemPanels['getUpdatesPanelProps']>),
+ getNetworkPanelProps: () => ({}) as ReturnType<SettingsSystemPanels['getNetworkPanelProps']>,
+ getRecoveryPanelProps: () => ({}) as ReturnType<SettingsSystemPanels['getRecoveryPanelProps']>,
+ getUpdatesPanelProps: () => ({}) as ReturnType<SettingsSystemPanels['getUpdatesPanelProps']>,
};
-function buildParams(
- securityStatus: SecurityStatus | null,
-): UseSettingsPanelRegistryParams {
+function buildParams(securityStatus: SecurityStatus | null): UseSettingsPanelRegistryParams {
return {
securityStatus: () => securityStatus,
securityStatusLoading: () => false,
@@ -37,73 +35,89 @@ function buildParams(
handleHideLocalLoginChange: vi.fn(async () => undefined),
versionInfo: () => null,
getInfrastructurePanelProps: () =>
- ({} as ReturnType<UseSettingsPanelRegistryParams['getInfrastructurePanelProps']>),
+ ({}) as ReturnType<UseSettingsPanelRegistryParams['getInfrastructurePanelProps']>,
systemPanels,
};
}
describe('buildSettingsPanelRegistryContext', () => {
it('passes the effective current user into organization panels', () => {
- const context = buildSettingsPanelRegistryContext(buildParams({
- hasAuthentication: true,
- apiTokenConfigured: false,
- apiTokenHint: '',
- requiresAuth: true,
- credentialsEncrypted: true,
- exportProtected: true,
- hasAuditLogging: false,
- configuredButPendingRestart: false,
- authUsername: 'local-admin',
- ssoSessionUsername: 'sso-admin',
- proxyAuthUsername: 'proxy-admin',
- }));
+ const context = buildSettingsPanelRegistryContext(
+ buildParams({
+ hasAuthentication: true,
+ apiTokenConfigured: false,
+ apiTokenHint: '',
+ requiresAuth: true,
+ credentialsEncrypted: true,
+ exportProtected: true,
+ hasAuditLogging: false,
+ configuredButPendingRestart: false,
+ authUsername: 'local-admin',
+ ssoSessionUsername: 'sso-admin',
+ proxyAuthUsername: 'proxy-admin',
+ }),
+ );
- expect(context.getOrganizationOverviewPanelProps()).toMatchObject({ currentUser: 'proxy-admin' });
+ expect(context.getOrganizationOverviewPanelProps()).toMatchObject({
+ currentUser: 'proxy-admin',
+ });
expect(context.getOrganizationAccessPanelProps()).toMatchObject({ currentUser: 'proxy-admin' });
- expect(context.getOrganizationSharingPanelProps()).toMatchObject({ currentUser: 'proxy-admin' });
+ expect(context.getOrganizationSharingPanelProps()).toMatchObject({
+ currentUser: 'proxy-admin',
+ });
});
it('falls back from proxy auth to sso session to local auth username', () => {
- const ssoContext = buildSettingsPanelRegistryContext(buildParams({
- hasAuthentication: true,
- apiTokenConfigured: false,
- apiTokenHint: '',
- requiresAuth: true,
- credentialsEncrypted: true,
- exportProtected: true,
- hasAuditLogging: false,
- configuredButPendingRestart: false,
- authUsername: 'local-admin',
- ssoSessionUsername: 'sso-admin',
- }));
+ const ssoContext = buildSettingsPanelRegistryContext(
+ buildParams({
+ hasAuthentication: true,
+ apiTokenConfigured: false,
+ apiTokenHint: '',
+ requiresAuth: true,
+ credentialsEncrypted: true,
+ exportProtected: true,
+ hasAuditLogging: false,
+ configuredButPendingRestart: false,
+ authUsername: 'local-admin',
+ ssoSessionUsername: 'sso-admin',
+ }),
+ );
- const localContext = buildSettingsPanelRegistryContext(buildParams({
- hasAuthentication: true,
- apiTokenConfigured: false,
- apiTokenHint: '',
- requiresAuth: true,
- credentialsEncrypted: true,
- exportProtected: true,
- hasAuditLogging: false,
- configuredButPendingRestart: false,
- authUsername: 'local-admin',
- }));
+ const localContext = buildSettingsPanelRegistryContext(
+ buildParams({
+ hasAuthentication: true,
+ apiTokenConfigured: false,
+ apiTokenHint: '',
+ requiresAuth: true,
+ credentialsEncrypted: true,
+ exportProtected: true,
+ hasAuditLogging: false,
+ configuredButPendingRestart: false,
+ authUsername: 'local-admin',
+ }),
+ );
- expect(ssoContext.getOrganizationSharingPanelProps()).toMatchObject({ currentUser: 'sso-admin' });
- expect(localContext.getOrganizationSharingPanelProps()).toMatchObject({ currentUser: 'local-admin' });
+ expect(ssoContext.getOrganizationSharingPanelProps()).toMatchObject({
+ currentUser: 'sso-admin',
+ });
+ expect(localContext.getOrganizationSharingPanelProps()).toMatchObject({
+ currentUser: 'local-admin',
+ });
});
it('leaves currentUser undefined when no authenticated username is available', () => {
- const context = buildSettingsPanelRegistryContext(buildParams({
- hasAuthentication: true,
- apiTokenConfigured: false,
- apiTokenHint: '',
- requiresAuth: true,
- credentialsEncrypted: true,
- exportProtected: true,
- hasAuditLogging: false,
- configuredButPendingRestart: false,
- }));
+ const context = buildSettingsPanelRegistryContext(
+ buildParams({
+ hasAuthentication: true,
+ apiTokenConfigured: false,
+ apiTokenHint: '',
+ requiresAuth: true,
+ credentialsEncrypted: true,
+ exportProtected: true,
+ hasAuditLogging: false,
+ configuredButPendingRestart: false,
+ }),
+ );
expect(context.getOrganizationOverviewPanelProps()).toMatchObject({ currentUser: undefined });
expect(context.getOrganizationAccessPanelProps()).toMatchObject({ currentUser: undefined });
diff --git a/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712.test.ts b/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712.test.ts
index 5cc3ff1360..dd6bdf24e9 100644
--- a/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712.test.ts
@@ -14,12 +14,7 @@ import {
buildUpdateInstallGuide,
getUpdateChannelCardOptions,
} from '../updatesSettingsModel';
-import type {
- DockerUpdateCommands,
- UpdateInfo,
- UpdatePlan,
- VersionInfo,
-} from '@/api/updates';
+import type { DockerUpdateCommands, UpdateInfo, UpdatePlan, VersionInfo } from '@/api/updates';
// ---- Fixtures ---------------------------------------------------------------
// Mirror the shapes used by the sibling UpdateInstallGuide.test.tsx so the two
@@ -47,9 +42,7 @@ const makeUpdatePlan = (overrides: Partial<UpdatePlanPick> = {}): UpdatePlanPick
const digest = 'sha256:' + 'ab'.repeat(32);
const pinnedRef = `registry.pulserelay.pro/pulse/pulse-pro@${digest}`;
-const makeDockerUpdate = (
- overrides: Partial<DockerUpdateCommands> = {},
-): DockerUpdateCommands => ({
+const makeDockerUpdate = (overrides: Partial<DockerUpdateCommands> = {}): DockerUpdateCommands => ({
version: 'v6.0.5',
image: 'registry.pulserelay.pro/pulse/pulse-pro',
imageDigest: digest,
@@ -163,7 +156,14 @@ describe('buildUpdateInstallGuide', () => {
it('returns null when versionInfo is undefined (!versionInfo guard)', () => {
expect(
- buildUpdateInstallGuide(undefined, makeUpdateInfo(), makeUpdatePlan(), 'v6.0.5', 'curl', false),
+ buildUpdateInstallGuide(
+ undefined,
+ makeUpdateInfo(),
+ makeUpdatePlan(),
+ 'v6.0.5',
+ 'curl',
+ false,
+ ),
).toBeNull();
});
@@ -434,8 +434,16 @@ describe('buildUpdateInstallGuide', () => {
headerSummary: 'Version v6.0.5 is ready to install',
introText: 'Follow these steps to update manually:',
steps: [
- { id: 'development-pull', title: 'Pull the latest changes', command: 'git pull origin main' },
- { id: 'development-build', title: 'Rebuild and restart', command: 'make build && make run' },
+ {
+ id: 'development-pull',
+ title: 'Pull the latest changes',
+ command: 'git pull origin main',
+ },
+ {
+ id: 'development-build',
+ title: 'Rebuild and restart',
+ command: 'make build && make run',
+ },
],
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712c.test.ts b/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712c.test.ts
index a5f198a3be..bb39fdc2ef 100644
--- a/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712c.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/updatesSettingsModel.branchcov0712c.test.ts
@@ -12,12 +12,7 @@
*/
import { describe, expect, it } from 'vitest';
import { buildUpdateInstallGuide } from '../updatesSettingsModel';
-import type {
- DockerUpdateCommands,
- UpdateInfo,
- UpdatePlan,
- VersionInfo,
-} from '@/api/updates';
+import type { DockerUpdateCommands, UpdateInfo, UpdatePlan, VersionInfo } from '@/api/updates';
// ---- Fixtures ---------------------------------------------------------------
// Mirror the shapes used by the sibling branchcov0712 file so the two stay
@@ -45,9 +40,7 @@ const makeUpdatePlan = (overrides: Partial<UpdatePlanPick> = {}): UpdatePlanPick
const digest = 'sha256:' + 'ab'.repeat(32);
const pinnedRef = `registry.pulserelay.pro/pulse/pulse-pro@${digest}`;
-const makeDockerUpdate = (
- overrides: Partial<DockerUpdateCommands> = {},
-): DockerUpdateCommands => ({
+const makeDockerUpdate = (overrides: Partial<DockerUpdateCommands> = {}): DockerUpdateCommands => ({
version: 'v6.0.5',
image: 'registry.pulserelay.pro/pulse/pulse-pro',
imageDigest: digest,
@@ -103,7 +96,9 @@ describe('buildUpdateInstallGuide — optional-chain short-circuit on nullish up
expect(guide?.introText).toBe('Follow these steps to update:');
expect(guide?.steps).toHaveLength(1);
expect(guide?.steps[0]?.id).toBe('docker-pro-unavailable');
- expect(guide?.steps[0]?.note).toContain('license server did not provide Docker update commands');
+ expect(guide?.steps[0]?.note).toContain(
+ 'license server did not provide Docker update commands',
+ );
});
});
@@ -222,10 +217,7 @@ describe('buildUpdateInstallGuide — headerSummary interpolation for nullish up
false,
);
expect(guide?.headerSummary).toBe('Version undefined is ready to install');
- expect(guide?.steps.map((s) => s.id)).toStrictEqual([
- 'development-pull',
- 'development-build',
- ]);
+ expect(guide?.steps.map((s) => s.id)).toStrictEqual(['development-pull', 'development-build']);
});
});
@@ -304,7 +296,8 @@ describe('buildUpdateInstallGuide — buildProDockerUpdateSteps loginCommand fal
});
it('includes the login note with the exact interpolated command when loginCommand is a non-empty custom string', () => {
- const customLogin = 'echo hunter2 | docker login registry.example.invalid -u ops --password-stdin';
+ const customLogin =
+ 'echo hunter2 | docker login registry.example.invalid -u ops --password-stdin';
const dockerUpdate = makeDockerUpdate({ loginCommand: customLogin });
const guide = buildUpdateInstallGuide(
makeVersionInfo({ deploymentType: 'docker', isDocker: true }),
diff --git a/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts b/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts
index f84622cf83..d66c8431f6 100644
--- a/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts
@@ -222,8 +222,7 @@ describe('useConnectionsLedger', () => {
address: 'pi',
};
let resolveReload:
- | ((value: { connections: Connection[]; systems: ConnectionSystem[] }) => void)
- | undefined;
+ ((value: { connections: Connection[]; systems: ConnectionSystem[] }) => void) | undefined;
vi.spyOn(ConnectionsAPI, 'list')
.mockResolvedValueOnce({ connections: [firstConnection], systems: [] })
.mockImplementationOnce(
diff --git a/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.ts b/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.ts
index 9fe59a7cd3..d6961c5799 100644
--- a/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.ts
@@ -81,7 +81,9 @@ function jsonResponse(payload: unknown, status = 200): Response {
return new Response(JSON.stringify(payload), { status });
}
-function buildCatalogAndSchedulesFetchMock(catalogResponse: Response = jsonResponse(catalogPayload)) {
+function buildCatalogAndSchedulesFetchMock(
+ catalogResponse: Response = jsonResponse(catalogPayload),
+) {
return vi.fn((url: string) => {
if (url === '/api/admin/reports/schedules') {
return Promise.resolve(jsonResponse(schedulesPayload));
@@ -309,7 +311,9 @@ describe('useReportingPanelState', () => {
await flushAsync();
await flushAsync();
- expect(apiFetchMock.mock.calls.filter(([url]) => url === '/api/admin/reports/catalog')).toHaveLength(2);
+ expect(
+ apiFetchMock.mock.calls.filter(([url]) => url === '/api/admin/reports/catalog'),
+ ).toHaveLength(2);
expect(hookState.reportingCatalog()?.title).toBe('Detailed Reporting');
expect(hookState.reportSchedules()).toEqual([]);
diff --git a/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsx b/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsx
index f9893b4fea..fec47d7b2c 100644
--- a/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/useSettingsAccess.test.tsx
@@ -119,9 +119,7 @@ describe('useSettingsAccess', () => {
it('keeps direct feature-gated routes active when the panel owns the locked state', async () => {
const setActiveTabSpy = vi.fn();
hasFeatureMock.mockReturnValue(false);
- shouldHideSettingsNavItemMock.mockImplementation(
- (tab: string) => tab === 'support-reporting',
- );
+ shouldHideSettingsNavItemMock.mockImplementation((tab: string) => tab === 'support-reporting');
shouldBlockSettingsRouteItemMock.mockReturnValue(false);
renderHarness(setActiveTabSpy, 'support-reporting');
diff --git a/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.ts b/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.ts
index 0b49bc78dc..8c565a7d5c 100644
--- a/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/useSystemSettingsState.test.ts
@@ -202,9 +202,9 @@ describe('useSystemSettingsState', () => {
},
}));
- vi.doMock('@/stores/systemSettings', () => ({
- updateDockerUpdateActionsSetting: vi.fn(),
- }));
+ vi.doMock('@/stores/systemSettings', () => ({
+ updateDockerUpdateActionsSetting: vi.fn(),
+ }));
({ useSystemSettingsState } = await import('../useSystemSettingsState'));
});
diff --git a/frontend-modern/src/components/Settings/__tests__/vmwareConnectionFailurePresentation.branchcov0712.test.ts b/frontend-modern/src/components/Settings/__tests__/vmwareConnectionFailurePresentation.branchcov0712.test.ts
index 5d6e0340ac..3c6ee289ee 100644
--- a/frontend-modern/src/components/Settings/__tests__/vmwareConnectionFailurePresentation.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/vmwareConnectionFailurePresentation.branchcov0712.test.ts
@@ -258,8 +258,7 @@ describe('buildVMwareConnectionFailurePresentation — final-return default* coa
expect(out).toStrictEqual({
code: 'CODE_Y',
category: 'mystery',
- guidance:
- 'Review the vCenter endpoint and credentials, then retry the connection test.',
+ guidance: 'Review the vCenter endpoint and credentials, then retry the connection test.',
message: 'Fallback message',
title: 'VMware connection test failed',
tone: 'danger',
diff --git a/frontend-modern/src/components/Settings/apiTokenManagerModel.ts b/frontend-modern/src/components/Settings/apiTokenManagerModel.ts
index a5610d1b15..ca46e71685 100644
--- a/frontend-modern/src/components/Settings/apiTokenManagerModel.ts
+++ b/frontend-modern/src/components/Settings/apiTokenManagerModel.ts
@@ -82,8 +82,7 @@ export const getAPITokenScopePresets = (
id: API_TOKEN_PULSE_INTELLIGENCE_AGENT_PRESET_ID,
label: API_TOKEN_PATROL_EXTERNAL_AGENT_PRESET_LABEL,
scopes: pulseIntelligenceScopes,
- description:
- 'Scopes for connected agents that read Pulse context and request Patrol work.',
+ description: 'Scopes for connected agents that read Pulse context and request Patrol work.',
});
}
diff --git a/frontend-modern/src/components/Settings/connectionsTableModel.ts b/frontend-modern/src/components/Settings/connectionsTableModel.ts
index 2fdb38f5cd..852eae64b6 100644
--- a/frontend-modern/src/components/Settings/connectionsTableModel.ts
+++ b/frontend-modern/src/components/Settings/connectionsTableModel.ts
@@ -751,8 +751,7 @@ const moduleHealthSignal = (connection: Connection): FleetGovernanceSignal | und
key: 'module-health',
label: `${displayName} module ${module.state}`,
detail:
- module.lastError ||
- `${displayName} monitoring is enabled but the module is not running yet.`,
+ module.lastError || `${displayName} monitoring is enabled but the module is not running yet.`,
tone: 'warning',
};
};
diff --git a/frontend-modern/src/components/Settings/infrastructureSettingsModel.ts b/frontend-modern/src/components/Settings/infrastructureSettingsModel.ts
index a01a8952ac..ba49683b5e 100644
--- a/frontend-modern/src/components/Settings/infrastructureSettingsModel.ts
+++ b/frontend-modern/src/components/Settings/infrastructureSettingsModel.ts
@@ -166,7 +166,11 @@ export const collectRepresentedDiscoveryHosts = (
const representedHosts = createRepresentedDiscoveryHosts();
nodes.forEach((node) => {
- addRepresentedDiscoveryHosts(representedHosts, node.type, [node.name, node.host, node.guestURL]);
+ addRepresentedDiscoveryHosts(representedHosts, node.type, [
+ node.name,
+ node.host,
+ node.guestURL,
+ ]);
if (node.type === 'pve' && 'clusterEndpoints' in node) {
addClusterEndpointHosts(representedHosts, node.type, node.clusterEndpoints);
}
diff --git a/frontend-modern/src/components/Settings/nodeModalModel.ts b/frontend-modern/src/components/Settings/nodeModalModel.ts
index 74a6e81a5b..d84a945a19 100644
--- a/frontend-modern/src/components/Settings/nodeModalModel.ts
+++ b/frontend-modern/src/components/Settings/nodeModalModel.ts
@@ -1,8 +1,4 @@
-import type {
- ClusterEndpoint,
- ClusterEndpointOverridePayload,
- NodeConfig,
-} from '@/types/nodes';
+import type { ClusterEndpoint, ClusterEndpointOverridePayload, NodeConfig } from '@/types/nodes';
import type { SecurityStatus } from '@/types/config';
import type { NodeModalNodeType } from '@/utils/nodeModalPresentation';
diff --git a/frontend-modern/src/components/Settings/reportingCatalogModel.ts b/frontend-modern/src/components/Settings/reportingCatalogModel.ts
index 8303b0abe1..52749a55de 100644
--- a/frontend-modern/src/components/Settings/reportingCatalogModel.ts
+++ b/frontend-modern/src/components/Settings/reportingCatalogModel.ts
@@ -76,12 +76,14 @@ export function buildLegacyReportingCatalogFallback(): ReportingCatalog {
},
guidance: {
title: 'Advanced Insights',
- description: 'Older Pulse servers expose the legacy reporting transport directly. Performance reports remain available here, but newer catalog-driven reporting surfaces require a newer backend.',
+ description:
+ 'Older Pulse servers expose the legacy reporting transport directly. Performance reports remain available here, but newer catalog-driven reporting surfaces require a newer backend.',
},
performanceReport: {
id: 'performance_reports',
title: 'Performance Reports',
- description: 'Generate PDF summaries or CSV metric exports from historical monitoring data for one or more selected resources.',
+ description:
+ 'Generate PDF summaries or CSV metric exports from historical monitoring data for one or more selected resources.',
singleResourceEndpoint: '/api/reporting',
multiResourceEndpoint: '/api/reporting/generate-multi',
singleFilenamePrefix: 'report',
diff --git a/frontend-modern/src/components/Settings/reportingPanelModel.ts b/frontend-modern/src/components/Settings/reportingPanelModel.ts
index 01d8076273..fbaa61d26a 100644
--- a/frontend-modern/src/components/Settings/reportingPanelModel.ts
+++ b/frontend-modern/src/components/Settings/reportingPanelModel.ts
@@ -52,10 +52,7 @@ export function buildReportingFilename(
now: Date,
definition: Pick<
ReportingPerformanceReportDefinition,
- | 'filenameDateStyle'
- | 'multiFilenamePrefix'
- | 'singleFilenamePrefix'
- | 'singleFilenameSubject'
+ 'filenameDateStyle' | 'multiFilenamePrefix' | 'singleFilenamePrefix' | 'singleFilenameSubject'
>,
): string {
const date = formatReportingFilenameDate(now, definition.filenameDateStyle);
@@ -67,7 +64,10 @@ export function buildReportingFilename(
function sanitizeReportingFilenameSubject(
value: string,
- subject: Pick<ReportingPerformanceReportDefinition, 'singleFilenameSubject'>['singleFilenameSubject'],
+ subject: Pick<
+ ReportingPerformanceReportDefinition,
+ 'singleFilenameSubject'
+ >['singleFilenameSubject'],
): string {
switch (subject) {
case 'resource_id': {
diff --git a/frontend-modern/src/components/Settings/reportingSchedulesModel.ts b/frontend-modern/src/components/Settings/reportingSchedulesModel.ts
index b7d29a06ad..cf73e7b7ec 100644
--- a/frontend-modern/src/components/Settings/reportingSchedulesModel.ts
+++ b/frontend-modern/src/components/Settings/reportingSchedulesModel.ts
@@ -221,7 +221,8 @@ export function reportScheduleScopeLabel(schedule: ReportSchedule): string {
export function reportScheduleDeliveryLabel(schedule: ReportSchedule): string {
const normalized = normalizeReportSchedule(schedule);
if (normalized.delivery.method === 'disk') return 'Save to disk';
- if ((normalized.delivery.to ?? []).length > 0) return `${normalized.delivery.to!.length} email recipient${normalized.delivery.to!.length === 1 ? '' : 's'}`;
+ if ((normalized.delivery.to ?? []).length > 0)
+ return `${normalized.delivery.to!.length} email recipient${normalized.delivery.to!.length === 1 ? '' : 's'}`;
return 'Email config recipients';
}
@@ -235,5 +236,10 @@ export function formatReportScheduleTime(value?: string): string {
if (!value) return '';
const date = new Date(value);
if (Number.isNaN(date.getTime())) return '';
- return date.toLocaleString(undefined, { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
+ return date.toLocaleString(undefined, {
+ month: 'short',
+ day: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit',
+ });
}
diff --git a/frontend-modern/src/components/Settings/settingsRouting.ts b/frontend-modern/src/components/Settings/settingsRouting.ts
index 8e19926cb2..00f0396986 100644
--- a/frontend-modern/src/components/Settings/settingsRouting.ts
+++ b/frontend-modern/src/components/Settings/settingsRouting.ts
@@ -1,3 +1 @@
-export {
- settingsAgentNodeLabel,
-} from './settingsNavigationModel';
+export { settingsAgentNodeLabel } from './settingsNavigationModel';
diff --git a/frontend-modern/src/components/Settings/settingsTypes.ts b/frontend-modern/src/components/Settings/settingsTypes.ts
index 42eb1f6c57..b4506558fa 100644
--- a/frontend-modern/src/components/Settings/settingsTypes.ts
+++ b/frontend-modern/src/components/Settings/settingsTypes.ts
@@ -1,3 +1 @@
-export type {
- SettingsTab,
-} from './settingsNavigationModel';
+export type { SettingsTab } from './settingsNavigationModel';
diff --git a/frontend-modern/src/components/Settings/updatesSettingsModel.ts b/frontend-modern/src/components/Settings/updatesSettingsModel.ts
index 0d481904ae..3b974f8005 100644
--- a/frontend-modern/src/components/Settings/updatesSettingsModel.ts
+++ b/frontend-modern/src/components/Settings/updatesSettingsModel.ts
@@ -91,10 +91,7 @@ function buildProDockerUpdateSteps(dockerUpdate: DockerUpdateCommands): UpdateIn
}
export function buildUpdateInstallGuide(
- versionInfo: Pick<
- VersionInfo,
- 'deploymentType' | 'isDocker'
- > | null | undefined,
+ versionInfo: Pick<VersionInfo, 'deploymentType' | 'isDocker'> | null | undefined,
updateInfo: Pick<UpdateInfo, 'latestVersion' | 'dockerUpdate'> | null | undefined,
updatePlan: Pick<UpdatePlan, 'canAutoUpdate'> | null | undefined,
dockerImageTag: string,
@@ -126,7 +123,10 @@ export function buildUpdateInstallGuide(
};
}
- if (versionInfo.deploymentType === 'docker' || (!versionInfo.deploymentType && versionInfo.isDocker)) {
+ if (
+ versionInfo.deploymentType === 'docker' ||
+ (!versionInfo.deploymentType && versionInfo.isDocker)
+ ) {
// Pro runtime: only ever show the broker's digest-pinned commands. The
// community pull below would replace the container with the community
// build and silently strip Pro features.
@@ -196,8 +196,16 @@ export function buildUpdateInstallGuide(
headerSummary: `Version ${updateInfo?.latestVersion} is ready to install`,
introText,
steps: [
- { id: 'development-pull', title: 'Pull the latest changes', command: 'git pull origin main' },
- { id: 'development-build', title: 'Rebuild and restart', command: 'make build && make run' },
+ {
+ id: 'development-pull',
+ title: 'Pull the latest changes',
+ command: 'git pull origin main',
+ },
+ {
+ id: 'development-build',
+ title: 'Rebuild and restart',
+ command: 'make build && make run',
+ },
],
};
}
diff --git a/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts b/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts
index 8fd88374f4..d9a5640c4a 100644
--- a/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts
+++ b/frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts
@@ -35,10 +35,7 @@ import {
getPreferredNamedEntityLabel,
getPreferredResourceHostname,
} from '@/utils/resourceIdentity';
-import {
- getAgentStatusIndicator,
- isConnectedHealthStatus,
-} from '@/utils/status';
+import { getAgentStatusIndicator, isConnectedHealthStatus } from '@/utils/status';
const resourcePriority = (resource: Resource): number => {
switch (resource.type) {
diff --git a/frontend-modern/src/components/Settings/useBillingAdminPanelState.ts b/frontend-modern/src/components/Settings/useBillingAdminPanelState.ts
index 1d234611ee..bfd812a25c 100644
--- a/frontend-modern/src/components/Settings/useBillingAdminPanelState.ts
+++ b/frontend-modern/src/components/Settings/useBillingAdminPanelState.ts
@@ -8,12 +8,8 @@ import { isHostedModeEnabled, isMultiTenantEnabled } from '@/stores/license';
import { notificationStore } from '@/stores/notifications';
import { presentationPolicyHidesOrganizationSurfaces } from '@/stores/sessionPresentationPolicy';
import { logger } from '@/utils/logger';
-import {
- getBillingAdminStateUpdateSuccessMessage,
-} from '@/utils/licensePresentation';
-import {
- getOrganizationSettingsLoadErrorMessage as getOrganizationSettingsPanelLoadErrorMessage,
-} from '@/utils/organizationSettingsPresentation';
+import { getBillingAdminStateUpdateSuccessMessage } from '@/utils/licensePresentation';
+import { getOrganizationSettingsLoadErrorMessage as getOrganizationSettingsPanelLoadErrorMessage } from '@/utils/organizationSettingsPresentation';
export type BillingStateCache = Record<string, BillingState | undefined>;
diff --git a/frontend-modern/src/components/Settings/useConnectionsLedger.ts b/frontend-modern/src/components/Settings/useConnectionsLedger.ts
index 57789e036e..979753ee21 100644
--- a/frontend-modern/src/components/Settings/useConnectionsLedger.ts
+++ b/frontend-modern/src/components/Settings/useConnectionsLedger.ts
@@ -592,9 +592,7 @@ export const useConnectionsLedger = (): ConnectionsLedger => {
...(primary?.hostAliases ?? []),
];
if (
- candidates.some(
- (value) => value && clusterMemberHosts.has(value.trim().toLowerCase()),
- )
+ candidates.some((value) => value && clusterMemberHosts.has(value.trim().toLowerCase()))
) {
return null;
}
diff --git a/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts b/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts
index 421a896060..0de5895585 100644
--- a/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts
+++ b/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts
@@ -12,10 +12,7 @@ import type {
} from '@/types/nodes';
import { settingsAgentNodeLabel } from './settingsRouting';
import { applyClusterEndpointOverridesLocally } from './nodeModalModel';
-import {
- matchConfiguredNodeToResource,
- type NodeType,
-} from './infrastructureSettingsModel';
+import { matchConfiguredNodeToResource, type NodeType } from './infrastructureSettingsModel';
import {
getNodeDeleteErrorMessage,
getNodeTemperatureMonitoringUpdateErrorMessage,
diff --git a/frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts b/frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts
index a4691d886e..da7697360f 100644
--- a/frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts
+++ b/frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts
@@ -243,11 +243,15 @@ export const useInfrastructureDiscoveryRuntimeState = ({
}
const responseTimestamp = normalizeDiscoveryTimestamp(
data && typeof data === 'object'
- ? (data as { timestamp?: unknown; updated?: unknown }).timestamp ??
- (data as { timestamp?: unknown; updated?: unknown }).updated
+ ? ((data as { timestamp?: unknown; updated?: unknown }).timestamp ??
+ (data as { timestamp?: unknown; updated?: unknown }).updated)
: undefined,
);
- if (data && typeof data === 'object' && Array.isArray((data as { servers?: unknown }).servers)) {
+ if (
+ data &&
+ typeof data === 'object' &&
+ Array.isArray((data as { servers?: unknown }).servers)
+ ) {
updateDiscoveredNodesFromServers((data as { servers: RawDiscoveredServer[] }).servers);
}
setDiscoveryScanStatus((previous) => ({
@@ -509,7 +513,9 @@ export const useInfrastructureDiscoveryRuntimeState = ({
...previous,
scanning: !!data.scanning,
subnet: data.subnet || previous.subnet,
- lastScanStartedAt: data.scanning ? (data.timestamp ?? Date.now()) : previous.lastScanStartedAt,
+ lastScanStartedAt: data.scanning
+ ? (data.timestamp ?? Date.now())
+ : previous.lastScanStartedAt,
lastResultAt: !data.scanning && data.timestamp ? data.timestamp : previous.lastResultAt,
}));
diff --git a/frontend-modern/src/components/Settings/useOrganizationAccessPanelState.ts b/frontend-modern/src/components/Settings/useOrganizationAccessPanelState.ts
index 747e617d3d..51e5f718a5 100644
--- a/frontend-modern/src/components/Settings/useOrganizationAccessPanelState.ts
+++ b/frontend-modern/src/components/Settings/useOrganizationAccessPanelState.ts
@@ -222,9 +222,7 @@ export function useOrganizationAccessPanelState(props: OrganizationAccessPanelPr
} catch (error) {
logger.error('Failed to remove organization member', error);
notificationStore.error(
- getOrganizationRemoveMemberErrorMessage(
- error instanceof Error ? error.message : undefined,
- ),
+ getOrganizationRemoveMemberErrorMessage(error instanceof Error ? error.message : undefined),
);
} finally {
setSaving(false);
diff --git a/frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts b/frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts
index e41bb080c7..aac175c591 100644
--- a/frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts
+++ b/frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts
@@ -12,9 +12,7 @@ import {
getLicenseTierLabel,
getOrganizationBillingLicenseStatusLabel,
} from '@/utils/licensePresentation';
-import {
- getOrganizationSettingsLoadErrorMessage,
-} from '@/utils/organizationSettingsPresentation';
+import { getOrganizationSettingsLoadErrorMessage } from '@/utils/organizationSettingsPresentation';
import {
buildHostedCommercialPlanModel,
buildHostedCommercialUsageModel,
diff --git a/frontend-modern/src/components/Settings/useReportingPanelState.ts b/frontend-modern/src/components/Settings/useReportingPanelState.ts
index 21f5dc4bc6..24f43fe565 100644
--- a/frontend-modern/src/components/Settings/useReportingPanelState.ts
+++ b/frontend-modern/src/components/Settings/useReportingPanelState.ts
@@ -130,7 +130,9 @@ export const useReportingPanelState = () => {
setReportSchedules(parseReportSchedulesResponse(await response.json()));
} catch (error) {
console.error('Report schedules error:', error);
- setReportSchedulesError(error instanceof Error ? error.message : 'Failed to load report schedules');
+ setReportSchedulesError(
+ error instanceof Error ? error.message : 'Failed to load report schedules',
+ );
} finally {
setReportSchedulesLoading(false);
}
@@ -322,11 +324,14 @@ export const useReportingPanelState = () => {
const updateReportSchedule = async (schedule: ReportSchedule) => {
const normalized = normalizeReportSchedule(schedule);
- const response = await apiFetch(`/api/admin/reports/schedules/${encodeURIComponent(normalized.id)}`, {
- method: 'PUT',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify(normalized),
- });
+ const response = await apiFetch(
+ `/api/admin/reports/schedules/${encodeURIComponent(normalized.id)}`,
+ {
+ method: 'PUT',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(normalized),
+ },
+ );
if (!response.ok) {
throw await apiErrorFromResponse(response, 'Failed to update report schedule');
}
@@ -381,9 +386,12 @@ export const useReportingPanelState = () => {
if (!window.confirm(`Delete ${schedule.name}?`)) return;
setDeletingScheduleID(schedule.id);
try {
- const response = await apiFetch(`/api/admin/reports/schedules/${encodeURIComponent(schedule.id)}`, {
- method: 'DELETE',
- });
+ const response = await apiFetch(
+ `/api/admin/reports/schedules/${encodeURIComponent(schedule.id)}`,
+ {
+ method: 'DELETE',
+ },
+ );
if (!response.ok) {
throw await apiErrorFromResponse(response, 'Failed to delete report schedule');
}
diff --git a/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
index 1cf791ee26..c59c8c0dda 100644
--- a/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
+++ b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
@@ -2,11 +2,7 @@ import { createMemo, createSignal, onMount } from 'solid-js';
import { notificationStore } from '@/stores/notifications';
import { logger } from '@/utils/logger';
import type { MonitoredSystemLedgerPreviewResponse } from '@/api/monitoredSystemLedger';
-import {
- apiErrorCode,
- apiErrorDetailField,
- apiErrorStatus,
-} from '@/api/responseUtils';
+import { apiErrorCode, apiErrorDetailField, apiErrorStatus } from '@/api/responseUtils';
import {
TrueNASAPI,
isRedactedTrueNASSecret,
diff --git a/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts b/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts
index a7fff097b0..ee38089259 100644
--- a/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts
+++ b/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts
@@ -6,11 +6,7 @@ import {
type VMwareConnection,
type VMwareConnectionInput,
} from '@/api/vmware';
-import {
- apiErrorCode,
- apiErrorDetailField,
- apiErrorStatus,
-} from '@/api/responseUtils';
+import { apiErrorCode, apiErrorDetailField, apiErrorStatus } from '@/api/responseUtils';
import { notificationStore } from '@/stores/notifications';
import { logger } from '@/utils/logger';
import {
diff --git a/frontend-modern/src/components/SetupWizard/SetupCompletionPreview.tsx b/frontend-modern/src/components/SetupWizard/SetupCompletionPreview.tsx
index 07dd0b34d3..a5d6f17921 100644
--- a/frontend-modern/src/components/SetupWizard/SetupCompletionPreview.tsx
+++ b/frontend-modern/src/components/SetupWizard/SetupCompletionPreview.tsx
@@ -13,9 +13,7 @@ const previewWizardState: WizardState = {
export const SetupCompletionPreview: Component = () => {
const location = useLocation();
const navigate = useNavigate();
- const previewScenario = createMemo(() =>
- getSetupCompletionPreviewScenario(location.search),
- );
+ const previewScenario = createMemo(() => getSetupCompletionPreviewScenario(location.search));
return (
<SetupCompletionPanel
diff --git a/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov.test.ts b/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov.test.ts
index 1f6d5658b2..865606298f 100644
--- a/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov.test.ts
+++ b/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov.test.ts
@@ -30,7 +30,12 @@ describe('setupCompletionModel branch coverage', () => {
describe('isSetupCompletionInfrastructureResource (via inclusion/exclusion)', () => {
it('admits agent resources with an agent facet onto the agent connection path', () => {
const systems = buildSetupCompletionConnectedSystems([
- makeResource({ id: 'agent-1', type: 'agent', name: 'Tower', agent: { agentId: 'agent-1' } }),
+ makeResource({
+ id: 'agent-1',
+ type: 'agent',
+ name: 'Tower',
+ agent: { agentId: 'agent-1' },
+ }),
]);
expect(systems).toHaveLength(1);
@@ -80,7 +85,12 @@ describe('setupCompletionModel branch coverage', () => {
const mixed = buildSetupCompletionConnectedSystems([
vm,
- makeResource({ id: 'agent-1', type: 'agent', name: 'Tower', agent: { agentId: 'agent-1' } }),
+ makeResource({
+ id: 'agent-1',
+ type: 'agent',
+ name: 'Tower',
+ agent: { agentId: 'agent-1' },
+ }),
]);
expect(namesOf(mixed)).toEqual(['Tower']);
});
diff --git a/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov0712b.test.ts b/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov0712b.test.ts
index 040317963e..2f81b6316c 100644
--- a/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/SetupWizard/__tests__/setupCompletionModel.branchcov0712b.test.ts
@@ -199,7 +199,13 @@ describe('setupCompletionModel branch coverage (supplemental)', () => {
// two all-empty-identity pbs resources with different resolved names must NOT collide.
const systems = buildSetupCompletionConnectedSystems([
makeResource({ id: '', type: 'pbs', name: '', displayName: '', platformId: '' }),
- makeResource({ id: '', type: 'pbs', name: 'realbox', displayName: 'Real Box', platformId: '' }),
+ makeResource({
+ id: '',
+ type: 'pbs',
+ name: 'realbox',
+ displayName: 'Real Box',
+ platformId: '',
+ }),
]);
expect(systems).toHaveLength(2);
diff --git a/frontend-modern/src/components/SetupWizard/index.ts b/frontend-modern/src/components/SetupWizard/index.ts
index 74a516fc40..0367bc4451 100644
--- a/frontend-modern/src/components/SetupWizard/index.ts
+++ b/frontend-modern/src/components/SetupWizard/index.ts
@@ -1,2 +1,2 @@
export { SetupWizard } from './SetupWizard';
-export type { WizardState, } from './SetupWizard';
+export type { WizardState } from './SetupWizard';
diff --git a/frontend-modern/src/components/SetupWizard/setupCompletionPreviewScenarios.ts b/frontend-modern/src/components/SetupWizard/setupCompletionPreviewScenarios.ts
index 7f37c6c5a2..faf9bde086 100644
--- a/frontend-modern/src/components/SetupWizard/setupCompletionPreviewScenarios.ts
+++ b/frontend-modern/src/components/SetupWizard/setupCompletionPreviewScenarios.ts
@@ -38,7 +38,8 @@ const SETUP_COMPLETION_PREVIEW_SCENARIOS: Record<
},
};
-export const DEFAULT_SETUP_COMPLETION_PREVIEW_SCENARIO_ID: SetupCompletionPreviewScenarioId = 'empty';
+export const DEFAULT_SETUP_COMPLETION_PREVIEW_SCENARIO_ID: SetupCompletionPreviewScenarioId =
+ 'empty';
export const getSetupCompletionPreviewScenario = (
search: string | null | undefined,
diff --git a/frontend-modern/src/components/Storage/StorageGroupRow.tsx b/frontend-modern/src/components/Storage/StorageGroupRow.tsx
index d4655d2e3b..c812928dcb 100644
--- a/frontend-modern/src/components/Storage/StorageGroupRow.tsx
+++ b/frontend-modern/src/components/Storage/StorageGroupRow.tsx
@@ -2,9 +2,7 @@ import { Component, For, Show } from 'solid-js';
import { EnhancedStorageBar } from './EnhancedStorageBar';
import type { StorageGroupedRecords, StorageGroupKey } from './useStorageModel';
import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
-import {
- createSummaryInteractiveRowPreviewHandlers,
-} from '@/components/shared/summaryInteractionA11y';
+import { createSummaryInteractiveRowPreviewHandlers } from '@/components/shared/summaryInteractionA11y';
import { SummaryRowActionButton } from '@/components/shared/SummaryRowActionButton';
import {
buildStorageGroupRowPresentation,
@@ -46,11 +44,7 @@ export const StorageGroupRow: Component<StorageGroupRowProps> = (props) => {
data-summary-group-id={props.summaryGroupScope?.id ?? undefined}
data-summary-group-series-count={String(props.summaryGroupScope?.seriesIds.length ?? 0)}
data-summary-row-active={props.summaryActive ? 'true' : 'false'}
- onClick={() =>
- props.onFocusChange?.(
- props.summaryFocused ? null : props.summaryGroupScope,
- )
- }
+ onClick={() => props.onFocusChange?.(props.summaryFocused ? null : props.summaryGroupScope)}
{...interactiveRowHandlers}
>
<td colSpan={99} class={STORAGE_GROUP_ROW_CELL_CLASS}>
@@ -65,9 +59,7 @@ export const StorageGroupRow: Component<StorageGroupRowProps> = (props) => {
/>
{/* Group label */}
- <span class={STORAGE_GROUP_ROW_LABEL_CLASS}>
- {row().label}
- </span>
+ <span class={STORAGE_GROUP_ROW_LABEL_CLASS}>{row().label}</span>
{/* Aggregate capacity bar */}
<Show when={row().showUsage}>
@@ -78,22 +70,21 @@ export const StorageGroupRow: Component<StorageGroupRowProps> = (props) => {
free={Math.max(0, props.group.stats.totalBytes - props.group.stats.usedBytes)}
/>
</div>
- <span class={STORAGE_GROUP_ROW_USAGE_LABEL_CLASS}>
- {row().usagePercentLabel}
- </span>
+ <span class={STORAGE_GROUP_ROW_USAGE_LABEL_CLASS}>{row().usagePercentLabel}</span>
</Show>
{/* Pool count */}
- <span class={STORAGE_GROUP_ROW_POOL_COUNT_CLASS}>
- {row().poolCountLabel}
- </span>
+ <span class={STORAGE_GROUP_ROW_POOL_COUNT_CLASS}>{row().poolCountLabel}</span>
{/* Health dots */}
<div class={STORAGE_GROUP_ROW_HEALTH_WRAP_CLASS}>
<For each={row().healthCounts}>
{(item) => (
<span class={STORAGE_GROUP_ROW_HEALTH_ITEM_CLASS}>
- <span class={`${STORAGE_GROUP_ROW_HEALTH_DOT_CLASS} ${item.dotClass}`} title={item.label} />
+ <span
+ class={`${STORAGE_GROUP_ROW_HEALTH_DOT_CLASS} ${item.dotClass}`}
+ title={item.label}
+ />
<span class={`${STORAGE_GROUP_ROW_HEALTH_COUNT_CLASS} ${item.countClass}`}>
{item.count}
</span>
diff --git a/frontend-modern/src/components/Storage/StoragePoolDetail.tsx b/frontend-modern/src/components/Storage/StoragePoolDetail.tsx
index 78a4e6270f..f45e89d644 100644
--- a/frontend-modern/src/components/Storage/StoragePoolDetail.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolDetail.tsx
@@ -160,10 +160,7 @@ export const StoragePoolDetail: Component<StoragePoolDetailProps> = (props) => {
<For each={zfsSummary()!.devices}>
{(device) => (
<div class={STORAGE_DETAIL_LINKED_DISK_ROW_CLASS}>
- <span
- class={STORAGE_DETAIL_LINKED_DISK_PATH_CLASS}
- title={device.name}
- >
+ <span class={STORAGE_DETAIL_LINKED_DISK_PATH_CLASS} title={device.name}>
{device.name}
</span>
<Show when={device.type}>
diff --git a/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx b/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
index dd885c328f..a803abb00b 100644
--- a/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
@@ -4,7 +4,12 @@ import { DiskDetail } from '@/components/Storage/DiskDetail';
import type { Resource } from '@/types/resource';
vi.mock('@/components/shared/HistoryChart', () => ({
- HistoryChart: (props: { resourceType: string; resourceId: string; metric: string; range?: string }) => (
+ HistoryChart: (props: {
+ resourceType: string;
+ resourceId: string;
+ metric: string;
+ range?: string;
+ }) => (
<div data-testid="history-chart">
{props.resourceType}:{props.resourceId}:{props.metric}:{props.range}
</div>
diff --git a/frontend-modern/src/components/Storage/__tests__/storagePageState.branchcov.test.ts b/frontend-modern/src/components/Storage/__tests__/storagePageState.branchcov.test.ts
index 62e61f1faf..48d4975237 100644
--- a/frontend-modern/src/components/Storage/__tests__/storagePageState.branchcov.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/storagePageState.branchcov.test.ts
@@ -241,7 +241,9 @@ describe('storagePageState branch coverage', () => {
it('marks a node online only when status is "online" AND uptime is a positive number', () => {
expect(
- buildStorageNodeOnlineByLabel([makeResource({ name: 'host-a', status: 'online', uptime: 1 })]),
+ buildStorageNodeOnlineByLabel([
+ makeResource({ name: 'host-a', status: 'online', uptime: 1 }),
+ ]),
).toEqual(new Map([['host-a', true]]));
});
@@ -341,12 +343,12 @@ describe('storagePageState branch coverage', () => {
});
it('returns the stored boolean for isZfs (true and false)', () => {
- expect(
- getStorageMetaBoolean(makeStorageRecord({ details: { isZfs: true } }), 'isZfs'),
- ).toBe(true);
- expect(
- getStorageMetaBoolean(makeStorageRecord({ details: { isZfs: false } }), 'isZfs'),
- ).toBe(false);
+ expect(getStorageMetaBoolean(makeStorageRecord({ details: { isZfs: true } }), 'isZfs')).toBe(
+ true,
+ );
+ expect(getStorageMetaBoolean(makeStorageRecord({ details: { isZfs: false } }), 'isZfs')).toBe(
+ false,
+ );
});
it('returns null for non-boolean values (string, number, null)', () => {
@@ -357,10 +359,7 @@ describe('storagePageState branch coverage', () => {
getStorageMetaBoolean(makeStorageRecord({ details: { isCeph: 1 } }), 'isCeph'),
).toBeNull();
expect(
- getStorageMetaBoolean(
- makeStorageRecord({ details: { isCeph: null } }),
- 'isCeph',
- ),
+ getStorageMetaBoolean(makeStorageRecord({ details: { isCeph: null } }), 'isCeph'),
).toBeNull();
});
});
@@ -381,7 +380,12 @@ describe('storagePageState branch coverage', () => {
const record = makeStorageRecord({
details: { isCeph: false, type: 'rbd' },
capabilities: ['replication'],
- source: { platform: 'proxmox-pve', family: 'virtualization', origin: 'resource', adapterId: 'a' },
+ source: {
+ platform: 'proxmox-pve',
+ family: 'virtualization',
+ origin: 'resource',
+ adapterId: 'a',
+ },
});
expect(isStorageRecordCeph(record)).toBe(false);
});
@@ -390,7 +394,12 @@ describe('storagePageState branch coverage', () => {
const record = makeStorageRecord({
details: { type: 'rbd' },
capabilities: [],
- source: { platform: 'proxmox-pve', family: 'virtualization', origin: 'resource', adapterId: 'a' },
+ source: {
+ platform: 'proxmox-pve',
+ family: 'virtualization',
+ origin: 'resource',
+ adapterId: 'a',
+ },
});
expect(isStorageRecordCeph(record)).toBe(true);
});
@@ -399,7 +408,12 @@ describe('storagePageState branch coverage', () => {
const record = makeStorageRecord({
details: { type: 'lvm' },
capabilities: ['capacity', 'replication'],
- source: { platform: 'proxmox-pve', family: 'virtualization', origin: 'resource', adapterId: 'a' },
+ source: {
+ platform: 'proxmox-pve',
+ family: 'virtualization',
+ origin: 'resource',
+ adapterId: 'a',
+ },
});
expect(isStorageRecordCeph(record)).toBe(true);
});
@@ -408,7 +422,12 @@ describe('storagePageState branch coverage', () => {
const record = makeStorageRecord({
details: { type: 'zfs' },
capabilities: ['capacity'],
- source: { platform: 'truenas-scale', family: 'generic', origin: 'resource', adapterId: 'a' },
+ source: {
+ platform: 'truenas-scale',
+ family: 'generic',
+ origin: 'resource',
+ adapterId: 'a',
+ },
});
expect(isStorageRecordCeph(record)).toBe(false);
});
@@ -426,7 +445,12 @@ describe('storagePageState branch coverage', () => {
const record = makeStorageRecord({
details: { type: 'lvm' },
capabilities: ['capacity'],
- source: { platform: 'proxmox-pve', family: 'virtualization', origin: 'resource', adapterId: 'a' },
+ source: {
+ platform: 'proxmox-pve',
+ family: 'virtualization',
+ origin: 'resource',
+ adapterId: 'a',
+ },
});
expect(isStorageRecordCeph(record)).toBe(false);
});
@@ -534,9 +558,12 @@ describe('storagePageState branch coverage', () => {
['critical', 'critical'],
['offline', 'offline'],
['unknown', 'unknown'],
- ] as const)('write passes %s through getStorageStatusFilterValue unchanged', (input, expected) => {
- expect(buildFields().status!.write?.(input)).toBe(expected);
- });
+ ] as const)(
+ 'write passes %s through getStorageStatusFilterValue unchanged',
+ (input, expected) => {
+ expect(buildFields().status!.write?.(input)).toBe(expected);
+ },
+ );
});
describe('diskRole field', () => {
diff --git a/frontend-modern/src/components/Storage/__tests__/storagePageState.coverage.test.ts b/frontend-modern/src/components/Storage/__tests__/storagePageState.coverage.test.ts
index fe8a06b818..261fb27338 100644
--- a/frontend-modern/src/components/Storage/__tests__/storagePageState.coverage.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/storagePageState.coverage.test.ts
@@ -85,19 +85,13 @@ describe('storagePageState coverage', () => {
});
describe('normalizeStorageSortKey', () => {
- it.each([
- 'priority',
- 'name',
- 'state',
- 'usage',
- 'type',
- 'host',
- 'protection',
- 'growth',
- ])('accepts canonical sort key %s (trimmed, lowercased)', (key) => {
- expect(normalizeStorageSortKey(key)).toBe(key);
- expect(normalizeStorageSortKey(` ${key.toUpperCase()} `)).toBe(key);
- });
+ it.each(['priority', 'name', 'state', 'usage', 'type', 'host', 'protection', 'growth'])(
+ 'accepts canonical sort key %s (trimmed, lowercased)',
+ (key) => {
+ expect(normalizeStorageSortKey(key)).toBe(key);
+ expect(normalizeStorageSortKey(` ${key.toUpperCase()} `)).toBe(key);
+ },
+ );
it('falls back to "priority" for empty / whitespace input', () => {
expect(normalizeStorageSortKey('')).toBe('priority');
@@ -154,9 +148,9 @@ describe('storagePageState coverage', () => {
});
it('counts diskRoleFilter when not at default', () => {
- expect(
- countActiveStorageFilters({ ...baseInactiveState, diskRoleFilter: 'nvme-disk' }),
- ).toBe(1);
+ expect(countActiveStorageFilters({ ...baseInactiveState, diskRoleFilter: 'nvme-disk' })).toBe(
+ 1,
+ );
});
it('counts diskGroupFilter when not at default', () => {
@@ -215,15 +209,15 @@ describe('storagePageState coverage', () => {
});
it('returns true when diskRoleFilter differs from default', () => {
- expect(
- hasActiveStorageFilters({ ...baseInactiveState, diskRoleFilter: 'nvme-disk' }),
- ).toBe(true);
+ expect(hasActiveStorageFilters({ ...baseInactiveState, diskRoleFilter: 'nvme-disk' })).toBe(
+ true,
+ );
});
it('returns true when diskGroupFilter differs from default', () => {
- expect(
- hasActiveStorageFilters({ ...baseInactiveState, diskGroupFilter: 'data-pool' }),
- ).toBe(true);
+ expect(hasActiveStorageFilters({ ...baseInactiveState, diskGroupFilter: 'data-pool' })).toBe(
+ true,
+ );
});
});
diff --git a/frontend-modern/src/components/Storage/__tests__/storageSummaryGroups.branchcov0712.test.ts b/frontend-modern/src/components/Storage/__tests__/storageSummaryGroups.branchcov0712.test.ts
index 7a99b9651b..a55ab0b3d1 100644
--- a/frontend-modern/src/components/Storage/__tests__/storageSummaryGroups.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/storageSummaryGroups.branchcov0712.test.ts
@@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest';
import type { NormalizedHealth, StorageRecord } from '@/features/storageBackups/models';
-import type {
- StorageGroupedRecords,
- StorageGroupKey,
-} from '@/components/Storage/useStorageModel';
+import type { StorageGroupedRecords, StorageGroupKey } from '@/components/Storage/useStorageModel';
import {
buildStorageSummaryGroupId,
buildStorageSummaryGroupScope,
diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts
index 9e15d939c1..5f7900d39f 100644
--- a/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts
@@ -40,7 +40,9 @@ describe('useStoragePageFilters', () => {
};
it('reads canonical storage query state through the shared page-filter hook', () => {
- const ctx = setup('?tab=disks&source=agent&status=warning&group=status&sort=usage&order=asc&q=tank');
+ const ctx = setup(
+ '?tab=disks&source=agent&status=warning&group=status&sort=usage&order=asc&q=tank',
+ );
vi.runAllTimers();
diff --git a/frontend-modern/src/components/Storage/storagePageState.ts b/frontend-modern/src/components/Storage/storagePageState.ts
index b8c244e4ea..bdea594946 100644
--- a/frontend-modern/src/components/Storage/storagePageState.ts
+++ b/frontend-modern/src/components/Storage/storagePageState.ts
@@ -16,13 +16,7 @@ import type { StorageRouteStateFields } from './useStorageRouteState';
export type StorageView = 'pools' | 'disks';
export type StorageStatusFilterValue =
- | 'all'
- | 'attention'
- | 'available'
- | 'warning'
- | 'critical'
- | 'offline'
- | 'unknown';
+ 'all' | 'attention' | 'available' | 'warning' | 'critical' | 'offline' | 'unknown';
export interface StorageOption {
value: string;
@@ -135,9 +129,7 @@ export const normalizeStorageSortKey = (value: string): StorageSortKey => {
return 'priority';
};
-export const getDefaultStorageSortDirection = (
- sortKey: StorageSortKey,
-): 'asc' | 'desc' =>
+export const getDefaultStorageSortDirection = (sortKey: StorageSortKey): 'asc' | 'desc' =>
sortKey === 'priority' || sortKey === 'usage' || sortKey === 'growth' ? 'desc' : 'asc';
export const normalizeStorageGroupKey = (value: string): StorageGroupKey => {
@@ -212,9 +204,7 @@ export const hasActiveStorageFilters = (state: StorageFilterActivityState): bool
DEFAULT_STORAGE_DISK_GROUP_FILTER;
export const getStorageNodeFilterLabel = (view: StorageView): string =>
- view === 'disks'
- ? getAllFilterOptionLabel('disk hosts')
- : getAllFilterOptionLabel('nodes');
+ view === 'disks' ? getAllFilterOptionLabel('disk hosts') : getAllFilterOptionLabel('nodes');
export const readStorageRouteValue = (value: string | undefined, defaultValue: string): string => {
const normalized = (value || '').trim();
diff --git a/frontend-modern/src/components/Storage/storageSummaryGroups.ts b/frontend-modern/src/components/Storage/storageSummaryGroups.ts
index a03cb70994..dac1011c52 100644
--- a/frontend-modern/src/components/Storage/storageSummaryGroups.ts
+++ b/frontend-modern/src/components/Storage/storageSummaryGroups.ts
@@ -32,7 +32,9 @@ export const buildStorageSummaryGroupScope = (
}
const seriesIds = Array.from(
- new Set(group.items.map((record) => resolveStorageRecordMetricResourceId(record)).filter(Boolean)),
+ new Set(
+ group.items.map((record) => resolveStorageRecordMetricResourceId(record)).filter(Boolean),
+ ),
);
if (seriesIds.length === 0) {
return null;
diff --git a/frontend-modern/src/components/Storage/useDiskDetailModel.ts b/frontend-modern/src/components/Storage/useDiskDetailModel.ts
index f4d3d6cfba..0fd8dc3aa7 100644
--- a/frontend-modern/src/components/Storage/useDiskDetailModel.ts
+++ b/frontend-modern/src/components/Storage/useDiskDetailModel.ts
@@ -10,9 +10,7 @@ import {
} from '@/features/storageBackups/diskDetailPresentation';
import { useAlertsActivation } from '@/stores/alertsActivation';
import type { Resource } from '@/types/resource';
-import {
- resolvePhysicalDiskHistoryResourceId,
-} from './diskResourceUtils';
+import { resolvePhysicalDiskHistoryResourceId } from './diskResourceUtils';
type UseDiskDetailModelOptions = {
disk: Accessor<Resource>;
diff --git a/frontend-modern/src/components/Storage/useStoragePoolsTableModel.ts b/frontend-modern/src/components/Storage/useStoragePoolsTableModel.ts
index eaf1e80cf6..f148ada8a9 100644
--- a/frontend-modern/src/components/Storage/useStoragePoolsTableModel.ts
+++ b/frontend-modern/src/components/Storage/useStoragePoolsTableModel.ts
@@ -26,7 +26,10 @@ export const useStoragePoolsTableModel = (options: UseStoragePoolsTableModelOpti
),
);
- const buildRowModel = (_recordId: string, record: Parameters<typeof buildStoragePoolsTableRowModel>[0]) =>
+ const buildRowModel = (
+ _recordId: string,
+ record: Parameters<typeof buildStoragePoolsTableRowModel>[0],
+ ) =>
buildStoragePoolsTableRowModel(record, {
expandedPoolId: options.expandedPoolId(),
highlightedRecordId: options.highlightedRecordId(),
diff --git a/frontend-modern/src/components/Storage/useStorageSummaryCharts.ts b/frontend-modern/src/components/Storage/useStorageSummaryCharts.ts
index 1707ef71f4..4da09877bc 100644
--- a/frontend-modern/src/components/Storage/useStorageSummaryCharts.ts
+++ b/frontend-modern/src/components/Storage/useStorageSummaryCharts.ts
@@ -2,10 +2,7 @@ import { createEffect, createMemo, createSignal, onCleanup, type Accessor } from
import type { StorageSummaryChartsResponse, TimeRange } from '@/api/charts';
import type { SummaryTimeRange } from '@/components/shared/summaryTimeRange';
import { eventBus } from '@/stores/events';
-import {
- fetchStorageSummaryAndCache,
- readStorageSummaryCache,
-} from '@/utils/storageSummaryCache';
+import { fetchStorageSummaryAndCache, readStorageSummaryCache } from '@/utils/storageSummaryCache';
const POLL_INTERVAL_MS = 30_000;
@@ -35,7 +32,7 @@ export const useStorageSummaryCharts = (options: UseStorageSummaryChartsOptions)
return raw && raw !== 'all' ? raw : undefined;
});
- const awaitAbortable = <T,>(promise: Promise<T>, signal: AbortSignal): Promise<T> => {
+ const awaitAbortable = <T>(promise: Promise<T>, signal: AbortSignal): Promise<T> => {
if (signal.aborted) {
return Promise.reject(new DOMException('Aborted', 'AbortError'));
}
diff --git a/frontend-modern/src/components/UpdateBanner.test.tsx b/frontend-modern/src/components/UpdateBanner.test.tsx
index 30653c9389..1a75634fd9 100644
--- a/frontend-modern/src/components/UpdateBanner.test.tsx
+++ b/frontend-modern/src/components/UpdateBanner.test.tsx
@@ -69,7 +69,12 @@ afterEach(() => {
cleanup();
mock.runtimeBuild = 'community';
mock.dockerUpdate = undefined;
- mock.plan = { canAutoUpdate: true, requiresRoot: false, rollbackSupport: false, instructions: [] };
+ mock.plan = {
+ canAutoUpdate: true,
+ requiresRoot: false,
+ rollbackSupport: false,
+ instructions: [],
+ };
});
describe('UpdateBanner Pro edition update paths', () => {
@@ -92,15 +97,18 @@ describe('UpdateBanner Pro edition update paths', () => {
fireEvent.click(screen.getByTitle('Show more'));
expect(screen.getByText(/private Pulse Pro build from the license server/)).toBeInTheDocument();
- expect(
- screen.getByRole('button', { name: 'Apply Update Automatically' }),
- ).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Apply Update Automatically' })).toBeInTheDocument();
expect(screen.queryByRole('link', { name: /Private Release Access/ })).not.toBeInTheDocument();
});
it('routes non-auto-updatable Pro deployments to the portal', async () => {
mock.runtimeBuild = 'pro';
- mock.plan = { canAutoUpdate: false, requiresRoot: false, rollbackSupport: false, instructions: [] };
+ mock.plan = {
+ canAutoUpdate: false,
+ requiresRoot: false,
+ rollbackSupport: false,
+ instructions: [],
+ };
render(() => <UpdateBanner />);
@@ -111,7 +119,12 @@ describe('UpdateBanner Pro edition update paths', () => {
it('shows the portal steps (archive + .sshsig) for manual Pro deployments when expanded', async () => {
mock.runtimeBuild = 'pro';
- mock.plan = { canAutoUpdate: false, requiresRoot: false, rollbackSupport: false, instructions: [] };
+ mock.plan = {
+ canAutoUpdate: false,
+ requiresRoot: false,
+ rollbackSupport: false,
+ instructions: [],
+ };
render(() => <UpdateBanner />);
await screen.findByRole('link', { name: /Private Release Access/ });
@@ -131,7 +144,12 @@ describe('UpdateBanner Pro edition update paths', () => {
const digest = 'sha256:' + 'ab'.repeat(32);
const pinnedRef = `registry.pulserelay.pro/pulse/pulse-pro@${digest}`;
mock.runtimeBuild = 'pro';
- mock.plan = { canAutoUpdate: false, requiresRoot: false, rollbackSupport: false, instructions: [] };
+ mock.plan = {
+ canAutoUpdate: false,
+ requiresRoot: false,
+ rollbackSupport: false,
+ instructions: [],
+ };
mock.dockerUpdate = {
version: 'v6.1.0',
image: 'registry.pulserelay.pro/pulse/pulse-pro',
@@ -146,9 +164,7 @@ describe('UpdateBanner Pro edition update paths', () => {
expect(screen.getByText('Pulse Pro update')).toBeInTheDocument();
expect(screen.getByText(`PULSE_IMAGE='${pinnedRef}' docker compose pull`)).toBeInTheDocument();
- expect(
- screen.getByText(`PULSE_IMAGE='${pinnedRef}' docker compose up -d`),
- ).toBeInTheDocument();
+ expect(screen.getByText(`PULSE_IMAGE='${pinnedRef}' docker compose up -d`)).toBeInTheDocument();
// The binary archive steps and community image must not appear for a
// Docker Pro deployment with broker commands available.
expect(screen.queryByText(/install\.sh --archive/)).not.toBeInTheDocument();
diff --git a/frontend-modern/src/components/Workloads/AvailabilityProbeSuggestionCard.tsx b/frontend-modern/src/components/Workloads/AvailabilityProbeSuggestionCard.tsx
index 1a8dee09f2..c8d549c16b 100644
--- a/frontend-modern/src/components/Workloads/AvailabilityProbeSuggestionCard.tsx
+++ b/frontend-modern/src/components/Workloads/AvailabilityProbeSuggestionCard.tsx
@@ -66,7 +66,10 @@ export function AvailabilityProbeSuggestionCard(props: AvailabilityProbeSuggesti
<Show when={state() !== 'created'}>
<div class="flex items-center justify-between gap-2">
<span class="text-muted">Service</span>
- <span class="font-medium text-base-content truncate ml-2" title={props.suggestion.service_name}>
+ <span
+ class="font-medium text-base-content truncate ml-2"
+ title={props.suggestion.service_name}
+ >
{props.suggestion.service_name}
</span>
</div>
@@ -76,7 +79,10 @@ export function AvailabilityProbeSuggestionCard(props: AvailabilityProbeSuggesti
</div>
<div class="flex items-center justify-between gap-2">
<span class="text-muted">Target</span>
- <span class="font-medium text-base-content truncate ml-2" title={props.suggestion.address}>
+ <span
+ class="font-medium text-base-content truncate ml-2"
+ title={props.suggestion.address}
+ >
{props.suggestion.address}
</span>
</div>
diff --git a/frontend-modern/src/components/Workloads/GuestRowCells.tsx b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
index fa048d1549..288c9fa219 100644
--- a/frontend-modern/src/components/Workloads/GuestRowCells.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
@@ -262,7 +262,11 @@ function OSInfoCell(props: { osName: string; osVersion: string; agentVersion: st
</svg>
);
default:
- return <span class="text-slate-400" aria-hidden="true">—</span>;
+ return (
+ <span class="text-slate-400" aria-hidden="true">
+ —
+ </span>
+ );
}
};
@@ -405,9 +409,7 @@ function InfoTooltipCell(props: { value: string; tooltip: string; type: string }
);
}
-function AvailabilityProbeCell(props: {
- presentation: AvailabilityProbePresentation;
-}) {
+function AvailabilityProbeCell(props: { presentation: AvailabilityProbePresentation }) {
const p = createMemo(() => props.presentation);
const badgeText = createMemo(() => {
@@ -419,8 +421,7 @@ function AvailabilityProbeCell(props: {
: result === 'not checked'
? 'pending'
: result;
- const freshness =
- p().freshnessLabel === 'freshness unknown' ? 'unknown' : p().freshnessLabel;
+ const freshness = p().freshnessLabel === 'freshness unknown' ? 'unknown' : p().freshnessLabel;
return `${compactResult} · ${freshness}`;
});
@@ -436,4 +437,11 @@ function AvailabilityProbeCell(props: {
);
}
-export { AvailabilityProbeCell, BackupIndicator, BackupStatusCell, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
+export {
+ AvailabilityProbeCell,
+ BackupIndicator,
+ BackupStatusCell,
+ InfoTooltipCell,
+ NetworkInfoCell,
+ OSInfoCell,
+};
diff --git a/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
index 2419bd0f74..3ac93e5a5f 100644
--- a/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
@@ -68,9 +68,7 @@ export function WorkloadTableHeader(props: WorkloadTableHeaderProps) {
onClick={() => isSortable && props.handleSort(sortKeyForCol!)}
title={col.icon ? col.label : undefined}
>
- <div
- class={`flex min-h-[14px] items-center gap-0.5 ${alignClasses().flexJustify}`}
- >
+ <div class={`flex min-h-[14px] items-center gap-0.5 ${alignClasses().flexJustify}`}>
{col.icon ? (
<>
<span class="flex items-center" aria-hidden="true">
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
index 4a08bf86fd..138745599f 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
@@ -25,7 +25,13 @@ vi.mock('@/hooks/useBreakpoint', () => ({
// useLocation outside a Router context. The tests don't exercise navigation.
vi.mock('@solidjs/router', () => ({
useNavigate: () => () => undefined,
- useLocation: () => ({ pathname: '/proxmox/overview', search: '', hash: '', state: null, query: {} }),
+ useLocation: () => ({
+ pathname: '/proxmox/overview',
+ search: '',
+ hash: '',
+ state: null,
+ query: {},
+ }),
}));
vi.mock('@/components/shared/SearchInput', () => ({
diff --git a/frontend-modern/src/components/Workloads/__tests__/diskListModel.branchcov0713.test.ts b/frontend-modern/src/components/Workloads/__tests__/diskListModel.branchcov0713.test.ts
index cb2900da53..69c4a872d7 100644
--- a/frontend-modern/src/components/Workloads/__tests__/diskListModel.branchcov0713.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/diskListModel.branchcov0713.test.ts
@@ -136,7 +136,9 @@ describe('diskListModel (branch coverage 0713)', () => {
it('maps a percent at or above critical to the critical class with default thresholds', () => {
// 90 >= 90 -> critical.
- expect(getWorkloadsDiskProgressClass(makeDisk({ used: 90, total: 100 }))).toBe(CRITICAL_CLASS);
+ expect(getWorkloadsDiskProgressClass(makeDisk({ used: 90, total: 100 }))).toBe(
+ CRITICAL_CLASS,
+ );
});
it('maps a no-capacity disk (percent 0) to the normal class', () => {
diff --git a/frontend-modern/src/components/Workloads/__tests__/guestAssistantContextModel.branchcov0712b.test.ts b/frontend-modern/src/components/Workloads/__tests__/guestAssistantContextModel.branchcov0712b.test.ts
index 0af6fc5211..32c103c45c 100644
--- a/frontend-modern/src/components/Workloads/__tests__/guestAssistantContextModel.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/guestAssistantContextModel.branchcov0712b.test.ts
@@ -252,9 +252,7 @@ describe('guestAssistantContextModel (branch coverage)', () => {
],
safetyNote: 'Approval required before any action.',
},
- handoffResources: [
- { id: 'pve-a:node-a:101', name: 'web-vm', type: 'vm', node: 'node-a' },
- ],
+ handoffResources: [{ id: 'pve-a:node-a:101', name: 'web-vm', type: 'vm', node: 'node-a' }],
handoffMetadata: { kind: 'resource_context' },
autonomousMode: false,
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov0712c.test.ts b/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov0712c.test.ts
index 508308c9a4..fa487b6010 100644
--- a/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov0712c.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov0712c.test.ts
@@ -41,11 +41,7 @@ describe('normalizeGuestDrawerTags', () => {
});
it('preserves the original order of the surviving tags', () => {
- expect(normalizeGuestDrawerTags([' c ', '', ' a ', ' b '])).toStrictEqual([
- 'c',
- 'a',
- 'b',
- ]);
+ expect(normalizeGuestDrawerTags([' c ', '', ' a ', ' b '])).toStrictEqual(['c', 'a', 'b']);
});
it('returns an empty array for an empty input array', () => {
diff --git a/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov2.test.ts b/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov2.test.ts
index 1739a0dd99..ac2ded60e8 100644
--- a/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/guestDrawerModel.branchcov2.test.ts
@@ -52,12 +52,8 @@ const makeGuest = (overrides?: Partial<WorkloadGuest>): WorkloadGuest =>
// AggregatedMetricPoint declares min/max as required numbers, but the runtime
// contract (and the code under test) tolerates missing/non-finite min/max, so
// build points with optional min/max and cast to satisfy the declared type.
-const pt = (
- timestamp: number,
- value: number,
- min?: number,
- max?: number,
-): AggregatedMetricPoint => ({ timestamp, value, min, max }) as AggregatedMetricPoint;
+const pt = (timestamp: number, value: number, min?: number, max?: number): AggregatedMetricPoint =>
+ ({ timestamp, value, min, max }) as AggregatedMetricPoint;
describe('guestDrawerModel (branch coverage)', () => {
describe('isGuestDrawerVM', () => {
@@ -111,14 +107,14 @@ describe('guestDrawerModel (branch coverage)', () => {
});
it('drops cpu when it is a non-finite number', () => {
- expect(getGuestDrawerHistoryFallbackMetrics(makeGuest({ cpu: Number.NaN })).cpu).toBeUndefined();
+ expect(
+ getGuestDrawerHistoryFallbackMetrics(makeGuest({ cpu: Number.NaN })).cpu,
+ ).toBeUndefined();
});
it('drops cpu when it is not a number (typeof guard)', () => {
expect(
- getGuestDrawerHistoryFallbackMetrics(
- makeGuest({ cpu: 'busy' as unknown as number }),
- ).cpu,
+ getGuestDrawerHistoryFallbackMetrics(makeGuest({ cpu: 'busy' as unknown as number })).cpu,
).toBeUndefined();
});
@@ -172,12 +168,10 @@ describe('guestDrawerModel (branch coverage)', () => {
describe('getGuestDrawerHistoryScale', () => {
it('returns a fixed 0-100 scale for percent units', () => {
- expect(
- getGuestDrawerHistoryScale(
- [{ points: [pt(1, 150, 0, 999)] }],
- '%',
- ),
- ).toStrictEqual({ minValue: 0, maxValue: 100 });
+ expect(getGuestDrawerHistoryScale([{ points: [pt(1, 150, 0, 999)] }], '%')).toStrictEqual({
+ minValue: 0,
+ maxValue: 100,
+ });
});
describe("unit 'C'", () => {
@@ -192,29 +186,33 @@ describe('guestDrawerModel (branch coverage)', () => {
});
it('expands a single distinct value (min===max) symmetrically around it', () => {
- expect(
- getGuestDrawerHistoryScale([{ points: [pt(1, 50, 50, 50)] }], 'C'),
- ).toStrictEqual({ minValue: 45, maxValue: 55 });
+ expect(getGuestDrawerHistoryScale([{ points: [pt(1, 50, 50, 50)] }], 'C')).toStrictEqual({
+ minValue: 45,
+ maxValue: 55,
+ });
});
it('clamps the symmetric lower bound to 0 when the value is near zero', () => {
- expect(
- getGuestDrawerHistoryScale([{ points: [pt(1, 3, 3, 3)] }], 'C'),
- ).toStrictEqual({ minValue: 0, maxValue: 8 });
+ expect(getGuestDrawerHistoryScale([{ points: [pt(1, 3, 3, 3)] }], 'C')).toStrictEqual({
+ minValue: 0,
+ maxValue: 8,
+ });
});
it('applies 15%% padding around distinct min/max using finite min/max fields', () => {
// min=50, max=80 -> padding=max(2, 30*0.15=4.5)=4.5 -> {45.5, 84.5}
- expect(
- getGuestDrawerHistoryScale([{ points: [pt(1, 55, 50, 80)] }], 'C'),
- ).toStrictEqual({ minValue: 45.5, maxValue: 84.5 });
+ expect(getGuestDrawerHistoryScale([{ points: [pt(1, 55, 50, 80)] }], 'C')).toStrictEqual({
+ minValue: 45.5,
+ maxValue: 84.5,
+ });
});
it('falls back to point.value for low/high when min/max are absent', () => {
// value=40 only -> min===max=40 -> {35, 45}
- expect(
- getGuestDrawerHistoryScale([{ points: [pt(1, 40)] }], 'C'),
- ).toStrictEqual({ minValue: 35, maxValue: 45 });
+ expect(getGuestDrawerHistoryScale([{ points: [pt(1, 40)] }], 'C')).toStrictEqual({
+ minValue: 35,
+ maxValue: 45,
+ });
});
});
@@ -225,10 +223,7 @@ describe('guestDrawerModel (branch coverage)', () => {
getGuestDrawerHistoryScale(
[
{
- points: [
- pt(1, 100, undefined, Number.POSITIVE_INFINITY),
- pt(2, Number.NaN),
- ],
+ points: [pt(1, 100, undefined, Number.POSITIVE_INFINITY), pt(2, Number.NaN)],
},
],
'B/s',
@@ -239,16 +234,17 @@ describe('guestDrawerModel (branch coverage)', () => {
it('scales to 1.15x of the largest finite max (prefers max over value)', () => {
// max=200 -> maxValue = max(1, 200*1.15) (IEEE-754 -> 229.99999999999997)
const expectedMax = Math.max(1, 200 * 1.15);
- expect(
- getGuestDrawerHistoryScale([{ points: [pt(1, 100, 0, 200)] }], 'B/s'),
- ).toStrictEqual({ minValue: 0, maxValue: expectedMax });
+ expect(getGuestDrawerHistoryScale([{ points: [pt(1, 100, 0, 200)] }], 'B/s')).toStrictEqual(
+ { minValue: 0, maxValue: expectedMax },
+ );
});
it('falls back to point.value when max is absent', () => {
// value=150 -> maxValue = max(1, 150*1.15) = 172.5
- expect(
- getGuestDrawerHistoryScale([{ points: [pt(1, 150)] }], 'B/s'),
- ).toStrictEqual({ minValue: 0, maxValue: 172.5 });
+ expect(getGuestDrawerHistoryScale([{ points: [pt(1, 150)] }], 'B/s')).toStrictEqual({
+ minValue: 0,
+ maxValue: 172.5,
+ });
});
});
});
@@ -256,9 +252,9 @@ describe('guestDrawerModel (branch coverage)', () => {
describe('buildGuestDrawerHistoryPath', () => {
it('returns an empty string for fewer than two points', () => {
expect(buildGuestDrawerHistoryPath([], { minValue: 0, maxValue: 100 }, 0, 100)).toBe('');
- expect(
- buildGuestDrawerHistoryPath([pt(1, 50)], { minValue: 0, maxValue: 100 }, 0, 100),
- ).toBe('');
+ expect(buildGuestDrawerHistoryPath([pt(1, 50)], { minValue: 0, maxValue: 100 }, 0, 100)).toBe(
+ '',
+ );
});
it('builds an M.. L.. path with default geometry across the full value range', () => {
@@ -356,7 +352,13 @@ describe('guestDrawerModel (branch coverage)', () => {
it('maps a system-container to the canonical node-scoped id', () => {
expect(
getGuestDrawerHistoryTarget(
- makeGuest({ type: 'lxc', workloadType: 'system-container', instance: 'c', node: 'pve', vmid: 102 }),
+ makeGuest({
+ type: 'lxc',
+ workloadType: 'system-container',
+ instance: 'c',
+ node: 'pve',
+ vmid: 102,
+ }),
),
).toStrictEqual({ resourceType: 'system-container', resourceId: 'c:pve:102' });
});
@@ -408,7 +410,9 @@ describe('guestDrawerModel (branch coverage)', () => {
it('returns the bare version for a non-vm', () => {
expect(
- getGuestDrawerAgentLabel(makeGuest({ type: 'lxc', workloadType: 'system-container', agentVersion: '1.0' })),
+ getGuestDrawerAgentLabel(
+ makeGuest({ type: 'lxc', workloadType: 'system-container', agentVersion: '1.0' }),
+ ),
).toBe('1.0');
});
});
@@ -444,9 +448,7 @@ describe('guestDrawerModel (branch coverage)', () => {
it('returns an empty array when total is not positive and no balloon/swap', () => {
expect(
- getGuestDrawerMemoryRows(
- makeGuest({ memory: { total: 0, used: 0, free: 0, usage: 0 } }),
- ),
+ getGuestDrawerMemoryRows(makeGuest({ memory: { total: 0, used: 0, free: 0, usage: 0 } })),
).toEqual([]);
});
@@ -495,7 +497,12 @@ describe('guestDrawerModel (branch coverage)', () => {
expect(
getGuestDrawerMemoryRows(
makeGuest({
- memory: { total: 4096, used: 1024, usage: 0.25, balloon: 2048 } as unknown as WorkloadGuest['memory'],
+ memory: {
+ total: 4096,
+ used: 1024,
+ usage: 0.25,
+ balloon: 2048,
+ } as unknown as WorkloadGuest['memory'],
}),
),
).toEqual([
@@ -507,7 +514,12 @@ describe('guestDrawerModel (branch coverage)', () => {
expect(
getGuestDrawerMemoryRows(
makeGuest({
- memory: { total: 4096, used: 1024, usage: 0.25, balloon: 4096 } as unknown as WorkloadGuest['memory'],
+ memory: {
+ total: 4096,
+ used: 1024,
+ usage: 0.25,
+ balloon: 4096,
+ } as unknown as WorkloadGuest['memory'],
}),
),
).toEqual([
@@ -573,12 +585,16 @@ describe('guestDrawerModel (branch coverage)', () => {
describe('getGuestDrawerNetworkInterfaces', () => {
it('returns an empty array when absent (|| fallback)', () => {
- expect(getGuestDrawerNetworkInterfaces(makeGuest({ networkInterfaces: undefined }))).toEqual([]);
+ expect(getGuestDrawerNetworkInterfaces(makeGuest({ networkInterfaces: undefined }))).toEqual(
+ [],
+ );
});
it('returns the same array reference when present', () => {
const ifaces = [{ name: 'eth0', mac: 'aa:bb' }];
- expect(getGuestDrawerNetworkInterfaces(makeGuest({ networkInterfaces: ifaces }))).toBe(ifaces);
+ expect(getGuestDrawerNetworkInterfaces(makeGuest({ networkInterfaces: ifaces }))).toBe(
+ ifaces,
+ );
});
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/nestedWorkloadContext.branchcov2.test.ts b/frontend-modern/src/components/Workloads/__tests__/nestedWorkloadContext.branchcov2.test.ts
index c3ad1e4559..5bc1da2670 100644
--- a/frontend-modern/src/components/Workloads/__tests__/nestedWorkloadContext.branchcov2.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/nestedWorkloadContext.branchcov2.test.ts
@@ -67,7 +67,13 @@ const run = ({
visibleGuests: readonly WorkloadGuest[];
excludedWorkloadTypes?: readonly WorkloadType[];
platformScope?: string | null;
-}) => buildNestedWorkloadContextByGuestId({ guests, visibleGuests, excludedWorkloadTypes, platformScope });
+}) =>
+ buildNestedWorkloadContextByGuestId({
+ guests,
+ visibleGuests,
+ excludedWorkloadTypes,
+ platformScope,
+ });
describe('nestedWorkloadContext (branch coverage)', () => {
describe('formatRuntimeLabel', () => {
@@ -89,7 +95,9 @@ describe('nestedWorkloadContext (branch coverage)', () => {
title: 'Nested Podman',
count: 1,
href: '/docker/overview?host=host-a',
- items: [{ id: 'app-container:kea', name: 'kea', status: 'running', runtimeLabel: 'Podman' }],
+ items: [
+ { id: 'app-container:kea', name: 'kea', status: 'running', runtimeLabel: 'Podman' },
+ ],
});
});
@@ -132,7 +140,10 @@ describe('nestedWorkloadContext (branch coverage)', () => {
dockerHostId: 'proxmox-lxc-docker:pve-a:node-a:141',
});
- const result = run({ guests: [exited, emptyStatus, whitespaceStatus], visibleGuests: [parent] });
+ const result = run({
+ guests: [exited, emptyStatus, whitespaceStatus],
+ visibleGuests: [parent],
+ });
expect(result['pve-a:node-a:141']?.items.map((item) => item.status)).toEqual([
'exited',
@@ -379,7 +390,12 @@ describe('nestedWorkloadContext (branch coverage)', () => {
count: 1,
href: '/docker/overview?host=media-lxc.mist-stork.ts.net',
items: [
- { id: 'app-container:frigate', name: 'frigate', status: 'running', runtimeLabel: 'Docker' },
+ {
+ id: 'app-container:frigate',
+ name: 'frigate',
+ status: 'running',
+ runtimeLabel: 'Docker',
+ },
],
},
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0712c.test.ts b/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0712c.test.ts
index 04f77f17de..d1d864b7eb 100644
--- a/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0712c.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0712c.test.ts
@@ -126,10 +126,7 @@ describe('getNodeDrawerHistoryFallbackMetrics (branch coverage 0712c)', () => {
temperature: makeTemp({
cpuPackage: undefined,
cpuMax: undefined,
- cores: [
- { core: 0 } as unknown as CoreTemp,
- { core: 1, temp: 75 },
- ],
+ cores: [{ core: 0 } as unknown as CoreTemp, { core: 1, temp: 75 }],
}),
});
expect(getNodeDrawerHistoryFallbackMetrics(node)).toStrictEqual({
diff --git a/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0713.test.ts b/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0713.test.ts
index 43e6a23982..0d6143f7ee 100644
--- a/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0713.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov0713.test.ts
@@ -2,7 +2,10 @@ import { describe, expect, it } from 'vitest';
import type { Node, Temperature } from '@/types/api';
-import { getNodeDrawerHistoryFallbackMetrics, getNodeDrawerHistoryTarget } from '../nodeDrawerModel';
+import {
+ getNodeDrawerHistoryFallbackMetrics,
+ getNodeDrawerHistoryTarget,
+} from '../nodeDrawerModel';
const makeNode = (overrides: Partial<Node> = {}): Node => ({
id: 'agent:pve-node-1',
diff --git a/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov2.test.ts b/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov2.test.ts
index 77c1f7dcf0..a26aa6ebf5 100644
--- a/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/nodeDrawerModel.branchcov2.test.ts
@@ -2,7 +2,10 @@ import { describe, expect, it } from 'vitest';
import type { Node, Temperature } from '@/types/api';
-import { getNodeDrawerHistoryFallbackMetrics, getNodeDrawerHistoryTarget } from '../nodeDrawerModel';
+import {
+ getNodeDrawerHistoryFallbackMetrics,
+ getNodeDrawerHistoryTarget,
+} from '../nodeDrawerModel';
const makeNode = (overrides: Partial<Node> = {}): Node => ({
id: 'agent:pve-node-1',
diff --git a/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts b/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts
index 94e9a88cdf..528fdac43d 100644
--- a/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts
@@ -121,7 +121,9 @@ describe('stackedDiskBarModel (branch coverage 2)', () => {
it('returns the full text when slotWidth <= 0 (short-circuit)', () => {
// slotWidth = containerWidth(0) / 1 = 0 -> first operand of the || .
const p = buildStackedDiskBarPresentation(
- { disks: [makeDisk({ mountpoint: '/dev/sda1', total: 100, used: 50, free: 50, usage: 50 })] },
+ {
+ disks: [makeDisk({ mountpoint: '/dev/sda1', total: 100, used: 50, free: 50, usage: 50 })],
+ },
0,
);
expect(p.miniDisks[0].inlineText).toBe('sda1 50%');
@@ -130,7 +132,9 @@ describe('stackedDiskBarModel (branch coverage 2)', () => {
it('returns the full text when it fits within the slot', () => {
// 'sda1 50%' width = 8 * 5.4 + 4 = 47.2 <= slotWidth(60).
const p = buildStackedDiskBarPresentation(
- { disks: [makeDisk({ mountpoint: '/dev/sda1', total: 100, used: 50, free: 50, usage: 50 })] },
+ {
+ disks: [makeDisk({ mountpoint: '/dev/sda1', total: 100, used: 50, free: 50, usage: 50 })],
+ },
60,
);
expect(p.miniDisks[0].inlineText).toBe('sda1 50%');
@@ -374,7 +378,9 @@ describe('stackedDiskBarModel (branch coverage 2)', () => {
const p = buildStackedDiskBarPresentation(
{
mode: 'mini',
- disks: [makeDisk({ mountpoint: '/dev/nvme0', total: 100, used: 75, free: 25, usage: 75 })],
+ disks: [
+ makeDisk({ mountpoint: '/dev/nvme0', total: 100, used: 75, free: 25, usage: 75 }),
+ ],
},
400,
);
diff --git a/frontend-modern/src/components/Workloads/__tests__/thresholdSliderModel.branchcov0713.test.ts b/frontend-modern/src/components/Workloads/__tests__/thresholdSliderModel.branchcov0713.test.ts
index dac112ed4f..7a0a9a04e4 100644
--- a/frontend-modern/src/components/Workloads/__tests__/thresholdSliderModel.branchcov0713.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/thresholdSliderModel.branchcov0713.test.ts
@@ -170,7 +170,11 @@ describe('getThresholdSliderLabel (branch coverage 0713)', () => {
describe('else arm (value%)', () => {
it('appends % for each non-temperature metric type', () => {
- expect(PERCENT_TYPES.map((t) => getThresholdSliderLabel(t, 50))).toEqual(['50%', '50%', '50%']);
+ expect(PERCENT_TYPES.map((t) => getThresholdSliderLabel(t, 50))).toEqual([
+ '50%',
+ '50%',
+ '50%',
+ ]);
});
it('renders 0% for a zero value', () => {
diff --git a/frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx
index 0ff8975a11..a750036593 100644
--- a/frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useEnhancedCPUBarState.test.tsx
@@ -27,7 +27,9 @@ describe('useEnhancedCPUBarState', () => {
description: 'CPU usage is abnormally high',
},
});
- return <div onMouseEnter={captured.handleMouseEnter} onMouseLeave={captured.handleMouseLeave} />;
+ return (
+ <div onMouseEnter={captured.handleMouseEnter} onMouseLeave={captured.handleMouseLeave} />
+ );
};
const { container } = render(() => <Harness />);
@@ -45,4 +47,3 @@ describe('useEnhancedCPUBarState', () => {
expect(captured!.tooltipVisible()).toBe(false);
});
});
-
diff --git a/frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx
index af7871ce21..4006b7cc27 100644
--- a/frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useMetricBarState.test.tsx
@@ -66,4 +66,3 @@ describe('useMetricBarState', () => {
expect(observers[0].disconnect).toHaveBeenCalled();
});
});
-
diff --git a/frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts b/frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts
index 0d7a371646..4a7d7011e5 100644
--- a/frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/useThresholdSliderState.test.ts
@@ -41,8 +41,7 @@ describe('useThresholdSliderState', () => {
expect(addDocumentSpy).toHaveBeenCalledWith('mouseup', expect.any(Function));
const scrollHandler = addWindowSpy.mock.calls.find((call) => call[0] === 'scroll')?.[1] as
- | EventListener
- | undefined;
+ EventListener | undefined;
expect(scrollHandler).toBeTypeOf('function');
scrollHandler?.(new Event('scroll'));
expect(scrollToSpy).toHaveBeenCalled();
diff --git a/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx b/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
index cbada5c8b0..ffe1b83907 100644
--- a/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/useWorkloadViewportSync.test.tsx
@@ -63,11 +63,9 @@ describe('useWorkloadViewportSync', () => {
expect(onScroll).toHaveBeenCalledWith(96, window.innerHeight, 32);
});
- expect(addEventListenerSpy).toHaveBeenCalledWith(
- 'scroll',
- expect.any(Function),
- { passive: true },
- );
+ expect(addEventListenerSpy).toHaveBeenCalledWith('scroll', expect.any(Function), {
+ passive: true,
+ });
expect(addEventListenerSpy).toHaveBeenCalledWith('resize', expect.any(Function));
window.dispatchEvent(new Event('scroll'));
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadAgentReadiness.branchcov0712.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadAgentReadiness.branchcov0712.test.ts
index 669a099b1a..c1d4271419 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadAgentReadiness.branchcov0712.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadAgentReadiness.branchcov0712.test.ts
@@ -34,9 +34,7 @@ const makeGuest = (overrides?: Partial<WorkloadGuest>): WorkloadGuest =>
...overrides,
}) as WorkloadGuest;
-const target = (
- overrides: Partial<ResourceDiscoveryTarget> = {},
-): ResourceDiscoveryTarget => ({
+const target = (overrides: Partial<ResourceDiscoveryTarget> = {}): ResourceDiscoveryTarget => ({
resourceType: 'vm',
agentId: 'agent-1',
resourceId: 'resource-1',
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadInventorySourceIssues.branchcov2.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadInventorySourceIssues.branchcov2.test.ts
index 9155ac8261..7c10204f5b 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadInventorySourceIssues.branchcov2.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadInventorySourceIssues.branchcov2.test.ts
@@ -241,9 +241,7 @@ describe('workloadInventorySourceIssues (branch coverage)', () => {
}),
]);
- expect(issues[0]?.coverageLabel).toBe(
- 'VMs, containers, and Kubernetes workloads',
- );
+ expect(issues[0]?.coverageLabel).toBe('VMs, containers, and Kubernetes workloads');
});
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadMetricHistoryModel.branchcov.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadMetricHistoryModel.branchcov.test.ts
index ed3e325a67..e5f6d1832c 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadMetricHistoryModel.branchcov.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadMetricHistoryModel.branchcov.test.ts
@@ -180,11 +180,7 @@ describe('workloadMetricHistoryModel (branch coverage)', () => {
it('clamps cpu values via clampPercent (>100, <0, in-range)', () => {
const series = getMetricSparklineSeriesFromChartData(
{
- cpu: [
- seriesPoint(1, 150),
- seriesPoint(2, -5),
- seriesPoint(3, 50),
- ],
+ cpu: [seriesPoint(1, 150), seriesPoint(2, -5), seriesPoint(3, 50)],
},
'cpu',
);
@@ -220,10 +216,7 @@ describe('workloadMetricHistoryModel (branch coverage)', () => {
});
it('emits a disk series with the disk color', () => {
- const series = getMetricSparklineSeriesFromChartData(
- { disk: [seriesPoint(1, 99)] },
- 'disk',
- );
+ const series = getMetricSparklineSeriesFromChartData({ disk: [seriesPoint(1, 99)] }, 'disk');
expect(series[0].id).toBe('disk');
expect(series[0].color).toBe('#10b981');
});
@@ -355,9 +348,7 @@ describe('workloadMetricHistoryModel (branch coverage)', () => {
});
it('returns null for non-finite width', () => {
- expect(
- computeMetricMiniSparklineHoverState(twoPointSeries, 10, Number.NaN),
- ).toBeNull();
+ expect(computeMetricMiniSparklineHoverState(twoPointSeries, 10, Number.NaN)).toBeNull();
});
it('clamps a negative cursorX to zero (left edge)', () => {
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov.test.ts
index 1aff3e37ec..c8dd6f9558 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov.test.ts
@@ -83,7 +83,7 @@ describe('workloadSelectors (branch coverage)', () => {
const memDesc = createWorkloadSortComparator('memory', 'desc');
expect(memAsc).not.toBeNull();
- expect(memDesc).not.toBeNull();
+ expect(memDesc).not.toBeNull();
// null-mem (0) < low-mem (0.1) < high-mem (0.8)
expect([...guests].sort(memAsc!).map((g) => g.id)).toEqual(['null', 'low', 'high']);
@@ -92,8 +92,18 @@ describe('workloadSelectors (branch coverage)', () => {
it('treats memory.usage of 0 as 0 via the || fallback', () => {
const guests = [
- makeGuest(1, { id: 'a', name: 'alpha', cpu: 0.5, memory: { total: 100, used: 0, free: 100, usage: 0 } }),
- makeGuest(2, { id: 'b', name: 'beta', cpu: 0.5, memory: { total: 100, used: 50, free: 50, usage: 0.5 } }),
+ makeGuest(1, {
+ id: 'a',
+ name: 'alpha',
+ cpu: 0.5,
+ memory: { total: 100, used: 0, free: 100, usage: 0 },
+ }),
+ makeGuest(2, {
+ id: 'b',
+ name: 'beta',
+ cpu: 0.5,
+ memory: { total: 100, used: 50, free: 50, usage: 0.5 },
+ }),
];
const memAsc = createWorkloadSortComparator('memory', 'asc');
@@ -102,8 +112,16 @@ describe('workloadSelectors (branch coverage)', () => {
it('sorts by disk usage percent via getDiskUsagePercent', () => {
const guests = [
- makeGuest(1, { id: 'big', name: 'big-disk', disk: { total: 100, used: 90, free: 10, usage: 0.9 } }),
- makeGuest(2, { id: 'small', name: 'small-disk', disk: { total: 100, used: 10, free: 90, usage: 0.1 } }),
+ makeGuest(1, {
+ id: 'big',
+ name: 'big-disk',
+ disk: { total: 100, used: 90, free: 10, usage: 0.9 },
+ }),
+ makeGuest(2, {
+ id: 'small',
+ name: 'small-disk',
+ disk: { total: 100, used: 10, free: 90, usage: 0.1 },
+ }),
];
const diskAsc = createWorkloadSortComparator('disk', 'asc');
@@ -485,7 +503,9 @@ describe('workloadSelectors (branch coverage)', () => {
).toEqual(['k8s-guest']);
expect(
- filterWorkloads({ ...baseParams, guests, searchTerm: 'containerid-uniq-ddd' }).map((g) => g.id),
+ filterWorkloads({ ...baseParams, guests, searchTerm: 'containerid-uniq-ddd' }).map(
+ (g) => g.id,
+ ),
).toEqual(['cid-guest']);
});
});
@@ -516,17 +536,13 @@ describe('workloadSelectors (branch coverage)', () => {
it('clamps used/total result above 100 to 100', () => {
expect(
- getDiskUsagePercent(
- makeGuest(1, { disk: { total: 100, used: 150, free: 0, usage: NaN } }),
- ),
+ getDiskUsagePercent(makeGuest(1, { disk: { total: 100, used: 150, free: 0, usage: NaN } })),
).toBe(100);
});
it('returns null when total is 0 in the used/total fallback', () => {
expect(
- getDiskUsagePercent(
- makeGuest(1, { disk: { total: 0, used: 50, free: 0, usage: NaN } }),
- ),
+ getDiskUsagePercent(makeGuest(1, { disk: { total: 0, used: 50, free: 0, usage: NaN } })),
).toBeNull();
});
@@ -549,9 +565,7 @@ describe('workloadSelectors (branch coverage)', () => {
expect(getDiskUsagePercent(null as unknown as WorkloadGuest)).toBeNull();
expect(getDiskUsagePercent(undefined as unknown as WorkloadGuest)).toBeNull();
expect(
- getDiskUsagePercent(
- makeGuest(1, { disk: undefined as unknown as WorkloadGuest['disk'] }),
- ),
+ getDiskUsagePercent(makeGuest(1, { disk: undefined as unknown as WorkloadGuest['disk'] })),
).toBeNull();
});
});
@@ -674,7 +688,10 @@ describe('workloadSelectors (branch coverage)', () => {
type: 'app-container',
workloadType: 'app-container',
});
- const scope = buildWorkloadSummaryGroupScope('grp', [guest], { type: 'Container', name: 'frigate' });
+ const scope = buildWorkloadSummaryGroupScope('grp', [guest], {
+ type: 'Container',
+ name: 'frigate',
+ });
expect(scope).not.toBeNull();
expect(scope!.label).toBe('frigate · Container (1 workload)');
expect(scope!.seriesIds).toEqual(['cid-1']);
@@ -692,15 +709,26 @@ describe('workloadSelectors (branch coverage)', () => {
});
it('uses workload count alone when label name and type are both empty', () => {
- const guest = makeGuest(1, { id: 'x-1', type: 'app-container', workloadType: 'app-container' });
+ const guest = makeGuest(1, {
+ id: 'x-1',
+ type: 'app-container',
+ workloadType: 'app-container',
+ });
const scope = buildWorkloadSummaryGroupScope('grp', [guest], { type: '', name: '' });
expect(scope).not.toBeNull();
expect(scope!.label).toBe('1 workload');
});
it('trims the groupId for the scope id', () => {
- const guest = makeGuest(1, { id: 'x-2', type: 'app-container', workloadType: 'app-container' });
- const scope = buildWorkloadSummaryGroupScope(' padded-grp ', [guest], { type: 'T', name: 'N' });
+ const guest = makeGuest(1, {
+ id: 'x-2',
+ type: 'app-container',
+ workloadType: 'app-container',
+ });
+ const scope = buildWorkloadSummaryGroupScope(' padded-grp ', [guest], {
+ type: 'T',
+ name: 'N',
+ });
expect(scope).not.toBeNull();
expect(scope!.id).toBe('padded-grp');
});
@@ -784,8 +812,22 @@ describe('workloadSelectors (branch coverage)', () => {
describe('groupWorkloads', () => {
it('sorts the single flat group when a comparator is provided', () => {
const guests = [
- makeGuest(1, { id: 'b-id', name: 'beta', instance: 'x', node: 'y', type: 'vm', workloadType: 'vm' }),
- makeGuest(2, { id: 'a-id', name: 'alpha', instance: 'x', node: 'y', type: 'vm', workloadType: 'vm' }),
+ makeGuest(1, {
+ id: 'b-id',
+ name: 'beta',
+ instance: 'x',
+ node: 'y',
+ type: 'vm',
+ workloadType: 'vm',
+ }),
+ makeGuest(2, {
+ id: 'a-id',
+ name: 'alpha',
+ instance: 'x',
+ node: 'y',
+ type: 'vm',
+ workloadType: 'vm',
+ }),
];
const comparator = createWorkloadSortComparator('name', 'asc');
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov0712b.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov0712b.test.ts
index 5cbf97b20b..ef3e6477da 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov0712b.test.ts
@@ -66,7 +66,11 @@ describe('workloadSelectors (branch coverage 2)', () => {
name: 'null-mem',
memory: null as unknown as WorkloadGuest['memory'],
}),
- makeGuest(2, { id: 'big-mem', name: 'big-mem', memory: { total: 100, used: 80, free: 20, usage: 0.8 } }),
+ makeGuest(2, {
+ id: 'big-mem',
+ name: 'big-mem',
+ memory: { total: 100, used: 80, free: 20, usage: 0.8 },
+ }),
];
const asc = createWorkloadSortComparator('memory', 'asc')!;
// null-mem -> 0 < 0.8
@@ -75,9 +79,21 @@ describe('workloadSelectors (branch coverage 2)', () => {
it('coerces memory.usage of 0 to 0 via the `|| 0` fallback and tiebreaks equals', () => {
const guests = [
- makeGuest(1, { id: 'b', name: 'beta', memory: { total: 100, used: 0, free: 100, usage: 0 } }),
- makeGuest(2, { id: 'a', name: 'alpha', memory: { total: 100, used: 0, free: 100, usage: 0 } }),
- makeGuest(3, { id: 'c', name: 'gamma', memory: { total: 100, used: 50, free: 50, usage: 0.5 } }),
+ makeGuest(1, {
+ id: 'b',
+ name: 'beta',
+ memory: { total: 100, used: 0, free: 100, usage: 0 },
+ }),
+ makeGuest(2, {
+ id: 'a',
+ name: 'alpha',
+ memory: { total: 100, used: 0, free: 100, usage: 0 },
+ }),
+ makeGuest(3, {
+ id: 'c',
+ name: 'gamma',
+ memory: { total: 100, used: 50, free: 50, usage: 0.5 },
+ }),
];
const asc = createWorkloadSortComparator('memory', 'asc')!;
// a,b both 0 -> equal numeric -> tiebreak (alpha<beta); c=0.5 last
@@ -99,14 +115,12 @@ describe('workloadSelectors (branch coverage 2)', () => {
makeGuest(1, { id: 'busy', name: 'busy', networkIn: 200, networkOut: 100 }),
makeGuest(2, { id: 'quiet', name: 'quiet', networkIn: 5, networkOut: 3 }),
];
- expect([...guests].sort(createWorkloadSortComparator('netIo', 'asc')!).map((g) => g.id)).toEqual([
- 'quiet',
- 'busy',
- ]);
- expect([...guests].sort(createWorkloadSortComparator('netIo', 'desc')!).map((g) => g.id)).toEqual([
- 'busy',
- 'quiet',
- ]);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('netIo', 'asc')!).map((g) => g.id),
+ ).toEqual(['quiet', 'busy']);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('netIo', 'desc')!).map((g) => g.id),
+ ).toEqual(['busy', 'quiet']);
});
it('routes a both-empty disk pair through tiebreak and orders empties last in both directions', () => {
@@ -114,24 +128,26 @@ describe('workloadSelectors (branch coverage 2)', () => {
const guests = [
makeGuest(1, { id: 'zz', name: 'zebra', disk: emptyDisk }),
makeGuest(2, { id: 'aa', name: 'alpha', disk: emptyDisk }),
- makeGuest(3, { id: 'mm', name: 'mid', disk: { total: 100, used: 20, free: 80, usage: 0.2 } }),
- makeGuest(4, { id: 'bb', name: 'bravo', disk: { total: 100, used: 90, free: 10, usage: 0.9 } }),
+ makeGuest(3, {
+ id: 'mm',
+ name: 'mid',
+ disk: { total: 100, used: 20, free: 80, usage: 0.2 },
+ }),
+ makeGuest(4, {
+ id: 'bb',
+ name: 'bravo',
+ disk: { total: 100, used: 90, free: 10, usage: 0.9 },
+ }),
];
// getDiskUsagePercent(emptyDisk) -> total 0 -> null -> isEmpty. Non-empty sort first;
// empty pair -> aIsEmpty && bIsEmpty -> tiebreak (alpha<zebra).
- expect([...guests].sort(createWorkloadSortComparator('disk', 'asc')!).map((g) => g.id)).toEqual([
- 'mm',
- 'bb',
- 'aa',
- 'zz',
- ]);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('disk', 'asc')!).map((g) => g.id),
+ ).toEqual(['mm', 'bb', 'aa', 'zz']);
// desc only flips the non-empty comparison; empties still sort last by name asc.
- expect([...guests].sort(createWorkloadSortComparator('disk', 'desc')!).map((g) => g.id)).toEqual([
- 'bb',
- 'mm',
- 'aa',
- 'zz',
- ]);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('disk', 'desc')!).map((g) => g.id),
+ ).toEqual(['bb', 'mm', 'aa', 'zz']);
});
it('pushes a single empty disk value to the end via the aIsEmpty/bIsEmpty arms', () => {
@@ -141,17 +157,19 @@ describe('workloadSelectors (branch coverage 2)', () => {
name: 'empty',
disk: undefined as unknown as WorkloadGuest['disk'],
}),
- makeGuest(2, { id: 'full', name: 'full', disk: { total: 100, used: 50, free: 50, usage: 0.5 } }),
+ makeGuest(2, {
+ id: 'full',
+ name: 'full',
+ disk: { total: 100, used: 50, free: 50, usage: 0.5 },
+ }),
];
// empty -> getDiskUsagePercent null -> aIsEmpty -> return 1 (sorts last) in both dirs.
- expect([...guests].sort(createWorkloadSortComparator('disk', 'asc')!).map((g) => g.id)).toEqual([
- 'full',
- 'empty',
- ]);
- expect([...guests].sort(createWorkloadSortComparator('disk', 'desc')!).map((g) => g.id)).toEqual([
- 'full',
- 'empty',
- ]);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('disk', 'asc')!).map((g) => g.id),
+ ).toEqual(['full', 'empty']);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('disk', 'desc')!).map((g) => g.id),
+ ).toEqual(['full', 'empty']);
});
it('uses the generic-key else branch for a string field with asc/desc', () => {
@@ -160,14 +178,12 @@ describe('workloadSelectors (branch coverage 2)', () => {
makeGuest(2, { id: 'b', name: 'beta', status: 'running' }),
];
// 'running' < 'stopped'
- expect([...guests].sort(createWorkloadSortComparator('status', 'asc')!).map((g) => g.id)).toEqual([
- 'b',
- 'a',
- ]);
- expect([...guests].sort(createWorkloadSortComparator('status', 'desc')!).map((g) => g.id)).toEqual([
- 'a',
- 'b',
- ]);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('status', 'asc')!).map((g) => g.id),
+ ).toEqual(['b', 'a']);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('status', 'desc')!).map((g) => g.id),
+ ).toEqual(['a', 'b']);
});
it('hits the string-equal tiebreak when a generic string key matches on both sides', () => {
@@ -176,10 +192,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
makeGuest(2, { id: 'a-id', name: 'alpha', status: 'running' }),
];
// status 'running' === 'running' -> aStr===bStr -> tiebreak (alpha<beta).
- expect([...guests].sort(createWorkloadSortComparator('status', 'asc')!).map((g) => g.id)).toEqual([
- 'a-id',
- 'b-id',
- ]);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('status', 'asc')!).map((g) => g.id),
+ ).toEqual(['a-id', 'b-id']);
});
it('treats an empty-string generic value as empty and sorts it last', () => {
@@ -188,10 +203,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
makeGuest(2, { id: 'full', name: 'full', status: 'running' }),
];
// aVal '' -> aIsEmpty -> sorts last.
- expect([...guests].sort(createWorkloadSortComparator('status', 'asc')!).map((g) => g.id)).toEqual([
- 'full',
- 'empty',
- ]);
+ expect(
+ [...guests].sort(createWorkloadSortComparator('status', 'asc')!).map((g) => g.id),
+ ).toEqual(['full', 'empty']);
});
it('returns 0 only when numeric, name, and id are all equal', () => {
@@ -272,16 +286,31 @@ describe('workloadSelectors (branch coverage 2)', () => {
];
// workloadHostScopeId(pod) === '' would drop both; viewMode==='pod' skips the guard.
expect(
- filterWorkloads({ ...baseFilterParams, guests, viewMode: 'pod', selectedNode: 'worker-a' }).map(
- (g) => g.id,
- ),
+ filterWorkloads({
+ ...baseFilterParams,
+ guests,
+ viewMode: 'pod',
+ selectedNode: 'worker-a',
+ }).map((g) => g.id),
).toEqual(['pod-a', 'pod-b']);
});
it('filters by workloadHostScopeId when nodeScope is set in a non-pod view', () => {
const guests = [
- makeGuest(1, { id: 'vm-a', type: 'vm', workloadType: 'vm', instance: 'cluster-a', node: 'node-a' }),
- makeGuest(2, { id: 'vm-b', type: 'vm', workloadType: 'vm', instance: 'cluster-b', node: 'node-b' }),
+ makeGuest(1, {
+ id: 'vm-a',
+ type: 'vm',
+ workloadType: 'vm',
+ instance: 'cluster-a',
+ node: 'node-a',
+ }),
+ makeGuest(2, {
+ id: 'vm-b',
+ type: 'vm',
+ workloadType: 'vm',
+ instance: 'cluster-b',
+ node: 'node-b',
+ }),
];
expect(
filterWorkloads({
@@ -294,7 +323,13 @@ describe('workloadSelectors (branch coverage 2)', () => {
it('gives nodeScope precedence over hostHint (hostHint filter skipped when nodeScope set)', () => {
const guests = [
- makeGuest(1, { id: 'vm-a', type: 'vm', workloadType: 'vm', instance: 'cluster-a', node: 'node-a' }),
+ makeGuest(1, {
+ id: 'vm-a',
+ type: 'vm',
+ workloadType: 'vm',
+ instance: 'cluster-a',
+ node: 'node-a',
+ }),
makeGuest(2, {
id: 'app-a',
name: 'redis',
@@ -359,9 +394,12 @@ describe('workloadSelectors (branch coverage 2)', () => {
];
// hostHint set but viewMode==='pod' -> `viewMode !== 'pod'` false -> skipped; pod kept.
expect(
- filterWorkloads({ ...baseFilterParams, guests, viewMode: 'pod', selectedHostHint: 'nope' }).map(
- (g) => g.id,
- ),
+ filterWorkloads({
+ ...baseFilterParams,
+ guests,
+ viewMode: 'pod',
+ selectedHostHint: 'nope',
+ }).map((g) => g.id),
).toEqual(['pod-a']);
});
@@ -497,14 +535,27 @@ describe('workloadSelectors (branch coverage 2)', () => {
];
// viewMode 'all' -> cluster guard skipped -> both remain.
expect(
- filterWorkloads({ ...baseFilterParams, guests, selectedCluster: 'prod-cluster' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, selectedCluster: 'prod-cluster' }).map(
+ (g) => g.id,
+ ),
).toEqual(['vm-a', 'vm-b']);
});
it('keeps only container-typed workloads under the combined container view mode', () => {
const guests = [
- makeGuest(1, { id: 'app', type: 'app-container', workloadType: 'app-container', contextLabel: 'h' }),
- makeGuest(2, { id: 'lxc', type: 'lxc', workloadType: 'system-container', instance: 'i', node: 'n' }),
+ makeGuest(1, {
+ id: 'app',
+ type: 'app-container',
+ workloadType: 'app-container',
+ contextLabel: 'h',
+ }),
+ makeGuest(2, {
+ id: 'lxc',
+ type: 'lxc',
+ workloadType: 'system-container',
+ instance: 'i',
+ node: 'n',
+ }),
makeGuest(3, { id: 'vm', type: 'vm', workloadType: 'vm', instance: 'i', node: 'n' }),
makeGuest(4, {
id: 'pod',
@@ -561,7 +612,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
}),
];
expect(
- filterWorkloads({ ...baseFilterParams, guests, selectedPlatform: 'truenas' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, selectedPlatform: 'truenas' }).map(
+ (g) => g.id,
+ ),
).toEqual(['tn']);
});
@@ -618,7 +671,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
];
// isContainerWorkloadViewMode('all') === false -> filter skipped.
expect(
- filterWorkloads({ ...baseFilterParams, guests, containerRuntime: 'docker' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, containerRuntime: 'docker' }).map(
+ (g) => g.id,
+ ),
).toEqual(['c1', 'c2']);
});
@@ -708,7 +763,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
filterWorkloads({ ...baseFilterParams, guests, searchTerm: '-worker' }).map((g) => g.id),
).toEqual(['a', 'c']);
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'alpha, gamma' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'alpha, gamma' }).map(
+ (g) => g.id,
+ ),
).toEqual(['a', 'c']);
});
@@ -752,7 +809,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
];
// needle lowercased; candidate lowercased -> 'QUARANTINED' still matches.
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'QUARANTINED' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'QUARANTINED' }).map(
+ (g) => g.id,
+ ),
).toEqual(['g1']);
});
@@ -775,7 +834,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
];
// [].join(' ') -> '' -> String('').includes('uniquematch') is false.
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'uniquematch' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'uniquematch' }).map(
+ (g) => g.id,
+ ),
).toEqual(['scope']);
});
@@ -837,13 +898,19 @@ describe('workloadSelectors (branch coverage 2)', () => {
}),
];
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'registry.local' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'registry.local' }).map(
+ (g) => g.id,
+ ),
).toEqual(['img']);
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'payments-uniq' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'payments-uniq' }).map(
+ (g) => g.id,
+ ),
).toEqual(['ns']);
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'contextlabel-uniq' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'contextlabel-uniq' }).map(
+ (g) => g.id,
+ ),
).toEqual(['ctx']);
});
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov2.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov2.test.ts
index 745519343e..8db88f0bd8 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov2.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadSelectors.branchcov2.test.ts
@@ -49,8 +49,16 @@ describe('workloadSelectors (branch coverage 2)', () => {
const guests = [
makeGuest(1, { id: 'zz', name: 'zebra', disk: nullDisk }),
makeGuest(2, { id: 'aa', name: 'alpha', disk: nullDisk }),
- makeGuest(3, { id: 'mm', name: 'mid', disk: { total: 100, used: 20, free: 80, usage: 0.2 } }),
- makeGuest(4, { id: 'bb', name: 'bravo', disk: { total: 100, used: 90, free: 10, usage: 0.9 } }),
+ makeGuest(3, {
+ id: 'mm',
+ name: 'mid',
+ disk: { total: 100, used: 20, free: 80, usage: 0.2 },
+ }),
+ makeGuest(4, {
+ id: 'bb',
+ name: 'bravo',
+ disk: { total: 100, used: 90, free: 10, usage: 0.9 },
+ }),
];
const diskAsc = createWorkloadSortComparator('disk', 'asc');
@@ -273,7 +281,13 @@ describe('workloadSelectors (branch coverage 2)', () => {
const guests = [
makeGuest(1, { id: 'g1', name: 'numhost', vmid: 7777, status: 'running' }),
makeGuest(2, { id: 'g2', name: 'stathost', vmid: 1, status: 'quarantined' }),
- makeGuest(3, { id: 'g3', name: 'insthost', vmid: 2, status: 'running', instance: 'insttoken' }),
+ makeGuest(3, {
+ id: 'g3',
+ name: 'insthost',
+ vmid: 2,
+ status: 'running',
+ instance: 'insttoken',
+ }),
];
// vmid is a number candidate -> filtered into the String(value) match.
@@ -282,7 +296,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
).toEqual(['g1']);
// status candidate.
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'quarantined' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'quarantined' }).map(
+ (g) => g.id,
+ ),
).toEqual(['g2']);
// instance candidate.
expect(
@@ -316,7 +332,9 @@ describe('workloadSelectors (branch coverage 2)', () => {
];
expect(
- filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'uniquematch' }).map((g) => g.id),
+ filterWorkloads({ ...baseFilterParams, guests, searchTerm: 'uniquematch' }).map(
+ (g) => g.id,
+ ),
).toEqual(['scope-2']);
});
});
@@ -361,8 +379,20 @@ describe('workloadSelectors (branch coverage 2)', () => {
type: 'vm',
workloadType: 'vm',
}),
- makeGuest(3, { id: 'running', name: 'running', status: 'running', type: 'vm', workloadType: 'vm' }),
- makeGuest(4, { id: 'offline', name: 'offline', status: 'offline', type: 'vm', workloadType: 'vm' }),
+ makeGuest(3, {
+ id: 'running',
+ name: 'running',
+ status: 'running',
+ type: 'vm',
+ workloadType: 'vm',
+ }),
+ makeGuest(4, {
+ id: 'offline',
+ name: 'offline',
+ status: 'offline',
+ type: 'vm',
+ workloadType: 'vm',
+ }),
];
// '' and 'quarantined' are neither DEGRADED nor OFFLINE nor running, so the
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadTopology.branchcov2.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadTopology.branchcov2.test.ts
index 7b06a02372..19e1d0df3c 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadTopology.branchcov2.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadTopology.branchcov2.test.ts
@@ -96,7 +96,11 @@ describe('workloadTopology (branch coverage 2)', () => {
describe('getWorkloadDockerHostId', () => {
it('short-circuits to empty string for a non-app-container type', () => {
- const vm = makeGuest(1, { type: 'vm', workloadType: 'vm', dockerHostId: 'should-be-ignored' });
+ const vm = makeGuest(1, {
+ type: 'vm',
+ workloadType: 'vm',
+ dockerHostId: 'should-be-ignored',
+ });
// type !== 'app-container' -> guard returns '' before touching dockerHostId.
expect(getWorkloadDockerHostId(vm)).toBe('');
});
@@ -286,11 +290,7 @@ describe('workloadTopology (branch coverage 2)', () => {
instance: 'cluster-lxc',
contextLabel: 'ctx-lxc',
});
- expect(getWorkloadHostHintCandidates(lxc)).toEqual([
- 'node-lxc',
- 'cluster-lxc',
- 'ctx-lxc',
- ]);
+ expect(getWorkloadHostHintCandidates(lxc)).toEqual(['node-lxc', 'cluster-lxc', 'ctx-lxc']);
});
});
@@ -400,9 +400,7 @@ describe('workloadTopology (branch coverage 2)', () => {
});
// type === 'pod' -> else: dedupeTrimmed([getCanonicalWorkloadId(guest), guest.id]).
// getCanonicalWorkloadId returns guest.id for pods -> collapses to a single entry.
- expect(getWorkloadAlertResourceIdCandidates(pod)).toEqual([
- 'k8s:cluster-a:pod:pod-uid-1',
- ]);
+ expect(getWorkloadAlertResourceIdCandidates(pod)).toEqual(['k8s:cluster-a:pod:pod-uid-1']);
});
});
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.branchcov0712b.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.branchcov0712b.test.ts
index 6f2bde7dbe..6af2bdb9ae 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.branchcov0712b.test.ts
@@ -78,18 +78,16 @@ describe('resolveWorkloadsWorkloadTypeParam (branch coverage)', () => {
});
it('keeps the pod mode when namespace is set and the raw alias is "k8s"', () => {
- expect(
- resolveWorkloadsWorkloadTypeParam(params({ type: 'k8s', namespace: 'default' })),
- ).toBe('pod');
+ expect(resolveWorkloadsWorkloadTypeParam(params({ type: 'k8s', namespace: 'default' }))).toBe(
+ 'pod',
+ );
});
it('treats whitespace-only context/namespace as no scope', () => {
// Boolean(" ".trim()) === false for both fields, so the precedence guard
// is skipped and the resolved mode is returned unchanged.
expect(
- resolveWorkloadsWorkloadTypeParam(
- params({ type: 'vm', context: ' ', namespace: ' ' }),
- ),
+ resolveWorkloadsWorkloadTypeParam(params({ type: 'vm', context: ' ', namespace: ' ' })),
).toBe('vm');
});
});
@@ -155,9 +153,9 @@ describe('resolveWorkloadsWorkloadRuntimeParam (branch coverage)', () => {
it('reaches Branch 2 via the empty-type relevance path (!params.type.trim())', () => {
// type="": nextMode=null and the ternary returns false, but the
// `|| !params.type.trim()` disjunct flips runtimeRelevant to true.
- expect(
- resolveWorkloadsWorkloadRuntimeParam(params({ type: '', runtime: '' })),
- ).toStrictEqual({ forceViewMode: null, runtime: '', shouldApply: true });
+ expect(resolveWorkloadsWorkloadRuntimeParam(params({ type: '', runtime: '' }))).toStrictEqual(
+ { forceViewMode: null, runtime: '', shouldApply: true },
+ );
});
});
diff --git a/frontend-modern/src/components/Workloads/guestRowModel.tsx b/frontend-modern/src/components/Workloads/guestRowModel.tsx
index 2159cc084b..699a94247c 100644
--- a/frontend-modern/src/components/Workloads/guestRowModel.tsx
+++ b/frontend-modern/src/components/Workloads/guestRowModel.tsx
@@ -195,7 +195,14 @@ export const GUEST_COLUMNS: ColumnDef[] = [
{ id: 'vmid', label: 'ID', width: '45px', sortKey: 'vmid', kind: 'numeric-value' },
{ id: 'cpu', label: 'CPU', width: '140px', sortKey: 'cpu', kind: 'metric-bar' },
{ id: 'memory', label: 'Mem', width: '140px', sortKey: 'memory', kind: 'metric-bar' },
- { id: 'disk', label: 'Disk', width: '140px', toggleable: true, sortKey: 'disk', kind: 'metric-bar' },
+ {
+ id: 'disk',
+ label: 'Disk',
+ width: '140px',
+ toggleable: true,
+ sortKey: 'disk',
+ kind: 'metric-bar',
+ },
{
id: 'ip',
label: 'IP',
@@ -312,7 +319,13 @@ export const GUEST_COLUMNS: ColumnDef[] = [
id: 'aiContext',
label: 'AI Context',
icon: (
- <svg class="w-3.5 h-3.5 block" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
+ <svg
+ class="w-3.5 h-3.5 block"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ >
<path
stroke-linecap="round"
stroke-linejoin="round"
diff --git a/frontend-modern/src/components/Workloads/thresholdSliderModel.ts b/frontend-modern/src/components/Workloads/thresholdSliderModel.ts
index 2068920fea..80177a5e45 100644
--- a/frontend-modern/src/components/Workloads/thresholdSliderModel.ts
+++ b/frontend-modern/src/components/Workloads/thresholdSliderModel.ts
@@ -13,7 +13,10 @@ export interface ThresholdSliderProps {
export const DEFAULT_THRESHOLD_SLIDER_MIN = 0;
export const DEFAULT_THRESHOLD_SLIDER_MAX = 100;
-export function getThresholdSliderBounds(min?: number, max?: number): {
+export function getThresholdSliderBounds(
+ min?: number,
+ max?: number,
+): {
min: number;
max: number;
} {
diff --git a/frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts b/frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts
index 585953e0b7..33d64b6c29 100644
--- a/frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts
+++ b/frontend-modern/src/components/Workloads/useEnhancedCPUBarState.ts
@@ -1,9 +1,6 @@
import { createMemo } from 'solid-js';
import { useTooltip } from '@/hooks/useTooltip';
-import {
- buildEnhancedCPUBarPresentation,
- type EnhancedCPUBarProps,
-} from './enhancedCpuBarModel';
+import { buildEnhancedCPUBarPresentation, type EnhancedCPUBarProps } from './enhancedCpuBarModel';
export function useEnhancedCPUBarState(props: EnhancedCPUBarProps) {
const tip = useTooltip();
@@ -17,4 +14,3 @@ export function useEnhancedCPUBarState(props: EnhancedCPUBarProps) {
tooltipVisible: createMemo(() => tip.show()),
};
}
-
diff --git a/frontend-modern/src/components/Workloads/useMetricBarState.ts b/frontend-modern/src/components/Workloads/useMetricBarState.ts
index 52cd0c22f6..6348456b75 100644
--- a/frontend-modern/src/components/Workloads/useMetricBarState.ts
+++ b/frontend-modern/src/components/Workloads/useMetricBarState.ts
@@ -34,4 +34,3 @@ export function useMetricBarState(props: MetricBarProps) {
},
};
}
-
diff --git a/frontend-modern/src/components/Workloads/useStackedDiskBarState.ts b/frontend-modern/src/components/Workloads/useStackedDiskBarState.ts
index 2416b9b7df..18326305c4 100644
--- a/frontend-modern/src/components/Workloads/useStackedDiskBarState.ts
+++ b/frontend-modern/src/components/Workloads/useStackedDiskBarState.ts
@@ -1,9 +1,6 @@
import { createMemo, createSignal, onCleanup, onMount } from 'solid-js';
import { useTooltip } from '@/hooks/useTooltip';
-import {
- buildStackedDiskBarPresentation,
- type StackedDiskBarProps,
-} from './stackedDiskBarModel';
+import { buildStackedDiskBarPresentation, type StackedDiskBarProps } from './stackedDiskBarModel';
export function useStackedDiskBarState(props: StackedDiskBarProps) {
const tip = useTooltip();
diff --git a/frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts b/frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts
index 56c0437065..43d8b1e1ef 100644
--- a/frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts
+++ b/frontend-modern/src/components/Workloads/useStackedMemoryBarState.ts
@@ -11,9 +11,7 @@ export function useStackedMemoryBarState(props: StackedMemoryBarProps) {
let containerRef: HTMLDivElement | undefined;
let resizeObserver: ResizeObserver | undefined;
- const presentation = createMemo(() =>
- buildStackedMemoryBarPresentation(props, containerWidth()),
- );
+ const presentation = createMemo(() => buildStackedMemoryBarPresentation(props, containerWidth()));
onMount(() => {
if (!containerRef) {
@@ -45,4 +43,3 @@ export function useStackedMemoryBarState(props: StackedMemoryBarProps) {
tooltipVisible: createMemo(() => tip.show() && presentation().tooltipRows.length > 0),
};
}
-
diff --git a/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts b/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
index e9f62d1566..091e69bd0a 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts
@@ -25,7 +25,9 @@ export function useWorkloadSelectionState(options: UseWorkloadsSelectionStateOpt
const location = useLocation();
const [selectedGuestId, setSelectedGuestIdRaw] = createSignal<string | null>(null);
- const [selectedWorkloadGroupId, setSelectedWorkloadGroupIdRaw] = createSignal<string | null>(null);
+ const [selectedWorkloadGroupId, setSelectedWorkloadGroupIdRaw] = createSignal<string | null>(
+ null,
+ );
const [hoveredWorkloadId, setHoveredWorkloadId] = createSignal<string | null>(null);
const [hoveredWorkloadGroupScope, setHoveredWorkloadGroupScope] =
createSignal<SummarySeriesGroupScope | null>(null);
diff --git a/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts b/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
index 97ba4cf3bf..55cbf99be5 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadViewportSync.ts
@@ -9,20 +9,14 @@ interface WorkloadsWorkloadViewportSyncOptions {
tableBodyRef: Accessor<HTMLTableSectionElement | null>;
}
-export function useWorkloadViewportSync(
- options: WorkloadsWorkloadViewportSyncOptions,
-) {
+export function useWorkloadViewportSync(options: WorkloadsWorkloadViewportSyncOptions) {
const syncGuestWindowToViewport = () => {
if (!options.groupedWindowing.isWindowed() || typeof window === 'undefined') return;
const body = options.tableBodyRef();
if (!body) return;
const rect = body.getBoundingClientRect();
const scrollTop = Math.max(0, -rect.top);
- options.groupedWindowing.onScroll(
- scrollTop,
- window.innerHeight,
- options.rowHeight,
- );
+ options.groupedWindowing.onScroll(scrollTop, window.innerHeight, options.rowHeight);
};
createEffect(() => {
diff --git a/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts b/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
index 4eb5cfea41..557202e326 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsControlsState.ts
@@ -61,10 +61,7 @@ const workloadsStatusModeStorageKey = (scope: string | undefined): string => {
return trimmedScope ? `workloadsStatusMode:${trimmedScope}` : 'workloadsStatusMode';
};
-const saveWorkloadsStatusMode = (
- scope: string | undefined,
- value: WorkloadsStatusMode,
-): void => {
+const saveWorkloadsStatusMode = (scope: string | undefined, value: WorkloadsStatusMode): void => {
if (typeof window === 'undefined') return;
try {
window.localStorage.setItem(workloadsStatusModeStorageKey(scope), value);
@@ -98,8 +95,7 @@ export function useWorkloadsControlsState(options: WorkloadsControlsStateOptions
navigate(`${location.pathname}${query ? `?${query}` : ''}`, { replace: true });
};
- const search: Accessor<string> = () =>
- new URLSearchParams(location.search).get('q') ?? '';
+ const search: Accessor<string> = () => new URLSearchParams(location.search).get('q') ?? '';
const setSearch = (value: string): void => {
updateSearchParam((params) => {
if (value === '') {
diff --git a/frontend-modern/src/components/Workloads/workloadInventorySourceIssues.ts b/frontend-modern/src/components/Workloads/workloadInventorySourceIssues.ts
index 96707aa462..3da5826005 100644
--- a/frontend-modern/src/components/Workloads/workloadInventorySourceIssues.ts
+++ b/frontend-modern/src/components/Workloads/workloadInventorySourceIssues.ts
@@ -62,7 +62,7 @@ const credentialInvalid = (connection: Connection): boolean =>
const activeWorkloadSurfaces = (connection: Connection): string[] => {
const scope = connection.scope ?? {};
const scoped = Object.keys(scope).filter((surface) => scope[surface]);
- const surfaces = scoped.length > 0 ? scoped : connection.surfaces ?? [];
+ const surfaces = scoped.length > 0 ? scoped : (connection.surfaces ?? []);
const seen = new Set<string>();
const labels: string[] = [];
const orderedSurfaces = [...surfaces].sort((left, right) => {
diff --git a/frontend-modern/src/components/Workloads/workloadSelectionModel.ts b/frontend-modern/src/components/Workloads/workloadSelectionModel.ts
index 75edc3aec3..7c0b452153 100644
--- a/frontend-modern/src/components/Workloads/workloadSelectionModel.ts
+++ b/frontend-modern/src/components/Workloads/workloadSelectionModel.ts
@@ -1,6 +1,4 @@
-import {
- parseWorkloadsLinkSearch,
-} from '@/routing/resourceLinks';
+import { parseWorkloadsLinkSearch } from '@/routing/resourceLinks';
import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
import type { WorkloadGuest } from '@/types/workloads';
import { getCanonicalWorkloadId } from '@/utils/workloads';
diff --git a/frontend-modern/src/components/Workloads/workloadSelectors.ts b/frontend-modern/src/components/Workloads/workloadSelectors.ts
index 74fd7d64e7..5149ed5d54 100644
--- a/frontend-modern/src/components/Workloads/workloadSelectors.ts
+++ b/frontend-modern/src/components/Workloads/workloadSelectors.ts
@@ -3,11 +3,7 @@ import type { WorkloadGuest, ViewMode } from '@/types/workloads';
import type { WorkloadIOEmphasis } from './guestRowModel';
import { computeIOScale } from '@/components/Infrastructure/infrastructureSelectors';
import type { SummarySeriesGroupScope } from '@/components/shared/summaryCardInteraction';
-import {
- parseFilterStack,
- evaluateFilterStack,
- splitSearchExclusions,
-} from '@/utils/searchQuery';
+import { parseFilterStack, evaluateFilterStack, splitSearchExclusions } from '@/utils/searchQuery';
import { normalizeSourcePlatformQueryValue } from '@/utils/sourcePlatforms';
import { DEGRADED_HEALTH_STATUSES, OFFLINE_HEALTH_STATUSES } from '@/utils/status';
import { getNodeDisplayName } from '@/utils/nodes';
@@ -200,9 +196,7 @@ export const filterWorkloads = ({
}
if (exclusions.length > 0) {
- guests = guests.filter(
- (g) => !exclusions.some((term) => matchesWorkloadTextSearch(g, term)),
- );
+ guests = guests.filter((g) => !exclusions.some((term) => matchesWorkloadTextSearch(g, term)));
}
if (textSearches.length > 0) {
diff --git a/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx b/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx
index 3a025eb67e..c2539a7d37 100644
--- a/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx
+++ b/frontend-modern/src/components/__tests__/SecurityWarning.test.tsx
@@ -79,9 +79,7 @@ describe('SecurityWarning', () => {
expect(screen.getByText(/Security score:/i)).toBeInTheDocument();
});
- expect(
- screen.getByText(/public network access detected/i),
- ).toBeInTheDocument();
+ expect(screen.getByText(/public network access detected/i)).toBeInTheDocument();
const banner = screen.getByRole('status');
expect(banner).not.toHaveClass('fixed');
expect(screen.getByRole('link', { name: 'Learn More' })).toHaveAttribute(
diff --git a/frontend-modern/src/components/patrol/InvestigationMessages.tsx b/frontend-modern/src/components/patrol/InvestigationMessages.tsx
index 8305b9dc92..6b941d689d 100644
--- a/frontend-modern/src/components/patrol/InvestigationMessages.tsx
+++ b/frontend-modern/src/components/patrol/InvestigationMessages.tsx
@@ -40,7 +40,12 @@ export const InvestigationMessages: Component<InvestigationMessagesProps> = (pro
return (
<div class="mt-2">
- <Show when={!getInvestigationMessagesState(messages.loading, !!messages()?.length).empty && getInvestigationMessagesState(messages.loading, !!messages()?.length).text}>
+ <Show
+ when={
+ !getInvestigationMessagesState(messages.loading, !!messages()?.length).empty &&
+ getInvestigationMessagesState(messages.loading, !!messages()?.length).text
+ }
+ >
<div class="flex items-center gap-2 text-xs text-muted py-2">
<LoadingSpinner size="sm" />
{getInvestigationMessagesState(messages.loading, !!messages()?.length).text}
diff --git a/frontend-modern/src/components/patrol/InvestigationSection.tsx b/frontend-modern/src/components/patrol/InvestigationSection.tsx
index e610997859..65b8257bd1 100644
--- a/frontend-modern/src/components/patrol/InvestigationSection.tsx
+++ b/frontend-modern/src/components/patrol/InvestigationSection.tsx
@@ -200,7 +200,9 @@ export const InvestigationSection: Component<InvestigationSectionProps> = (props
<Show when={investigationRecord().confidenceLabel}>
<MetadataBadge
{...INVESTIGATION_BADGE_PROPS}
- tone={getInvestigationConfidenceBadgeTone(props.investigationRecord!.confidence ?? '')}
+ tone={getInvestigationConfidenceBadgeTone(
+ props.investigationRecord!.confidence ?? '',
+ )}
>
{investigationRecord().confidenceLabel}
</MetadataBadge>
@@ -284,9 +286,7 @@ export const InvestigationSection: Component<InvestigationSectionProps> = (props
<div class="text-[10px] font-medium uppercase text-muted">Rollback</div>
<Show
when={investigationRecord().rollbackSummaries.length > 0}
- fallback={
- <p class="mt-1 text-xs italic text-muted/70">Rollback not specified</p>
- }
+ fallback={<p class="mt-1 text-xs italic text-muted/70">Rollback not specified</p>}
>
<ul class="mt-1 space-y-1 text-xs text-muted">
<For each={investigationRecord().rollbackSummaries}>
diff --git a/frontend-modern/src/components/patrol/RunToolCallTrace.tsx b/frontend-modern/src/components/patrol/RunToolCallTrace.tsx
index 2d7e6f63e4..8805765c6a 100644
--- a/frontend-modern/src/components/patrol/RunToolCallTrace.tsx
+++ b/frontend-modern/src/components/patrol/RunToolCallTrace.tsx
@@ -65,7 +65,12 @@ const VerifiedIcon: Component<{ status: ToolCallVerificationStatus }> = (p) => {
viewBox="0 0 24 24"
aria-hidden="true"
>
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7" />
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2.5"
+ d="M5 13l4 4L19 7"
+ />
</svg>
);
}
@@ -88,7 +93,10 @@ const VerifiedIcon: Component<{ status: ToolCallVerificationStatus }> = (p) => {
);
}
return (
- <span class={`inline-block w-3 text-center font-mono text-xs ${verifiedIconClass(p.status)}`} aria-hidden="true">
+ <span
+ class={`inline-block w-3 text-center font-mono text-xs ${verifiedIconClass(p.status)}`}
+ aria-hidden="true"
+ >
–
</span>
);
diff --git a/frontend-modern/src/components/patrol/__tests__/RunHistoryPanel.test.tsx b/frontend-modern/src/components/patrol/__tests__/RunHistoryPanel.test.tsx
index 363a0acc5c..a10030b9f4 100644
--- a/frontend-modern/src/components/patrol/__tests__/RunHistoryPanel.test.tsx
+++ b/frontend-modern/src/components/patrol/__tests__/RunHistoryPanel.test.tsx
@@ -93,11 +93,7 @@ describe('RunHistoryPanel', () => {
/>
));
- expect(
- screen.getByText(
- 'This older check has no issue list.',
- ),
- ).toBeInTheDocument();
+ expect(screen.getByText('This older check has no issue list.')).toBeInTheDocument();
});
it('keeps older run snapshots behind an explicit expansion', () => {
diff --git a/frontend-modern/src/components/shared/Button.tsx b/frontend-modern/src/components/shared/Button.tsx
index 12fa273274..98292d275e 100644
--- a/frontend-modern/src/components/shared/Button.tsx
+++ b/frontend-modern/src/components/shared/Button.tsx
@@ -101,9 +101,7 @@ export function Button(props: ButtonProps) {
disabled={local.disabled || local.isLoading}
{...rest}
>
- {local.isLoading ? (
- <LoadingSpinner size="md" tone="current" class="-ml-1 mr-2" />
- ) : null}
+ {local.isLoading ? <LoadingSpinner size="md" tone="current" class="-ml-1 mr-2" /> : null}
{local.children}
</button>
);
diff --git a/frontend-modern/src/components/shared/CalloutCard.test.tsx b/frontend-modern/src/components/shared/CalloutCard.test.tsx
index 0b103036fc..e95c0e0f75 100644
--- a/frontend-modern/src/components/shared/CalloutCard.test.tsx
+++ b/frontend-modern/src/components/shared/CalloutCard.test.tsx
@@ -22,9 +22,7 @@ describe('CalloutCard', () => {
});
it('supports warning tone styling', () => {
- render(() => (
- <CalloutCard title="Warning" description="Act carefully" tone="warning" />
- ));
+ render(() => <CalloutCard title="Warning" description="Act carefully" tone="warning" />);
const description = screen.getByText('Act carefully');
expect(description.className).toContain('text-amber-800');
diff --git a/frontend-modern/src/components/shared/ContainerUpdateBadge.tsx b/frontend-modern/src/components/shared/ContainerUpdateBadge.tsx
index f2ee72f6d0..8c62bc1632 100644
--- a/frontend-modern/src/components/shared/ContainerUpdateBadge.tsx
+++ b/frontend-modern/src/components/shared/ContainerUpdateBadge.tsx
@@ -85,10 +85,15 @@ export const ContainerUpdateBadge: Component<ContainerUpdateBadgeProps> = (props
class="inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-xs font-medium bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300 cursor-help"
onMouseEnter={(e) => {
const rect = e.currentTarget.getBoundingClientRect();
- showTooltip(getContainerUpdateBadgeTooltip(props.updateStatus), rect.left + rect.width / 2, rect.top, {
- align: 'center',
- direction: 'up',
- });
+ showTooltip(
+ getContainerUpdateBadgeTooltip(props.updateStatus),
+ rect.left + rect.width / 2,
+ rect.top,
+ {
+ align: 'center',
+ direction: 'up',
+ },
+ );
}}
onMouseLeave={() => hideTooltip()}
>
@@ -104,10 +109,15 @@ export const ContainerUpdateBadge: Component<ContainerUpdateBadgeProps> = (props
aria-label={getContainerUpdateErrorTooltip(props.updateStatus)}
onMouseEnter={(e) => {
const rect = e.currentTarget.getBoundingClientRect();
- showTooltip(getContainerUpdateErrorTooltip(props.updateStatus), rect.left + rect.width / 2, rect.top, {
- align: 'center',
- direction: 'up',
- });
+ showTooltip(
+ getContainerUpdateErrorTooltip(props.updateStatus),
+ rect.left + rect.width / 2,
+ rect.top,
+ {
+ align: 'center',
+ direction: 'up',
+ },
+ );
}}
onMouseLeave={() => hideTooltip()}
>
@@ -121,10 +131,15 @@ export const ContainerUpdateBadge: Component<ContainerUpdateBadgeProps> = (props
aria-label={getContainerUpdateCurrentTooltip(props.updateStatus)}
onMouseEnter={(e) => {
const rect = e.currentTarget.getBoundingClientRect();
- showTooltip(getContainerUpdateCurrentTooltip(props.updateStatus), rect.left + rect.width / 2, rect.top, {
- align: 'center',
- direction: 'up',
- });
+ showTooltip(
+ getContainerUpdateCurrentTooltip(props.updateStatus),
+ rect.left + rect.width / 2,
+ rect.top,
+ {
+ align: 'center',
+ direction: 'up',
+ },
+ );
}}
onMouseLeave={() => hideTooltip()}
>
@@ -150,10 +165,15 @@ export const UpdateIcon: Component<UpdateIconProps> = (props) => {
class="inline-flex items-center justify-center w-5 h-5 rounded-full bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300 cursor-help"
onMouseEnter={(e) => {
const rect = e.currentTarget.getBoundingClientRect();
- showTooltip(getUpdateIconTooltip(props.updateStatus), rect.left + rect.width / 2, rect.top, {
- align: 'center',
- direction: 'up',
- });
+ showTooltip(
+ getUpdateIconTooltip(props.updateStatus),
+ rect.left + rect.width / 2,
+ rect.top,
+ {
+ align: 'center',
+ direction: 'up',
+ },
+ );
}}
onMouseLeave={() => hideTooltip()}
>
@@ -227,7 +247,9 @@ export const UpdateButton: Component<UpdateButtonProps> = (props) => {
</Switch>
</Show>
<Show when={!props.compact}>
- <span class={!state.settingsLoaded() ? 'opacity-50' : ''}>{state.buttonLabel()}</span>
+ <span class={!state.settingsLoaded() ? 'opacity-50' : ''}>
+ {state.buttonLabel()}
+ </span>
</Show>
</button>
<ActionReviewDialog
@@ -238,7 +260,11 @@ export const UpdateButton: Component<UpdateButtonProps> = (props) => {
</div>
}
>
- <ContainerUpdateBadge updateStatus={props.updateStatus} compact={props.compact} showCurrent={true} />
+ <ContainerUpdateBadge
+ updateStatus={props.updateStatus}
+ compact={props.compact}
+ showCurrent={true}
+ />
</Show>
</Show>
);
diff --git a/frontend-modern/src/components/shared/DiscoveryLoadingFallback.tsx b/frontend-modern/src/components/shared/DiscoveryLoadingFallback.tsx
index 78f833a814..3812e7c903 100644
--- a/frontend-modern/src/components/shared/DiscoveryLoadingFallback.tsx
+++ b/frontend-modern/src/components/shared/DiscoveryLoadingFallback.tsx
@@ -14,9 +14,7 @@ export function DiscoveryLoadingFallback(props: DiscoveryLoadingFallbackProps):
<div
role="status"
aria-live="polite"
- class={['flex items-center justify-center py-8', props.class ?? '']
- .filter(Boolean)
- .join(' ')}
+ class={['flex items-center justify-center py-8', props.class ?? ''].filter(Boolean).join(' ')}
>
<LoadingSpinner size="xl" tone="info" />
<span class="ml-2 text-sm text-muted">{text()}</span>
diff --git a/frontend-modern/src/components/shared/DiscoveryReadinessBadge.tsx b/frontend-modern/src/components/shared/DiscoveryReadinessBadge.tsx
index 7aab042bca..a2df66ac52 100644
--- a/frontend-modern/src/components/shared/DiscoveryReadinessBadge.tsx
+++ b/frontend-modern/src/components/shared/DiscoveryReadinessBadge.tsx
@@ -26,7 +26,9 @@ const toneClasses: Record<DiscoveryReadinessPresentation['tone'], string> = {
'border-border bg-surface-alt text-muted dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300',
};
-const iconForState = (state: DiscoveryReadinessPresentation['state']): Component<{ class?: string }> => {
+const iconForState = (
+ state: DiscoveryReadinessPresentation['state'],
+): Component<{ class?: string }> => {
switch (state) {
case 'fresh':
return CheckCircle2Icon;
diff --git a/frontend-modern/src/components/shared/EnvironmentLockBadge.tsx b/frontend-modern/src/components/shared/EnvironmentLockBadge.tsx
index 301acf1e06..e8b6c71c91 100644
--- a/frontend-modern/src/components/shared/EnvironmentLockBadge.tsx
+++ b/frontend-modern/src/components/shared/EnvironmentLockBadge.tsx
@@ -13,7 +13,9 @@ interface EnvironmentLockBadgeProps {
export const EnvironmentLockBadge: Component<EnvironmentLockBadgeProps> = (props) => (
<span
- class={props.class ? `${ENVIRONMENT_LOCK_BADGE_CLASS} ${props.class}` : ENVIRONMENT_LOCK_BADGE_CLASS}
+ class={
+ props.class ? `${ENVIRONMENT_LOCK_BADGE_CLASS} ${props.class}` : ENVIRONMENT_LOCK_BADGE_CLASS
+ }
title={getEnvironmentLockTitle(props.envVar)}
>
{props.icon ? <props.icon class="w-3 h-3" /> : null}
diff --git a/frontend-modern/src/components/shared/FeatureGateSection.tsx b/frontend-modern/src/components/shared/FeatureGateSection.tsx
index 24ca449100..fedc46686b 100644
--- a/frontend-modern/src/components/shared/FeatureGateSection.tsx
+++ b/frontend-modern/src/components/shared/FeatureGateSection.tsx
@@ -1,8 +1,5 @@
import { Show, type Component, type JSX } from 'solid-js';
-import {
- UpgradeButtonLink,
- type UpgradeButtonTone,
-} from '@/components/shared/UpgradeLink';
+import { UpgradeButtonLink, type UpgradeButtonTone } from '@/components/shared/UpgradeLink';
import { UPGRADE_ACTION_LABEL } from '@/utils/upgradePresentation';
import type { UpgradeDestination } from '@/utils/upgradeNavigation';
@@ -48,10 +45,7 @@ export const FeatureGateSection: Component<FeatureGateSectionProps> = (props) =>
</div>
<Show when={props.showUpgradePrompts}>
<div class="flex flex-col sm:flex-row items-center gap-2">
- <UpgradeButtonLink
- destination={props.upgradeDestination}
- tone={props.upgradeButtonTone}
- >
+ <UpgradeButtonLink destination={props.upgradeDestination} tone={props.upgradeButtonTone}>
{props.upgradeLabel ?? UPGRADE_ACTION_LABEL}
</UpgradeButtonLink>
</div>
diff --git a/frontend-modern/src/components/shared/FilterBar/FilterBar.tsx b/frontend-modern/src/components/shared/FilterBar/FilterBar.tsx
index e343b5a7b3..76ac626a09 100644
--- a/frontend-modern/src/components/shared/FilterBar/FilterBar.tsx
+++ b/frontend-modern/src/components/shared/FilterBar/FilterBar.tsx
@@ -83,8 +83,7 @@ export const FilterBar: Component<FilterBarProps> = (props) => {
hasDesktopViewOptions() ||
hasClearableState());
const showInlineRow = () => props.isMobile() && mobileExpanded() && inlineFilters().length > 0;
- const showDesktopChipRow = () =>
- !props.isMobile() && activeMenuFilters().length > 0;
+ const showDesktopChipRow = () => !props.isMobile() && activeMenuFilters().length > 0;
const showMobileBody = () => props.isMobile() && mobileExpanded();
const showChipRow = () =>
showDesktopChipRow() ||
diff --git a/frontend-modern/src/components/shared/FilterBar/FilterChip.tsx b/frontend-modern/src/components/shared/FilterBar/FilterChip.tsx
index bdb117ab61..f0d65e3c33 100644
--- a/frontend-modern/src/components/shared/FilterBar/FilterChip.tsx
+++ b/frontend-modern/src/components/shared/FilterBar/FilterChip.tsx
@@ -11,18 +11,13 @@ import {
import XIcon from 'lucide-solid/icons/x';
import CheckIcon from 'lucide-solid/icons/check';
import SearchIcon from 'lucide-solid/icons/search';
-import {
- clearFilter,
- formatFilterChipValue,
- type FilterDef,
-} from './filterCatalog';
+import { clearFilter, formatFilterChipValue, type FilterDef } from './filterCatalog';
interface FilterChipProps {
filter: FilterDef;
}
-const matchesQuery = (label: string, query: string): boolean =>
- label.toLowerCase().includes(query);
+const matchesQuery = (label: string, query: string): boolean => label.toLowerCase().includes(query);
export const FilterChip: Component<FilterChipProps> = (props) => {
const [open, setOpen] = createSignal(false);
@@ -113,9 +108,7 @@ export const FilterChip: Component<FilterChipProps> = (props) => {
on(open, (isOpen) => {
if (!isOpen) return;
const options = filteredOptions();
- const selectedIndex = options.findIndex(
- (option) => option.value === props.filter.value(),
- );
+ const selectedIndex = options.findIndex((option) => option.value === props.filter.value());
if (selectedIndex >= 0) setActiveIndex(selectedIndex);
}),
);
@@ -168,9 +161,7 @@ export const FilterChip: Component<FilterChipProps> = (props) => {
<div class="max-h-64 overflow-y-auto py-1">
<Show
when={filteredOptions().length > 0}
- fallback={
- <div class="px-3 py-2 text-xs text-muted">No values match.</div>
- }
+ fallback={<div class="px-3 py-2 text-xs text-muted">No values match.</div>}
>
<For each={filteredOptions()}>
{(option, index) => {
diff --git a/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx b/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx
index 83922bbd19..07d04758aa 100644
--- a/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx
+++ b/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx
@@ -11,8 +11,9 @@ interface SavedViewsMenuProps {
}
export const SavedViewsMenu: Component<SavedViewsMenuProps> = (props) => {
- const { views, saveCurrent, removeView, applyView, setDefault, clearDefault } =
- useSavedViews(props.storageKey);
+ const { views, saveCurrent, removeView, applyView, setDefault, clearDefault } = useSavedViews(
+ props.storageKey,
+ );
const [open, setOpen] = createSignal(false);
const [savePromptOpen, setSavePromptOpen] = createSignal(false);
const [name, setName] = createSignal('');
@@ -108,9 +109,8 @@ export const SavedViewsMenu: Component<SavedViewsMenuProps> = (props) => {
</button>
<Show when={views().length === 0}>
<div class="px-3 py-3 text-xs text-muted">
- No saved views yet. Set the filters you want, then click
- "Save current view as..." to name and recall this slice
- later.
+ No saved views yet. Set the filters you want, then click "Save current view
+ as..." to name and recall this slice later.
</div>
</Show>
<Show when={views().length > 0}>
@@ -153,11 +153,7 @@ export const SavedViewsMenu: Component<SavedViewsMenuProps> = (props) => {
}
>
<StarIcon
- class={
- view.isDefault === true
- ? 'h-3 w-3 fill-current'
- : 'h-3 w-3'
- }
+ class={view.isDefault === true ? 'h-3 w-3 fill-current' : 'h-3 w-3'}
/>
</button>
<button
diff --git a/frontend-modern/src/components/shared/FilterBar/__tests__/filterCatalog.branchcov0713.test.ts b/frontend-modern/src/components/shared/FilterBar/__tests__/filterCatalog.branchcov0713.test.ts
index 8d8eb5cef9..17e8a2b1a8 100644
--- a/frontend-modern/src/components/shared/FilterBar/__tests__/filterCatalog.branchcov0713.test.ts
+++ b/frontend-modern/src/components/shared/FilterBar/__tests__/filterCatalog.branchcov0713.test.ts
@@ -24,7 +24,9 @@ const makeFilter = (overrides: {
setValue: vi.fn(),
defaultValue: '',
options: () => overrides.options ?? [],
- ...(overrides.formatChipValue !== undefined ? { formatChipValue: overrides.formatChipValue } : {}),
+ ...(overrides.formatChipValue !== undefined
+ ? { formatChipValue: overrides.formatChipValue }
+ : {}),
});
describe('formatFilterChipValue branch coverage', () => {
@@ -90,7 +92,9 @@ describe('formatFilterChipValue branch coverage', () => {
});
expect(formatFilterChipValue(filter)).toBe('override');
- expect(formatChipValue).toHaveBeenCalledWith('no-such-option', [{ value: 'all', label: 'All' }]);
+ expect(formatChipValue).toHaveBeenCalledWith('no-such-option', [
+ { value: 'all', label: 'All' },
+ ]);
});
});
diff --git a/frontend-modern/src/components/shared/FilterBar/useSavedViews.ts b/frontend-modern/src/components/shared/FilterBar/useSavedViews.ts
index de7f5ff3ef..f8a738b88c 100644
--- a/frontend-modern/src/components/shared/FilterBar/useSavedViews.ts
+++ b/frontend-modern/src/components/shared/FilterBar/useSavedViews.ts
@@ -104,8 +104,7 @@ export function useSavedViews(key: string): UseSavedViewsResult {
const saveCurrent = (name: string): SavedView | null => {
const trimmed = name.trim();
if (trimmed === '') return null;
- const query =
- typeof window !== 'undefined' ? window.location.search.replace(/^\?/, '') : '';
+ const query = typeof window !== 'undefined' ? window.location.search.replace(/^\?/, '') : '';
const view: SavedView = {
id: generateId(),
name: trimmed,
@@ -135,9 +134,7 @@ export function useSavedViews(key: string): UseSavedViewsResult {
};
const clearDefault = (): void => {
- const next = views().map((view) =>
- view.isDefault ? { ...view, isDefault: false } : view,
- );
+ const next = views().map((view) => (view.isDefault ? { ...view, isDefault: false } : view));
setViews(next);
writeStored(key, next);
};
diff --git a/frontend-modern/src/components/shared/FormTextarea.test.tsx b/frontend-modern/src/components/shared/FormTextarea.test.tsx
index d7ba09f894..8bd17a4e97 100644
--- a/frontend-modern/src/components/shared/FormTextarea.test.tsx
+++ b/frontend-modern/src/components/shared/FormTextarea.test.tsx
@@ -9,9 +9,7 @@ describe('FormTextarea', () => {
});
it('owns the label relationship for native textareas', () => {
- render(() => (
- <FormTextarea label="Notes" value="Initial notes" data-testid="notes-field" />
- ));
+ render(() => <FormTextarea label="Notes" value="Initial notes" data-testid="notes-field" />);
const textarea = screen.getByLabelText('Notes');
expect(textarea).toBe(screen.getByTestId('notes-field'));
diff --git a/frontend-modern/src/components/shared/GroupedTableModeSegmentedControl.tsx b/frontend-modern/src/components/shared/GroupedTableModeSegmentedControl.tsx
index 994dcde42b..6965b932db 100644
--- a/frontend-modern/src/components/shared/GroupedTableModeSegmentedControl.tsx
+++ b/frontend-modern/src/components/shared/GroupedTableModeSegmentedControl.tsx
@@ -9,15 +9,17 @@ export const GROUPED_TABLE_MODE_ARIA_LABEL = 'Group by';
export const GROUPED_TABLE_MODE_GROUPED_TITLE = 'Grouped table view';
export const GROUPED_TABLE_MODE_FLAT_TITLE = 'Flat list view';
-interface GroupedTableModeSegmentedControlProps
- extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
+interface GroupedTableModeSegmentedControlProps extends Omit<
+ JSX.HTMLAttributes<HTMLDivElement>,
+ 'onChange'
+> {
value: GroupedTableMode;
onChange: (value: GroupedTableMode) => void;
}
-export const GroupedTableModeSegmentedControl: Component<
- GroupedTableModeSegmentedControlProps
-> = (props) => {
+export const GroupedTableModeSegmentedControl: Component<GroupedTableModeSegmentedControlProps> = (
+ props,
+) => {
const [local, divProps] = splitProps(props, ['value', 'onChange']);
return (
diff --git a/frontend-modern/src/components/shared/HelpIcon.tsx b/frontend-modern/src/components/shared/HelpIcon.tsx
index 20effc3c37..fcb37b04c8 100644
--- a/frontend-modern/src/components/shared/HelpIcon.tsx
+++ b/frontend-modern/src/components/shared/HelpIcon.tsx
@@ -72,7 +72,9 @@ export const HelpIcon: Component<HelpIconProps> = (props) => {
<ul class="space-y-1 text-[11px]">
{helpContent.examples!.map((example) => (
<li class="flex items-start gap-1.5">
- <span class="text-muted mt-0.5 select-none" aria-hidden="true">-</span>
+ <span class="text-muted mt-0.5 select-none" aria-hidden="true">
+ -
+ </span>
<span class="text-muted">{example}</span>
</li>
))}
diff --git a/frontend-modern/src/components/shared/HistoryChart.tsx b/frontend-modern/src/components/shared/HistoryChart.tsx
index e9892e601d..2a04365f63 100644
--- a/frontend-modern/src/components/shared/HistoryChart.tsx
+++ b/frontend-modern/src/components/shared/HistoryChart.tsx
@@ -20,7 +20,13 @@ export const HistoryChart: Component<HistoryChartProps> = (props) => {
<div
class={`flex flex-col h-full ${props.compact ? '' : 'bg-surface rounded-md shadow-sm border border-border p-4'}`}
>
- <HistoryChartHeader chart={chart} compact={props.compact} hideSelector={props.hideSelector} label={props.label} unit={props.unit} />
+ <HistoryChartHeader
+ chart={chart}
+ compact={props.compact}
+ hideSelector={props.hideSelector}
+ label={props.label}
+ unit={props.unit}
+ />
<div
class={`relative flex-1 w-full ${props.compact ? 'min-h-[120px]' : 'min-h-[200px]'}`}
diff --git a/frontend-modern/src/components/shared/PulseDataGrid.tsx b/frontend-modern/src/components/shared/PulseDataGrid.tsx
index a40ba6b873..d0afa6befd 100644
--- a/frontend-modern/src/components/shared/PulseDataGrid.tsx
+++ b/frontend-modern/src/components/shared/PulseDataGrid.tsx
@@ -17,7 +17,7 @@ import {
} from './pulseDataGridModel';
import { usePulseDataGridState } from './usePulseDataGridState';
-export type { PulseDataGridProps, } from './pulseDataGridModel';
+export type { PulseDataGridProps } from './pulseDataGridModel';
/**
* A standardized, responsive datagrid component for Pulse.
diff --git a/frontend-modern/src/components/shared/SearchInputEnhancements.tsx b/frontend-modern/src/components/shared/SearchInputEnhancements.tsx
index 71c7a766ee..a1afb27478 100644
--- a/frontend-modern/src/components/shared/SearchInputEnhancements.tsx
+++ b/frontend-modern/src/components/shared/SearchInputEnhancements.tsx
@@ -61,11 +61,7 @@ interface SearchInputHistoryDropdownProps {
export const SearchInputHistoryDropdown: Component<SearchInputHistoryDropdownProps> = (props) => (
<Show when={props.state.hasHistory() && props.state.isHistoryOpen()}>
- <div
- ref={props.state.setHistoryMenuRef}
- class={SEARCH_HISTORY_MENU_CLASS}
- role="listbox"
- >
+ <div ref={props.state.setHistoryMenuRef} class={SEARCH_HISTORY_MENU_CLASS} role="listbox">
<Show
when={props.state.searchHistory().length > 0}
fallback={
diff --git a/frontend-modern/src/components/shared/SelectionCardGroup.tsx b/frontend-modern/src/components/shared/SelectionCardGroup.tsx
index 0ad3dbdb7e..9bf12690f3 100644
--- a/frontend-modern/src/components/shared/SelectionCardGroup.tsx
+++ b/frontend-modern/src/components/shared/SelectionCardGroup.tsx
@@ -9,10 +9,7 @@ import {
} from './selectionCardGroupModel';
import { useSelectionCardGroupState } from './useSelectionCardGroupState';
-export type {
- SelectionCardGroupProps,
- SelectionCardOption,
-} from './selectionCardGroupModel';
+export type { SelectionCardGroupProps, SelectionCardOption } from './selectionCardGroupModel';
export function SelectionCardGroup<T extends string | number>(props: SelectionCardGroupProps<T>) {
const selectionCardGroup = useSelectionCardGroupState(props);
diff --git a/frontend-modern/src/components/shared/SettingsLoadingSkeleton.tsx b/frontend-modern/src/components/shared/SettingsLoadingSkeleton.tsx
index 99f2f2204d..efdc34c7f3 100644
--- a/frontend-modern/src/components/shared/SettingsLoadingSkeleton.tsx
+++ b/frontend-modern/src/components/shared/SettingsLoadingSkeleton.tsx
@@ -83,13 +83,7 @@ export function SettingsLoadingSkeleton(props: SettingsLoadingSkeletonProps) {
{ gap: 'md' as SettingsSkeletonGap, label: 'Loading settings', padding: 'none' as const },
props,
);
- const [local, rest] = splitProps(merged, [
- 'children',
- 'class',
- 'gap',
- 'label',
- 'padding',
- ]);
+ const [local, rest] = splitProps(merged, ['children', 'class', 'gap', 'label', 'padding']);
return (
<div
@@ -138,7 +132,12 @@ export function SettingsSkeletonCard(props: SettingsSkeletonCardProps) {
export function SettingsSkeletonMetricGrid(props: SettingsSkeletonMetricGridProps) {
const merged = mergeProps(
- { columns: 'four' as SettingsSkeletonColumns, count: 4, labelWidth: 'w-20', valueWidth: 'w-28' },
+ {
+ columns: 'four' as SettingsSkeletonColumns,
+ count: 4,
+ labelWidth: 'w-20',
+ valueWidth: 'w-28',
+ },
props,
);
@@ -189,11 +188,7 @@ export function SettingsSkeletonTable(props: SettingsSkeletonTableProps) {
const table = (
<div class="overflow-hidden rounded-md border border-border">
- <SettingsSkeletonBlock
- class={merged.headerClass}
- radius="none"
- surface="muted"
- />
+ <SettingsSkeletonBlock class={merged.headerClass} radius="none" surface="muted" />
<For each={range(merged.rows)}>
{() => (
<div class="border-t border-border-subtle px-3 py-3">
diff --git a/frontend-modern/src/components/shared/StatusIndicatorBadge.tsx b/frontend-modern/src/components/shared/StatusIndicatorBadge.tsx
index 97179c12ec..ea8a7adb5e 100644
--- a/frontend-modern/src/components/shared/StatusIndicatorBadge.tsx
+++ b/frontend-modern/src/components/shared/StatusIndicatorBadge.tsx
@@ -54,12 +54,7 @@ export function StatusIndicatorBadge(props: StatusIndicatorBadgeProps): JSX.Elem
return (
<span class={className()} title={props.title}>
{props.dot ? (
- <StatusDot
- variant={variant()}
- size="xs"
- ariaHidden={true}
- class="translate-y-[0.5px]"
- />
+ <StatusDot variant={variant()} size="xs" ariaHidden={true} class="translate-y-[0.5px]" />
) : null}
{label()}
</span>
diff --git a/frontend-modern/src/components/shared/TlsVerificationWarningBanner.tsx b/frontend-modern/src/components/shared/TlsVerificationWarningBanner.tsx
index 3f2ab8e413..44f06fb2b3 100644
--- a/frontend-modern/src/components/shared/TlsVerificationWarningBanner.tsx
+++ b/frontend-modern/src/components/shared/TlsVerificationWarningBanner.tsx
@@ -12,14 +12,9 @@ export function TlsVerificationWarningBanner(props: TlsVerificationWarningBanner
const [local, rest] = splitProps(props, ['subject', 'remediation', 'class']);
return (
- <div
- role="alert"
- class={`${bannerClass} ${local.class ?? ''}`.trim()}
- {...rest}
- >
- <span class="font-medium">TLS verification disabled.</span>{' '}
- Pulse will accept untrusted certificates for {local.subject}. Use this only for
- controlled lab environments.{' '}
+ <div role="alert" class={`${bannerClass} ${local.class ?? ''}`.trim()} {...rest}>
+ <span class="font-medium">TLS verification disabled.</span> Pulse will accept untrusted
+ certificates for {local.subject}. Use this only for controlled lab environments.{' '}
{local.remediation ?? 'Install a trusted certificate before using this in production.'}
</div>
);
diff --git a/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts b/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts
index 31a897b7ef..372dda5bb7 100644
--- a/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/TypeColumn.guardrails.test.ts
@@ -17,7 +17,7 @@ describe('type column guardrails', () => {
expect(typeColumnContractSource).toContain("TYPE_COLUMN_ID = 'type'");
expect(typeColumnContractSource).toContain("TYPE_COLUMN_LABEL = 'Type'");
expect(typeColumnContractSource).toContain("TYPE_COLUMN_SORT_KEY = 'type'");
- expect(typeColumnContractSource).toContain("TYPE_COLUMN_SORTABLE = true");
+ expect(typeColumnContractSource).toContain('TYPE_COLUMN_SORTABLE = true');
expect(typeColumnContractSource).toContain("TYPE_COLUMN_PRIORITY = 'essential'");
expect(typeColumnContractSource).toContain("TYPE_COLUMN_WIDTH = '60px'");
expect(typeColumnContractSource).toContain("TYPE_COLUMN_MIN_WIDTH = '60px'");
@@ -39,7 +39,7 @@ describe('type column guardrails', () => {
expect(guestRowModelSource).toContain('createVisibleCanonicalTypeColumn()');
expect(guestRowModelSource).not.toContain('createCanonicalTypeColumn');
expect(guestRowModelSource).not.toMatch(INLINE_TYPE_COLUMN_PATTERN);
- expect(guestRowModelSource).not.toContain("defaultVisibility:");
+ expect(guestRowModelSource).not.toContain('defaultVisibility:');
});
it('limits runtime Type columns to the known allowlist', () => {
@@ -62,9 +62,7 @@ describe('type column guardrails', () => {
.map(([path]) => path)
.sort();
- expect(typeColumnUsers).toEqual([
- '../Workloads/guestRowModel.tsx',
- ]);
+ expect(typeColumnUsers).toEqual(['../Workloads/guestRowModel.tsx']);
expect(inlineTypeColumnUsers).toEqual([]);
});
@@ -73,8 +71,7 @@ describe('type column guardrails', () => {
const runtimeEntries = Object.entries(sourceFiles).filter(
([path]) => !path.endsWith('.test.ts') && !path.endsWith('.test.tsx'),
);
- const hiddenTypeArrayPattern =
- /useColumnVisibility\([\s\S]*?\[\s*['"]type['"][\s\S]*?\]/;
+ const hiddenTypeArrayPattern = /useColumnVisibility\([\s\S]*?\[\s*['"]type['"][\s\S]*?\]/;
const pageLevelTypeDefaultHiddenUsers = runtimeEntries
.filter(([, source]) => hiddenTypeArrayPattern.test(source))
@@ -88,25 +85,21 @@ describe('type column guardrails', () => {
const runtimeEntries = Object.entries(sourceFiles).filter(
([path]) => !path.endsWith('.test.ts') && !path.endsWith('.test.tsx'),
);
- const typeColumnDefinitionImportPattern =
- /from\s*['"]@\/utils\/typeColumnDefinition['"]/;
+ const typeColumnDefinitionImportPattern = /from\s*['"]@\/utils\/typeColumnDefinition['"]/;
const directHelperImportUsers = runtimeEntries
.filter(([, source]) => typeColumnDefinitionImportPattern.test(source))
.map(([path]) => path)
.sort();
- expect(directHelperImportUsers).toEqual([
- '../Workloads/guestRowModel.tsx',
- ]);
+ expect(directHelperImportUsers).toEqual(['../Workloads/guestRowModel.tsx']);
});
it('limits direct type column contract imports to the shared helper and label presentation util', () => {
const runtimeEntries = Object.entries(sourceFiles).filter(
([path]) => !path.endsWith('.test.ts') && !path.endsWith('.test.tsx'),
);
- const typeColumnContractImportPattern =
- /from\s*['"]@\/utils\/typeColumnContract['"]/;
+ const typeColumnContractImportPattern = /from\s*['"]@\/utils\/typeColumnContract['"]/;
const directContractImportUsers = runtimeEntries
.filter(([, source]) => typeColumnContractImportPattern.test(source))
diff --git a/frontend-modern/src/components/shared/UpgradeLink.tsx b/frontend-modern/src/components/shared/UpgradeLink.tsx
index 544ad37a7a..6134373b7f 100644
--- a/frontend-modern/src/components/shared/UpgradeLink.tsx
+++ b/frontend-modern/src/components/shared/UpgradeLink.tsx
@@ -32,11 +32,7 @@ const getUpgradeTarget = (destination: UpgradeDestination, target?: string) => {
return target;
};
-const getUpgradeRel = (
- destination: UpgradeDestination,
- target?: string,
- rel?: string,
-) => {
+const getUpgradeRel = (destination: UpgradeDestination, target?: string, rel?: string) => {
if (rel) return rel;
if ((getUpgradeNewTab(destination) || target === '_blank') && !destination.preserveOpener) {
return 'noopener noreferrer';
@@ -48,9 +44,7 @@ const getUpgradeButtonVariant = (tone: UpgradeButtonTone): ButtonVariant =>
tone === 'warning' ? 'warning' : 'primaryFlat';
const getUpgradeButtonClass = (mobileFullWidth: boolean, className?: string) =>
- [mobileFullWidth ? 'w-full sm:w-auto' : 'w-auto', 'gap-2', className]
- .filter(Boolean)
- .join(' ');
+ [mobileFullWidth ? 'w-full sm:w-auto' : 'w-auto', 'gap-2', className].filter(Boolean).join(' ');
export const UpgradeLink: Component<UpgradeLinkProps> = (props) => {
const [local, others] = splitProps(props, ['destination', 'rel', 'target']);
@@ -65,16 +59,8 @@ export const UpgradeLink: Component<UpgradeLinkProps> = (props) => {
};
return (
- <Show
- when={useHardLink()}
- fallback={<A {...others} href={local.destination.href} />}
- >
- <a
- {...others}
- href={local.destination.href}
- target={target()}
- rel={rel()}
- />
+ <Show when={useHardLink()} fallback={<A {...others} href={local.destination.href} />}>
+ <a {...others} href={local.destination.href} target={target()} rel={rel()} />
</Show>
);
};
diff --git a/frontend-modern/src/components/shared/__tests__/ContainerUpdateBadge.test.tsx b/frontend-modern/src/components/shared/__tests__/ContainerUpdateBadge.test.tsx
index 375f625afe..ee6e0240cb 100644
--- a/frontend-modern/src/components/shared/__tests__/ContainerUpdateBadge.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/ContainerUpdateBadge.test.tsx
@@ -3,15 +3,11 @@ import { cleanup, render, screen } from '@solidjs/testing-library';
import containerUpdateBadgeSource from '@/components/shared/ContainerUpdateBadge.tsx?raw';
import containerUpdateBadgeModelSource from '@/components/shared/containerUpdateBadgeModel.ts?raw';
import containerUpdateButtonStateSource from '@/components/shared/useContainerUpdateButtonState.ts?raw';
-import {
- ContainerUpdateBadge,
- UpdateButton,
-} from '@/components/shared/ContainerUpdateBadge';
+import { ContainerUpdateBadge, UpdateButton } from '@/components/shared/ContainerUpdateBadge';
import { getUpdatePlanErrorMessage } from '@/components/shared/containerUpdateBadgeModel';
vi.mock('@/api/monitoring', () => ({
- MonitoringAPI: {
- },
+ MonitoringAPI: {},
}));
vi.mock('@/stores/containerUpdates', () => ({
@@ -39,9 +35,7 @@ describe('ContainerUpdateBadge', () => {
expect(containerUpdateBadgeSource).not.toContain('createSignal');
expect(containerUpdateButtonStateSource).toContain('ResourceActionsAPI.planAction');
- expect(containerUpdateButtonStateSource).not.toContain(
- 'MonitoringAPI.updateDockerContainer',
- );
+ expect(containerUpdateButtonStateSource).not.toContain('MonitoringAPI.updateDockerContainer');
expect(containerUpdateButtonStateSource).toContain('markContainerQueued');
expect(containerUpdateButtonStateSource).toContain('createSignal');
expect(containerUpdateButtonStateSource).toContain(
diff --git a/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx b/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx
index 927b651716..02ec995d6d 100644
--- a/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx
@@ -57,7 +57,9 @@ describe('HistoryChart', () => {
expect(historyChartSource).toContain('HistoryChartHeader');
expect(historyChartSource).toContain('HistoryChartOverlay');
expect(historyChartSource).toContain('HistoryChartTooltip');
- expect(historyChartOverlaySource).toContain("import { LoadingSpinner } from './LoadingSpinner'");
+ expect(historyChartOverlaySource).toContain(
+ "import { LoadingSpinner } from './LoadingSpinner'",
+ );
expect(historyChartOverlaySource).toContain(
'<LoadingSpinner size="xl" tone="info" label="Loading history" />',
);
diff --git a/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx b/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
index ccacb2f1f5..38ef1f53a3 100644
--- a/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx
@@ -121,10 +121,46 @@ describe('MobileNavBar', () => {
it('keeps Actions named, reachable, and route-correct among monitor-first destinations', () => {
const onUtilityClick = vi.fn();
const utilityTabs = [
- { id: 'settings' as const, label: 'Settings', route: '/settings', tooltip: 'Settings', badge: null, count: undefined, breakdown: undefined, icon: SettingsIcon },
- { id: 'ai' as const, label: 'Patrol', route: '/patrol', tooltip: 'Patrol', badge: null, count: undefined, breakdown: undefined, icon: PatrolIcon },
- { id: 'actions' as const, label: 'Actions', route: '/actions', tooltip: 'Review actions', badge: null, count: undefined, breakdown: undefined, icon: ActionsIcon },
- { id: 'alerts' as const, label: 'Alerts', route: '/alerts', tooltip: 'Alerts', badge: null, count: undefined, breakdown: undefined, icon: AlertsIcon },
+ {
+ id: 'settings' as const,
+ label: 'Settings',
+ route: '/settings',
+ tooltip: 'Settings',
+ badge: null,
+ count: undefined,
+ breakdown: undefined,
+ icon: SettingsIcon,
+ },
+ {
+ id: 'ai' as const,
+ label: 'Patrol',
+ route: '/patrol',
+ tooltip: 'Patrol',
+ badge: null,
+ count: undefined,
+ breakdown: undefined,
+ icon: PatrolIcon,
+ },
+ {
+ id: 'actions' as const,
+ label: 'Actions',
+ route: '/actions',
+ tooltip: 'Review actions',
+ badge: null,
+ count: undefined,
+ breakdown: undefined,
+ icon: ActionsIcon,
+ },
+ {
+ id: 'alerts' as const,
+ label: 'Alerts',
+ route: '/alerts',
+ tooltip: 'Alerts',
+ badge: null,
+ count: undefined,
+ breakdown: undefined,
+ icon: AlertsIcon,
+ },
];
const { container } = render(() => (
@@ -139,22 +175,23 @@ describe('MobileNavBar', () => {
const navList = screen.getByRole('tablist', { name: 'Mobile navigation' });
const actionsButton = within(navList).getByRole('button', { name: 'Actions' });
- expect(Array.from(container.querySelectorAll('button[data-tab-id]')).map((button) => button.getAttribute('data-tab-id'))).toEqual([
- 'alerts',
- 'actions',
- 'ai',
- 'settings',
- ]);
+ expect(
+ Array.from(container.querySelectorAll('button[data-tab-id]')).map((button) =>
+ button.getAttribute('data-tab-id'),
+ ),
+ ).toEqual(['alerts', 'actions', 'ai', 'settings']);
expect(actionsButton).toHaveAttribute('data-tab-id', 'actions');
expect(actionsButton).toHaveAttribute('type', 'button');
actionsButton.focus();
expect(actionsButton).toHaveFocus();
fireEvent.click(actionsButton);
- expect(onUtilityClick).toHaveBeenCalledWith(expect.objectContaining({
- id: 'actions',
- label: 'Actions',
- route: '/actions',
- }));
+ expect(onUtilityClick).toHaveBeenCalledWith(
+ expect.objectContaining({
+ id: 'actions',
+ label: 'Actions',
+ route: '/actions',
+ }),
+ );
});
it('allows inactive platform tabs to render without an active mobile tab', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/Table.test.tsx b/frontend-modern/src/components/shared/__tests__/Table.test.tsx
index d508c15993..3983b41933 100644
--- a/frontend-modern/src/components/shared/__tests__/Table.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/Table.test.tsx
@@ -2,7 +2,14 @@ import { render, screen } from '@solidjs/testing-library';
import { describe, expect, it } from 'vitest';
import tableSource from '@/components/shared/Table.tsx?raw';
-import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/shared/Table';
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/shared/Table';
describe('TableBody', () => {
it('keeps the shared table wrapper CSP-safe', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/TooltipPortal.test.tsx b/frontend-modern/src/components/shared/__tests__/TooltipPortal.test.tsx
index e9f5324d64..628719a9ae 100644
--- a/frontend-modern/src/components/shared/__tests__/TooltipPortal.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/TooltipPortal.test.tsx
@@ -40,7 +40,9 @@ describe('TooltipPortal', () => {
expect(document.body.querySelector('[data-tooltip-portal="true"]')).not.toBeNull();
});
- const tooltip = document.body.querySelector('[data-tooltip-portal="true"]') as HTMLElement | null;
+ const tooltip = document.body.querySelector(
+ '[data-tooltip-portal="true"]',
+ ) as HTMLElement | null;
const portal = tooltip?.closest('foreignObject');
expect(tooltip?.textContent).toContain('Memory Composition');
expect(Number.parseFloat(portal?.getAttribute('x') ?? '0')).toBeGreaterThan(0);
@@ -98,10 +100,12 @@ describe('TooltipPortal', () => {
});
it('repositions while the portal stays visible and coordinates keep changing', async () => {
- vi.spyOn(window, 'requestAnimationFrame').mockImplementation((callback: FrameRequestCallback) => {
- callback(0);
- return 1;
- });
+ vi.spyOn(window, 'requestAnimationFrame').mockImplementation(
+ (callback: FrameRequestCallback) => {
+ callback(0);
+ return 1;
+ },
+ );
vi.spyOn(HTMLDivElement.prototype, 'getBoundingClientRect').mockReturnValue({
width: 180,
diff --git a/frontend-modern/src/components/shared/__tests__/buttonModel.branchcov0712.test.ts b/frontend-modern/src/components/shared/__tests__/buttonModel.branchcov0712.test.ts
index 27cb8e1744..aed983d926 100644
--- a/frontend-modern/src/components/shared/__tests__/buttonModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/buttonModel.branchcov0712.test.ts
@@ -28,33 +28,19 @@ describe('buttonModel.branchcov2', () => {
// Drives the `options: ButtonClassOptions = {}` default-parameter arm
// and both `??` right arms (variant -> 'secondary', size -> 'md').
expect(getButtonClass()).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_VARIANT_CLASSES.secondary,
- BUTTON_SIZE_CLASSES.md,
- ].join(' '),
+ [BUTTON_BASE_CLASS, BUTTON_VARIANT_CLASSES.secondary, BUTTON_SIZE_CLASSES.md].join(' '),
);
});
it('uses the ?? right arms for variant and size when called with an empty options object', () => {
expect(getButtonClass({})).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_VARIANT_CLASSES.secondary,
- BUTTON_SIZE_CLASSES.md,
- ].join(' '),
+ [BUTTON_BASE_CLASS, BUTTON_VARIANT_CLASSES.secondary, BUTTON_SIZE_CLASSES.md].join(' '),
);
});
it('selects the explicit variant and size when provided (?? left arms)', () => {
- expect(
- getButtonClass({ variant: 'primary', size: 'lg' }),
- ).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_VARIANT_CLASSES.primary,
- BUTTON_SIZE_CLASSES.lg,
- ].join(' '),
+ expect(getButtonClass({ variant: 'primary', size: 'lg' })).toBe(
+ [BUTTON_BASE_CLASS, BUTTON_VARIANT_CLASSES.primary, BUTTON_SIZE_CLASSES.lg].join(' '),
);
});
@@ -75,11 +61,7 @@ describe('buttonModel.branchcov2', () => {
'outline',
])('resolves the %s variant from BUTTON_VARIANT_CLASSES', (variant) => {
expect(getButtonClass({ variant })).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_VARIANT_CLASSES[variant],
- BUTTON_SIZE_CLASSES.md,
- ].join(' '),
+ [BUTTON_BASE_CLASS, BUTTON_VARIANT_CLASSES[variant], BUTTON_SIZE_CLASSES.md].join(' '),
);
});
@@ -95,11 +77,7 @@ describe('buttonModel.branchcov2', () => {
'iconMd',
])('resolves the %s size from BUTTON_SIZE_CLASSES', (size) => {
expect(getButtonClass({ size })).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_VARIANT_CLASSES.secondary,
- BUTTON_SIZE_CLASSES[size],
- ].join(' '),
+ [BUTTON_BASE_CLASS, BUTTON_VARIANT_CLASSES.secondary, BUTTON_SIZE_CLASSES[size]].join(' '),
);
});
@@ -118,11 +96,7 @@ describe('buttonModel.branchcov2', () => {
// Defensive branch: empty string is falsy and must not contribute a
// trailing space to the joined output.
expect(getButtonClass({ class: '' })).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_VARIANT_CLASSES.secondary,
- BUTTON_SIZE_CLASSES.md,
- ].join(' '),
+ [BUTTON_BASE_CLASS, BUTTON_VARIANT_CLASSES.secondary, BUTTON_SIZE_CLASSES.md].join(' '),
);
});
@@ -132,27 +106,19 @@ describe('buttonModel.branchcov2', () => {
// 'undefined' token or double space appears.
const bogus = 'not-a-real-variant' as unknown as ButtonVariant;
expect(getButtonClass({ variant: bogus })).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_SIZE_CLASSES.md,
- ].join(' '),
+ [BUTTON_BASE_CLASS, BUTTON_SIZE_CLASSES.md].join(' '),
);
});
it('drops an unknown size lookup (undefined) via .filter(Boolean)', () => {
const bogus = 'not-a-real-size' as unknown as ButtonSize;
expect(getButtonClass({ size: bogus })).toBe(
- [
- BUTTON_BASE_CLASS,
- BUTTON_VARIANT_CLASSES.secondary,
- ].join(' '),
+ [BUTTON_BASE_CLASS, BUTTON_VARIANT_CLASSES.secondary].join(' '),
);
});
it('combines an explicit variant, size, and class together', () => {
- expect(
- getButtonClass({ variant: 'danger', size: 'icon', class: 'rounded-full' }),
- ).toBe(
+ expect(getButtonClass({ variant: 'danger', size: 'icon', class: 'rounded-full' })).toBe(
[
BUTTON_BASE_CLASS,
BUTTON_VARIANT_CLASSES.danger,
@@ -186,9 +152,7 @@ describe('buttonModel.branchcov2', () => {
});
it('selects the explicit variant and size when provided (?? left arms)', () => {
- expect(
- getCopyValueButtonClass({ variant: 'accent', size: 'sm' }),
- ).toBe(
+ expect(getCopyValueButtonClass({ variant: 'accent', size: 'sm' })).toBe(
[
COPY_VALUE_BUTTON_BASE_CLASS,
COPY_VALUE_BUTTON_VARIANT_CLASSES.accent,
@@ -247,27 +211,19 @@ describe('buttonModel.branchcov2', () => {
it('drops an unknown variant lookup (undefined) via .filter(Boolean)', () => {
const bogus = 'nope' as unknown as CopyValueButtonVariant;
expect(getCopyValueButtonClass({ variant: bogus })).toBe(
- [
- COPY_VALUE_BUTTON_BASE_CLASS,
- COPY_VALUE_BUTTON_SIZE_CLASSES.md,
- ].join(' '),
+ [COPY_VALUE_BUTTON_BASE_CLASS, COPY_VALUE_BUTTON_SIZE_CLASSES.md].join(' '),
);
});
it('drops an unknown size lookup (undefined) via .filter(Boolean)', () => {
const bogus = 'xl' as unknown as CopyValueButtonSize;
expect(getCopyValueButtonClass({ size: bogus })).toBe(
- [
- COPY_VALUE_BUTTON_BASE_CLASS,
- COPY_VALUE_BUTTON_VARIANT_CLASSES.neutral,
- ].join(' '),
+ [COPY_VALUE_BUTTON_BASE_CLASS, COPY_VALUE_BUTTON_VARIANT_CLASSES.neutral].join(' '),
);
});
it('combines an explicit variant, size, and class together', () => {
- expect(
- getCopyValueButtonClass({ variant: 'chip', size: 'chip', class: 'tag-cls' }),
- ).toBe(
+ expect(getCopyValueButtonClass({ variant: 'chip', size: 'chip', class: 'tag-cls' })).toBe(
[
COPY_VALUE_BUTTON_BASE_CLASS,
COPY_VALUE_BUTTON_VARIANT_CLASSES.chip,
@@ -302,9 +258,7 @@ describe('buttonModel.branchcov2', () => {
});
it('selects the explicit tone and size when provided (?? left arms)', () => {
- expect(
- getActionIconButtonClass({ tone: 'primary', size: 'md' }),
- ).toBe(
+ expect(getActionIconButtonClass({ tone: 'primary', size: 'md' })).toBe(
[
ACTION_ICON_BUTTON_BASE_CLASS,
ACTION_ICON_BUTTON_TONE_CLASSES.primary,
@@ -373,27 +327,19 @@ describe('buttonModel.branchcov2', () => {
it('drops an unknown tone lookup (undefined) via .filter(Boolean)', () => {
const bogus = 'hyper' as unknown as ActionIconButtonTone;
expect(getActionIconButtonClass({ tone: bogus })).toBe(
- [
- ACTION_ICON_BUTTON_BASE_CLASS,
- ACTION_ICON_BUTTON_SIZE_CLASSES.sm,
- ].join(' '),
+ [ACTION_ICON_BUTTON_BASE_CLASS, ACTION_ICON_BUTTON_SIZE_CLASSES.sm].join(' '),
);
});
it('drops an unknown size lookup (undefined) via .filter(Boolean)', () => {
const bogus = '3xl' as unknown as ActionIconButtonSize;
expect(getActionIconButtonClass({ size: bogus })).toBe(
- [
- ACTION_ICON_BUTTON_BASE_CLASS,
- ACTION_ICON_BUTTON_TONE_CLASSES.neutral,
- ].join(' '),
+ [ACTION_ICON_BUTTON_BASE_CLASS, ACTION_ICON_BUTTON_TONE_CLASSES.neutral].join(' '),
);
});
it('combines an explicit tone, size, and class together', () => {
- expect(
- getActionIconButtonClass({ tone: 'danger', size: 'xs', class: 'ring-2' }),
- ).toBe(
+ expect(getActionIconButtonClass({ tone: 'danger', size: 'xs', class: 'ring-2' })).toBe(
[
ACTION_ICON_BUTTON_BASE_CLASS,
ACTION_ICON_BUTTON_TONE_CLASSES.danger,
diff --git a/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0712.test.ts b/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0712.test.ts
index 164384562e..bf6c911d78 100644
--- a/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0712.test.ts
@@ -187,10 +187,7 @@ describe('commandPaletteModel.branchcov2', () => {
shortcut: 'g k',
keywords: ['k8s'],
});
- const result = filterCommandPaletteCommands(
- [proxmox, docker, k8s],
- 'docker',
- );
+ const result = filterCommandPaletteCommands([proxmox, docker, k8s], 'docker');
expect(result).toStrictEqual([docker]);
});
diff --git a/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0713.test.ts b/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0713.test.ts
index 4cc9cbb458..4139ded6ad 100644
--- a/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0713.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/commandPaletteModel.branchcov0713.test.ts
@@ -300,7 +300,10 @@ describe('commandPaletteModel.branchcov0713', () => {
});
const navIds = commands
.map((c) => c.id)
- .filter((id) => id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id));
+ .filter(
+ (id) =>
+ id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id),
+ );
expect(navIds).toStrictEqual([]);
});
});
@@ -315,7 +318,10 @@ describe('commandPaletteModel.branchcov0713', () => {
});
const platformIds = commands
.map((c) => c.id)
- .filter((id) => id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id));
+ .filter(
+ (id) =>
+ id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id),
+ );
expect(platformIds).toStrictEqual(['nav-proxmox']);
});
@@ -328,7 +334,10 @@ describe('commandPaletteModel.branchcov0713', () => {
});
const platformIds = commands
.map((c) => c.id)
- .filter((id) => id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id));
+ .filter(
+ (id) =>
+ id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id),
+ );
expect(platformIds).toStrictEqual(['nav-docker']);
});
@@ -342,7 +351,10 @@ describe('commandPaletteModel.branchcov0713', () => {
});
const platformIds = commands
.map((c) => c.id)
- .filter((id) => id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id));
+ .filter(
+ (id) =>
+ id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id),
+ );
expect(platformIds).toStrictEqual(['nav-kubernetes', 'nav-kubernetes-workloads']);
});
@@ -355,7 +367,10 @@ describe('commandPaletteModel.branchcov0713', () => {
});
const platformIds = commands
.map((c) => c.id)
- .filter((id) => id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id));
+ .filter(
+ (id) =>
+ id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id),
+ );
expect(platformIds).toStrictEqual(['nav-truenas']);
});
@@ -369,7 +384,10 @@ describe('commandPaletteModel.branchcov0713', () => {
});
const platformIds = commands
.map((c) => c.id)
- .filter((id) => id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id));
+ .filter(
+ (id) =>
+ id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id),
+ );
expect(platformIds).toStrictEqual(['nav-vmware', 'nav-vmware-networks']);
});
@@ -382,7 +400,10 @@ describe('commandPaletteModel.branchcov0713', () => {
});
const platformIds = commands
.map((c) => c.id)
- .filter((id) => id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id));
+ .filter(
+ (id) =>
+ id.startsWith('nav-') && !['nav-alerts', 'nav-patrol', 'nav-settings'].includes(id),
+ );
expect(platformIds).toStrictEqual(['nav-standalone']);
});
});
diff --git a/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov0717.test.ts b/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov0717.test.ts
index df385c90c6..1edd90d741 100644
--- a/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov0717.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov0717.test.ts
@@ -93,9 +93,9 @@ describe('containerUpdateBadgeModel.branchcov', () => {
});
it('returns false when an error is present alongside updateAvailable === false (right operand of && is false)', () => {
- expect(
- hasContainerUpdateCurrent(makeStatus({ updateAvailable: false, error: 'x' })),
- ).toBe(false);
+ expect(hasContainerUpdateCurrent(makeStatus({ updateAvailable: false, error: 'x' }))).toBe(
+ false,
+ );
});
it('returns false when updateStatus is undefined (optional-chain / left-operand arm)', () => {
@@ -122,9 +122,7 @@ describe('containerUpdateBadgeModel.branchcov', () => {
});
it('falls back to "Unknown error" when updateStatus itself is undefined', () => {
- expect(getContainerUpdateErrorTooltip(undefined)).toBe(
- 'Update check failed: Unknown error',
- );
+ expect(getContainerUpdateErrorTooltip(undefined)).toBe('Update check failed: Unknown error');
});
it('falls back to "Unknown error" when error is an empty string (|| right arm, falsy string)', () => {
@@ -152,15 +150,15 @@ describe('containerUpdateBadgeModel.branchcov', () => {
});
it('appends a 12-char digest preview when currentDigest is present', () => {
- expect(
- getContainerUpdateCurrentTooltip(makeStatus({ currentDigest: LONG_DIGEST })),
- ).toBe('Image is current\nDigest: sha256:01234...');
+ expect(getContainerUpdateCurrentTooltip(makeStatus({ currentDigest: LONG_DIGEST }))).toBe(
+ 'Image is current\nDigest: sha256:01234...',
+ );
});
it('uses the full digest when it is shorter than 12 chars (slice no-op arm)', () => {
- expect(
- getContainerUpdateCurrentTooltip(makeStatus({ currentDigest: 'abc' })),
- ).toBe('Image is current\nDigest: abc...');
+ expect(getContainerUpdateCurrentTooltip(makeStatus({ currentDigest: 'abc' }))).toBe(
+ 'Image is current\nDigest: abc...',
+ );
});
});
@@ -191,20 +189,12 @@ describe('containerUpdateBadgeModel.branchcov', () => {
it('coerces an empty-string digest to "unknown" (|| right arm of getDigestPreview)', () => {
// Empty string is falsy: `(''.slice(0,19)) || 'unknown'` -> 'unknown'.
expect(
- getContainerUpdateBadgeTooltip(
- makeStatus({ currentDigest: '', latestDigest: '' }),
- ),
- ).toBe(
- 'Image update available\nCurrent: unknown...\nLatest: unknown...',
- );
+ getContainerUpdateBadgeTooltip(makeStatus({ currentDigest: '', latestDigest: '' })),
+ ).toBe('Image update available\nCurrent: unknown...\nLatest: unknown...');
});
it('mixes a present currentDigest with an absent latestDigest', () => {
- expect(
- getContainerUpdateBadgeTooltip(
- makeStatus({ currentDigest: LONG_DIGEST }),
- ),
- ).toBe(
+ expect(getContainerUpdateBadgeTooltip(makeStatus({ currentDigest: LONG_DIGEST }))).toBe(
'Image update available\nCurrent: sha256:0123456789ab...\nLatest: unknown...',
);
});
@@ -217,12 +207,8 @@ describe('containerUpdateBadgeModel.branchcov', () => {
it('returns the full multi-line message with 12-char previews when updateStatus is present', () => {
expect(
- getUpdateIconTooltip(
- makeStatus({ currentDigest: LONG_DIGEST, latestDigest: LONG_DIGEST }),
- ),
- ).toBe(
- 'Update available\nCurrent: sha256:01234...\nLatest: sha256:01234...',
- );
+ getUpdateIconTooltip(makeStatus({ currentDigest: LONG_DIGEST, latestDigest: LONG_DIGEST })),
+ ).toBe('Update available\nCurrent: sha256:01234...\nLatest: sha256:01234...');
});
it('returns "unknown" previews when updateStatus is present but digests are absent', () => {
@@ -251,10 +237,9 @@ describe('containerUpdateBadgeModel.branchcov', () => {
it('returns the red cursor-help "error" classes', () => {
expect(getUpdateButtonClass('error')).toBe(
- [
- BASE_CLASS,
- 'bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300 cursor-help',
- ].join(' '),
+ [BASE_CLASS, 'bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300 cursor-help'].join(
+ ' ',
+ ),
);
});
@@ -404,9 +389,9 @@ describe('containerUpdateBadgeModel.branchcov', () => {
});
it('falls back to errorMessage when storeState is absent', () => {
- expect(
- getUpdateButtonTooltip({ state: 'error', errorMessage: 'timeout' }),
- ).toBe('✗ Update failed: timeout');
+ expect(getUpdateButtonTooltip({ state: 'error', errorMessage: 'timeout' })).toBe(
+ '✗ Update failed: timeout',
+ );
});
it('falls back to errorMessage when storeState is present but has no message', () => {
@@ -421,9 +406,7 @@ describe('containerUpdateBadgeModel.branchcov', () => {
});
it('falls back to "Unknown error" when neither storeState.message nor errorMessage is set', () => {
- expect(getUpdateButtonTooltip({ state: 'error' })).toBe(
- '✗ Update failed: Unknown error',
- );
+ expect(getUpdateButtonTooltip({ state: 'error' })).toBe('✗ Update failed: Unknown error');
});
});
@@ -441,15 +424,13 @@ describe('containerUpdateBadgeModel.branchcov', () => {
latestDigest: LONG_DIGEST,
}),
}),
- ).toBe(
- 'Click to review and update\nCurrent: sha256:01234...\nLatest: sha256:01234...',
- );
+ ).toBe('Click to review and update\nCurrent: sha256:01234...\nLatest: sha256:01234...');
});
it('returns "unknown" previews when updateStatus is present but digests are absent', () => {
- expect(
- getUpdateButtonTooltip({ state: 'idle', updateStatus: makeStatus({}) }),
- ).toBe('Click to review and update\nCurrent: unknown...\nLatest: unknown...');
+ expect(getUpdateButtonTooltip({ state: 'idle', updateStatus: makeStatus({}) })).toBe(
+ 'Click to review and update\nCurrent: unknown...\nLatest: unknown...',
+ );
});
it('routes an unknown state value (with no updateStatus) to the default early-return arm', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov2.test.ts b/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov2.test.ts
index 24736541aa..1179911b14 100644
--- a/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/containerUpdateBadgeModel.branchcov2.test.ts
@@ -111,9 +111,9 @@ describe('containerUpdateBadgeModel.branchcov2', () => {
});
it('defaults step to "Processing..." and elapsed to 0 when storeState is missing (updating)', () => {
- expect(
- getUpdateButtonTooltip({ state: 'updating', now: 100_000 }),
- ).toBe('Processing... (0s)');
+ expect(getUpdateButtonTooltip({ state: 'updating', now: 100_000 })).toBe(
+ 'Processing... (0s)',
+ );
});
it('uses storeState.message and computes elapsed seconds when elapsed <= 60', () => {
@@ -204,9 +204,7 @@ describe('containerUpdateBadgeModel.branchcov2', () => {
});
it('returns "Update container" for the default state when updateStatus is absent', () => {
- expect(getUpdateButtonTooltip({ state: 'idle', now: 1000 })).toBe(
- 'Update container',
- );
+ expect(getUpdateButtonTooltip({ state: 'idle', now: 1000 })).toBe('Update container');
});
it('truncates digests to 12 chars for the default state when updateStatus is present', () => {
@@ -226,12 +224,7 @@ describe('containerUpdateBadgeModel.branchcov2', () => {
describe('getUpdateButtonLabel', () => {
it('short-circuits to "Update" when settingsLoaded is false, regardless of state', () => {
- const states: UpdateState[] = [
- 'updating',
- 'success',
- 'error',
- 'idle',
- ];
+ const states: UpdateState[] = ['updating', 'success', 'error', 'idle'];
for (const state of states) {
expect(getUpdateButtonLabel(state, false)).toBe('Update');
}
@@ -286,9 +279,7 @@ describe('containerUpdateBadgeModel.branchcov2', () => {
// icon, current, and button-default tooltip tests.
describe('getDigestPreview (via public callers)', () => {
it('returns "unknown" for an undefined digest (badge tooltip, undefined status)', () => {
- expect(getContainerUpdateBadgeTooltip(undefined)).toContain(
- 'Current: unknown...',
- );
+ expect(getContainerUpdateBadgeTooltip(undefined)).toContain('Current: unknown...');
});
it('returns the full digest when it is shorter than the preview length', () => {
@@ -307,20 +298,14 @@ describe('containerUpdateBadgeModel.branchcov2', () => {
currentDigest: LONG_DIGEST,
latestDigest: LONG_DIGEST,
});
- expect(getContainerUpdateBadgeTooltip(status)).toContain(
- `Current: ${DIGEST_FIRST_19}...`,
- );
- expect(getUpdateIconTooltip(status)).toContain(
- `Current: ${DIGEST_FIRST_12}...`,
- );
+ expect(getContainerUpdateBadgeTooltip(status)).toContain(`Current: ${DIGEST_FIRST_19}...`);
+ expect(getUpdateIconTooltip(status)).toContain(`Current: ${DIGEST_FIRST_12}...`);
});
});
describe('getContainerUpdateErrorTooltip', () => {
it('falls back to "Unknown error" when updateStatus is undefined', () => {
- expect(getContainerUpdateErrorTooltip(undefined)).toBe(
- 'Update check failed: Unknown error',
- );
+ expect(getContainerUpdateErrorTooltip(undefined)).toBe('Update check failed: Unknown error');
});
it('falls back to "Unknown error" when error is absent on a defined status', () => {
@@ -338,9 +323,7 @@ describe('containerUpdateBadgeModel.branchcov2', () => {
it('falls back to "Unknown error" for an empty-string error (|| falsy arm)', () => {
const status = makeUpdateStatus({ error: '' });
- expect(getContainerUpdateErrorTooltip(status)).toBe(
- 'Update check failed: Unknown error',
- );
+ expect(getContainerUpdateErrorTooltip(status)).toBe('Update check failed: Unknown error');
});
});
@@ -350,9 +333,7 @@ describe('containerUpdateBadgeModel.branchcov2', () => {
});
it('takes the early return when currentDigest is absent', () => {
- expect(getContainerUpdateCurrentTooltip(makeUpdateStatus())).toBe(
- 'Image is current',
- );
+ expect(getContainerUpdateCurrentTooltip(makeUpdateStatus())).toBe('Image is current');
});
it('takes the early return for an empty-string currentDigest (falsy guard)', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/dialogModel.branchcov0712.test.ts b/frontend-modern/src/components/shared/__tests__/dialogModel.branchcov0712.test.ts
index 1762abb1f5..0ce55ca255 100644
--- a/frontend-modern/src/components/shared/__tests__/dialogModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/dialogModel.branchcov0712.test.ts
@@ -95,9 +95,7 @@ describe('getDialogPanelClass', () => {
it('appends a provided panelClass after the modal branch', () => {
// Exercises: layout === 'drawer-right' (false), panelClass ?? left arm (provided).
- expect(getDialogPanelClass('modal', 'max-w-2xl')).toBe(
- `${BASE} ${MODAL_BRANCH} max-w-2xl`,
- );
+ expect(getDialogPanelClass('modal', 'max-w-2xl')).toBe(`${BASE} ${MODAL_BRANCH} max-w-2xl`);
});
it('treats an empty-string panelClass as a present value, dropping the max-w-lg fallback (?? left arm)', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts b/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts
index f656772778..4d10738a28 100644
--- a/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/historyChartModel.branchcov2.test.ts
@@ -14,12 +14,12 @@ import {
getHistoryChartYAxisLabels,
} from '@/components/shared/historyChartModel';
-const pt = (
- timestamp: number,
- value: number,
- min: number,
- max: number,
-): AggregatedMetricPoint => ({ timestamp, value, min, max });
+const pt = (timestamp: number, value: number, min: number, max: number): AggregatedMetricPoint => ({
+ timestamp,
+ value,
+ min,
+ max,
+});
describe('formatHistoryChartTooltipValue', () => {
it('formats percentage units with one decimal', () => {
@@ -96,8 +96,18 @@ describe('getHistoryChartDataMin', () => {
});
it('falls back to point.value when min is null', () => {
- const nullMin = { timestamp: 1, value: 7, min: null, max: null } as unknown as AggregatedMetricPoint;
- const value = { timestamp: 2, value: 3, min: null, max: null } as unknown as AggregatedMetricPoint;
+ const nullMin = {
+ timestamp: 1,
+ value: 7,
+ min: null,
+ max: null,
+ } as unknown as AggregatedMetricPoint;
+ const value = {
+ timestamp: 2,
+ value: 3,
+ min: null,
+ max: null,
+ } as unknown as AggregatedMetricPoint;
expect(getHistoryChartDataMin([nullMin, value])).toBe(3);
});
});
@@ -118,8 +128,18 @@ describe('getHistoryChartDataMax', () => {
});
it('falls back to point.value when max is null', () => {
- const low = { timestamp: 1, value: 7, min: null, max: null } as unknown as AggregatedMetricPoint;
- const high = { timestamp: 2, value: 99, min: null, max: null } as unknown as AggregatedMetricPoint;
+ const low = {
+ timestamp: 1,
+ value: 7,
+ min: null,
+ max: null,
+ } as unknown as AggregatedMetricPoint;
+ const high = {
+ timestamp: 2,
+ value: 99,
+ min: null,
+ max: null,
+ } as unknown as AggregatedMetricPoint;
expect(getHistoryChartDataMax([low, high])).toBe(99);
});
});
@@ -174,7 +194,12 @@ describe('getHistoryChartScale', () => {
describe('getHistoryChartYAxisLabels', () => {
it('renders percent labels at the three tick positions', () => {
expect(
- getHistoryChartYAxisLabels({ minValue: 0, maxValue: 100, isPercentLike: true, isByteLike: false }),
+ getHistoryChartYAxisLabels({
+ minValue: 0,
+ maxValue: 100,
+ isPercentLike: true,
+ isByteLike: false,
+ }),
).toStrictEqual([
{ pct: 0, label: '0%' },
{ pct: 0.5, label: '50%' },
@@ -184,7 +209,12 @@ describe('getHistoryChartYAxisLabels', () => {
it('renders byte-like 0/avg/max labels', () => {
expect(
- getHistoryChartYAxisLabels({ minValue: 0, maxValue: 100, isPercentLike: false, isByteLike: true }),
+ getHistoryChartYAxisLabels({
+ minValue: 0,
+ maxValue: 100,
+ isPercentLike: false,
+ isByteLike: true,
+ }),
).toStrictEqual([
{ pct: 0, label: '0' },
{ pct: 0.5, label: 'Avg' },
@@ -194,7 +224,12 @@ describe('getHistoryChartYAxisLabels', () => {
it('renders computed numeric labels for other unit kinds', () => {
expect(
- getHistoryChartYAxisLabels({ minValue: 10, maxValue: 110, isPercentLike: false, isByteLike: false }),
+ getHistoryChartYAxisLabels({
+ minValue: 10,
+ maxValue: 110,
+ isPercentLike: false,
+ isByteLike: false,
+ }),
).toStrictEqual([
{ pct: 0, label: '0' },
{ pct: 0.5, label: '60' },
diff --git a/frontend-modern/src/components/shared/__tests__/mobileNavBarModel.branchcov0712.test.ts b/frontend-modern/src/components/shared/__tests__/mobileNavBarModel.branchcov0712.test.ts
index b6138e072c..42166d8afb 100644
--- a/frontend-modern/src/components/shared/__tests__/mobileNavBarModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/mobileNavBarModel.branchcov0712.test.ts
@@ -6,7 +6,10 @@ import {
getMobileNavTabAriaLabel,
getMobileNavTabButtonClass,
} from '@/components/shared/mobileNavBarModel';
-import type { MobileNavBarIcon, MobileNavBarUtilityTab } from '@/components/shared/mobileNavBarModel';
+import type {
+ MobileNavBarIcon,
+ MobileNavBarUtilityTab,
+} from '@/components/shared/mobileNavBarModel';
// The icon is never rendered by these model-only tests; a cast stub satisfies
// the Component type without pulling solid-js into a plain .ts file.
@@ -14,9 +17,7 @@ const noopIcon = (() => null) as unknown as MobileNavBarIcon;
// Defaults are tuned to the alerts-scoped functions so their tests stay minimal;
// non-alerts tests override `id` explicitly.
-function makeUtilityTab(
- overrides: Partial<MobileNavBarUtilityTab> = {},
-): MobileNavBarUtilityTab {
+function makeUtilityTab(overrides: Partial<MobileNavBarUtilityTab> = {}): MobileNavBarUtilityTab {
return {
id: 'alerts',
label: 'Alerts',
@@ -183,10 +184,7 @@ describe('mobileNavBarModel.branchcov2', () => {
it('keeps all tabs in input order when none match the priority set', () => {
const tabs = [{ id: 'x' }, { id: 'y' }];
- expect(buildOrderedMobileNavTabs(tabs, ['a', 'b'])).toStrictEqual([
- { id: 'x' },
- { id: 'y' },
- ]);
+ expect(buildOrderedMobileNavTabs(tabs, ['a', 'b'])).toStrictEqual([{ id: 'x' }, { id: 'y' }]);
});
it('preserves the full tab object (generic T) through reordering', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/searchTipsPopoverModel.branchcov0712c.test.ts b/frontend-modern/src/components/shared/__tests__/searchTipsPopoverModel.branchcov0712c.test.ts
index a35eb93b86..1a0d16e648 100644
--- a/frontend-modern/src/components/shared/__tests__/searchTipsPopoverModel.branchcov0712c.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/searchTipsPopoverModel.branchcov0712c.test.ts
@@ -28,8 +28,7 @@ describe('searchTipsPopoverModel.branchcov0712c', () => {
// The ternary only special-cases 'left'; anything else (including a
// wrong-typed value that slips past the union at runtime) must fall to
// the 'right-0' arm.
- const bogus =
- 'center' as unknown as Parameters<typeof getSearchTipsPopoverPositionClass>[0];
+ const bogus = 'center' as unknown as Parameters<typeof getSearchTipsPopoverPositionClass>[0];
expect(getSearchTipsPopoverPositionClass(bogus)).toBe('right-0');
});
});
@@ -56,8 +55,7 @@ describe('searchTipsPopoverModel.branchcov0712c', () => {
it('falls through both ifs to the default return for an unknown variant (defensive)', () => {
// An out-of-union value must not match either `if` guard and so lands in
// the trailing default (the icon) return.
- const bogus =
- 'ghost' as unknown as Parameters<typeof getSearchTipsPopoverTriggerClass>[0];
+ const bogus = 'ghost' as unknown as Parameters<typeof getSearchTipsPopoverTriggerClass>[0];
expect(getSearchTipsPopoverTriggerClass(bogus)).toBe(
`flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:text-muted sm:h-5 sm:w-5 ${TRIGGER_BASE_CLASSES}`,
);
diff --git a/frontend-modern/src/components/shared/__tests__/statusBadgeModel.branchcov0713.test.ts b/frontend-modern/src/components/shared/__tests__/statusBadgeModel.branchcov0713.test.ts
index 6aefa5d2fe..3856f62ad0 100644
--- a/frontend-modern/src/components/shared/__tests__/statusBadgeModel.branchcov0713.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/statusBadgeModel.branchcov0713.test.ts
@@ -203,17 +203,20 @@ describe('statusBadgeModel.branchcov0713', () => {
},
];
- it.each(cases)('$name produces the exact class string', ({ size, isEnabled, disabled, stateClass }) => {
- const expected = [
- STATUS_BADGE_BASE_CLASS,
- STATUS_BADGE_PADDING_BY_SIZE[size],
- stateClass,
- disabled ? STATUS_BADGE_INTERACTION_DISABLED_CLASS : '',
- ]
- .join(' ')
- .trim();
- expect(getStatusBadgeClass(size, isEnabled, disabled)).toBe(expected);
- });
+ it.each(cases)(
+ '$name produces the exact class string',
+ ({ size, isEnabled, disabled, stateClass }) => {
+ const expected = [
+ STATUS_BADGE_BASE_CLASS,
+ STATUS_BADGE_PADDING_BY_SIZE[size],
+ stateClass,
+ disabled ? STATUS_BADGE_INTERACTION_DISABLED_CLASS : '',
+ ]
+ .join(' ')
+ .trim();
+ expect(getStatusBadgeClass(size, isEnabled, disabled)).toBe(expected);
+ },
+ );
it.each(cases)(
'$name has no double spaces and no leading/trailing whitespace',
@@ -243,9 +246,7 @@ describe('statusBadgeModel.branchcov0713', () => {
// The undefined lookup contributes an empty string; the surrounding
// separators collapse into a literal double space between the base
// class and the enabled-state class.
- expect(result).toBe(
- `${STATUS_BADGE_BASE_CLASS} ${STATUS_BADGE_ENABLED_CLASS}`,
- );
+ expect(result).toBe(`${STATUS_BADGE_BASE_CLASS} ${STATUS_BADGE_ENABLED_CLASS}`);
expect(result).toMatch(/\s{2,}/);
});
diff --git a/frontend-modern/src/components/shared/__tests__/summaryInteractionA11y.test.ts b/frontend-modern/src/components/shared/__tests__/summaryInteractionA11y.test.ts
index 2cd19095a4..c0f51b31f3 100644
--- a/frontend-modern/src/components/shared/__tests__/summaryInteractionA11y.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/summaryInteractionA11y.test.ts
@@ -12,10 +12,7 @@ const createPointerEvent = (pointerType: string) =>
target: document.body,
}) as unknown as PointerEvent & { currentTarget: HTMLElement; target: Element };
-const createFocusEvent = (
- currentTarget: HTMLElement,
- relatedTarget: EventTarget | null = null,
-) =>
+const createFocusEvent = (currentTarget: HTMLElement, relatedTarget: EventTarget | null = null) =>
({
currentTarget,
target: currentTarget,
diff --git a/frontend-modern/src/components/shared/__tests__/tooltipModel.branchcov0713.test.ts b/frontend-modern/src/components/shared/__tests__/tooltipModel.branchcov0713.test.ts
index b83645989d..220cea07b8 100644
--- a/frontend-modern/src/components/shared/__tests__/tooltipModel.branchcov0713.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/tooltipModel.branchcov0713.test.ts
@@ -1,8 +1,5 @@
import { describe, expect, it } from 'vitest';
-import {
- resolveTooltipPosition,
- sanitizeTooltipContent,
-} from '@/components/shared/tooltipModel';
+import { resolveTooltipPosition, sanitizeTooltipContent } from '@/components/shared/tooltipModel';
import type {
TooltipAlignment,
TooltipDirection,
@@ -70,7 +67,7 @@ describe('tooltipModel.branchcov0713', () => {
expect(sanitizeTooltipContent('a~b')).toBe('a~b');
});
- it("keeps space (0x20), the lowest printable char (>= 0x20 boundary)", () => {
+ it('keeps space (0x20), the lowest printable char (>= 0x20 boundary)', () => {
expect(sanitizeTooltipContent('a b')).toBe('a b');
});
@@ -85,9 +82,7 @@ describe('tooltipModel.branchcov0713', () => {
});
it('filters a mixed string down to exactly its whitelisted characters', () => {
- expect(sanitizeTooltipContent('\thello\n\x00world\x7fend')).toBe(
- '\thello\nworldend',
- );
+ expect(sanitizeTooltipContent('\thello\n\x00world\x7fend')).toBe('\thello\nworldend');
});
it('does not mutate or reorder retained characters when nothing is stripped', () => {
@@ -211,7 +206,7 @@ describe('tooltipModel.branchcov0713', () => {
expect(result).toEqual({ left: 500, top: 600 - PADDING } satisfies TooltipPosition);
});
- it("clamps each axis independently when only one overflows (left axis overflows, top is in range)", () => {
+ it('clamps each axis independently when only one overflows (left axis overflows, top is in range)', () => {
const result = resolveTooltipPosition({
rect: { width: 100, height: 50 },
viewportWidth: 1000,
@@ -232,8 +227,9 @@ describe('tooltipModel.branchcov0713', () => {
it("treats an out-of-union align as NOT 'center' (falls to the align='left' behavior)", () => {
// Defensive: strict equality means any foreign value skips the centering
// branch, leaving left === x.
- const bogusAlign =
- 'right' as unknown as Parameters<typeof resolveTooltipPosition>[0]['align'];
+ const bogusAlign = 'right' as unknown as Parameters<
+ typeof resolveTooltipPosition
+ >[0]['align'];
const result = resolveTooltipPosition({
rect: { width: 100, height: 50 },
viewportWidth: 1000,
@@ -248,8 +244,7 @@ describe('tooltipModel.branchcov0713', () => {
});
it("treats an out-of-union direction as NOT 'up' (falls to the direction='down' behavior)", () => {
- const bogusDirection =
- 'sideways' as unknown as TooltipDirection;
+ const bogusDirection = 'sideways' as unknown as TooltipDirection;
const result = resolveTooltipPosition({
rect: { width: 100, height: 50 },
viewportWidth: 1000,
@@ -264,7 +259,7 @@ describe('tooltipModel.branchcov0713', () => {
expect(result).toEqual({ left: 250, top: 408 } satisfies TooltipPosition);
});
- it("computes maxLeft and maxTop from the supplied viewport dims even with an unusual align/direction pairing", () => {
+ it('computes maxLeft and maxTop from the supplied viewport dims even with an unusual align/direction pairing', () => {
// align='left', direction='up' with a tight viewport to exercise both
// clamps at once using only declared-union values.
const result = resolveTooltipPosition({
@@ -325,8 +320,7 @@ describe('tooltipModel.branchcov0713', () => {
direction,
});
const expectedLeft = align === 'center' ? x - rect.width / 2 : x;
- const expectedTop =
- direction === 'up' ? y - rect.height - PADDING : y + PADDING;
+ const expectedTop = direction === 'up' ? y - rect.height - PADDING : y + PADDING;
expect(result).toEqual({
left: expectedLeft,
top: expectedTop,
diff --git a/frontend-modern/src/components/shared/__tests__/webInterfaceUrlFieldModel.branchcov0712.test.ts b/frontend-modern/src/components/shared/__tests__/webInterfaceUrlFieldModel.branchcov0712.test.ts
index 84494c2fb9..3c159f0eea 100644
--- a/frontend-modern/src/components/shared/__tests__/webInterfaceUrlFieldModel.branchcov0712.test.ts
+++ b/frontend-modern/src/components/shared/__tests__/webInterfaceUrlFieldModel.branchcov0712.test.ts
@@ -81,9 +81,7 @@ describe('webInterfaceUrlFieldModel.branchcov2', () => {
it('returns the trimmed targetLabel when present, overriding the kind default', () => {
// kind 'guest' would default to 'workload', so returning 'container-7'
// proves the explicit label wins.
- expect(
- getWebInterfaceTargetLabel('guest', ' container-7 '),
- ).toBe('container-7');
+ expect(getWebInterfaceTargetLabel('guest', ' container-7 ')).toBe('container-7');
});
it('returns the trimmed non-empty label even for agent kind (label still wins over default)', () => {
@@ -115,18 +113,12 @@ describe('webInterfaceUrlFieldModel.branchcov2', () => {
// null is not a valid string; cast through unknown to satisfy strict
// null checks while still exercising the real `value || ''` fallback
// inside normalizeWebInterfaceUrl at runtime.
- const nullLabel = null as unknown as Parameters<
- typeof getWebInterfaceTargetLabel
- >[1];
+ const nullLabel = null as unknown as Parameters<typeof getWebInterfaceTargetLabel>[1];
expect(getWebInterfaceTargetLabel('docker', nullLabel)).toBe('workload');
});
it('covers all three metadataKind values against the same empty-label input', () => {
- const kinds: WebInterfaceUrlFieldProps['metadataKind'][] = [
- 'guest',
- 'agent',
- 'docker',
- ];
+ const kinds: WebInterfaceUrlFieldProps['metadataKind'][] = ['guest', 'agent', 'docker'];
const results = kinds.map((k) => getWebInterfaceTargetLabel(k, undefined));
expect(results).toStrictEqual(['workload', 'agent', 'workload']);
});
diff --git a/frontend-modern/src/components/shared/containerUpdateBadgeModel.ts b/frontend-modern/src/components/shared/containerUpdateBadgeModel.ts
index 1e3f3c03ef..90e2ef1cbb 100644
--- a/frontend-modern/src/components/shared/containerUpdateBadgeModel.ts
+++ b/frontend-modern/src/components/shared/containerUpdateBadgeModel.ts
@@ -56,9 +56,7 @@ export function hasContainerUpdateCurrent(updateStatus?: DockerContainerUpdateSt
return updateStatus?.updateAvailable === false && !hasContainerUpdateError(updateStatus);
}
-export function getContainerUpdateErrorTooltip(
- updateStatus?: DockerContainerUpdateStatus,
-): string {
+export function getContainerUpdateErrorTooltip(updateStatus?: DockerContainerUpdateStatus): string {
return `Update check failed: ${updateStatus?.error || 'Unknown error'}`;
}
@@ -71,9 +69,7 @@ export function getContainerUpdateCurrentTooltip(
return `Image is current\nDigest: ${current}...`;
}
-export function getContainerUpdateBadgeTooltip(
- updateStatus?: DockerContainerUpdateStatus,
-): string {
+export function getContainerUpdateBadgeTooltip(updateStatus?: DockerContainerUpdateStatus): string {
const current = getDigestPreview(updateStatus?.currentDigest, 19);
const latest = getDigestPreview(updateStatus?.latestDigest, 19);
return `Image update available\nCurrent: ${current}...\nLatest: ${latest}...`;
diff --git a/frontend-modern/src/components/shared/contextualFocus.ts b/frontend-modern/src/components/shared/contextualFocus.ts
index 3cf40bfca7..f62807e681 100644
--- a/frontend-modern/src/components/shared/contextualFocus.ts
+++ b/frontend-modern/src/components/shared/contextualFocus.ts
@@ -64,7 +64,10 @@ const resolveVerticalScroller = (element: Element | null | undefined): Window |
};
const getScrollerMetrics = (scroller: Window | HTMLElement) => {
- if (isWindowScroller(scroller) || typeof (scroller as HTMLElement).getBoundingClientRect !== 'function') {
+ if (
+ isWindowScroller(scroller) ||
+ typeof (scroller as HTMLElement).getBoundingClientRect !== 'function'
+ ) {
return {
top: 0,
bottom: window.innerHeight,
@@ -151,22 +154,15 @@ export const revealInlineDetailInViewport = (options: {
const metrics = getScrollerMetrics(scroller);
const rowRect = options.row.getBoundingClientRect();
const detailRect = options.detail?.getBoundingClientRect() ?? null;
- const minTopMargin = Math.max(
- INLINE_DETAIL_MIN_TOP_MARGIN,
- Math.round(metrics.height * 0.12),
- );
+ const minTopMargin = Math.max(INLINE_DETAIL_MIN_TOP_MARGIN, Math.round(metrics.height * 0.12));
const preferredTop = Math.max(
minTopMargin,
Math.round(metrics.height * INLINE_DETAIL_TARGET_TOP_RATIO),
);
- const detailPeek = Math.max(
- INLINE_DETAIL_MIN_DETAIL_PEEK,
- Math.round(metrics.height * 0.24),
- );
+ const detailPeek = Math.max(INLINE_DETAIL_MIN_DETAIL_PEEK, Math.round(metrics.height * 0.24));
const currentRowOffset = rowRect.top - metrics.top;
const rowHasBreathingRoom = currentRowOffset >= minTopMargin;
- const detailHasPeek =
- !detailRect || detailRect.top - metrics.top <= metrics.height - detailPeek;
+ const detailHasPeek = !detailRect || detailRect.top - metrics.top <= metrics.height - detailPeek;
if (rowHasBreathingRoom && detailHasPeek) {
return false;
diff --git a/frontend-modern/src/components/shared/filterButtonGroupModel.ts b/frontend-modern/src/components/shared/filterButtonGroupModel.ts
index ada83f8ee8..5087493fb6 100644
--- a/frontend-modern/src/components/shared/filterButtonGroupModel.ts
+++ b/frontend-modern/src/components/shared/filterButtonGroupModel.ts
@@ -14,21 +14,14 @@ export interface FilterOption<T extends string | number> {
}
export type FilterButtonGroupVariant =
- | 'default'
- | 'settings'
- | 'compact'
- | 'prominent'
- | 'segmented';
+ 'default' | 'settings' | 'compact' | 'prominent' | 'segmented';
export type FilterButtonGroupOptionTone =
- | 'default'
- | 'info'
- | 'success'
- | 'warning'
- | 'danger'
- | 'muted';
+ 'default' | 'info' | 'success' | 'warning' | 'danger' | 'muted';
-export interface FilterButtonGroupProps<T extends string | number>
- extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
+export interface FilterButtonGroupProps<T extends string | number> extends Omit<
+ JSX.HTMLAttributes<HTMLDivElement>,
+ 'onChange'
+> {
options: FilterOption<T>[];
value: T;
onChange: (value: T) => void;
@@ -76,9 +69,7 @@ export function getFilterButtonGroupClass(
return `${groupClassByVariant[variant]} touch-scroll ${className ?? ''}`.trim();
}
-export function getFilterButtonGroupLabelClass(
- variant: FilterButtonGroupVariant,
-): string {
+export function getFilterButtonGroupLabelClass(variant: FilterButtonGroupVariant): string {
return labelClassByVariant[variant] ?? labelClassByVariant.default!;
}
diff --git a/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx b/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx
index 49a9900e16..6002dbd55c 100644
--- a/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx
+++ b/frontend-modern/src/components/shared/responsive/ResponsiveMetricCell.tsx
@@ -118,7 +118,9 @@ export const ResponsiveMetricCell: Component<ResponsiveMetricCellProps> = (props
const defaultFallback = (
<div class="h-4 flex items-center justify-center">
- <span class="text-xs text-muted" aria-hidden="true">—</span>
+ <span class="text-xs text-muted" aria-hidden="true">
+ —
+ </span>
</div>
);
diff --git a/frontend-modern/src/components/shared/statusBadgeModel.ts b/frontend-modern/src/components/shared/statusBadgeModel.ts
index ec3366d9c2..ad438f88b1 100644
--- a/frontend-modern/src/components/shared/statusBadgeModel.ts
+++ b/frontend-modern/src/components/shared/statusBadgeModel.ts
@@ -38,7 +38,9 @@ export function getStatusBadgeClass(
STATUS_BADGE_PADDING_BY_SIZE[size],
isEnabled ? STATUS_BADGE_ENABLED_CLASS : STATUS_BADGE_DISABLED_STATE_CLASS,
disabled ? STATUS_BADGE_INTERACTION_DISABLED_CLASS : '',
- ].join(' ').trim();
+ ]
+ .join(' ')
+ .trim();
}
export function getStatusBadgeLabel(props: StatusBadgeProps): string {
diff --git a/frontend-modern/src/components/shared/summaryCardInteraction.ts b/frontend-modern/src/components/shared/summaryCardInteraction.ts
index b7a6c41735..7a5e596d3e 100644
--- a/frontend-modern/src/components/shared/summaryCardInteraction.ts
+++ b/frontend-modern/src/components/shared/summaryCardInteraction.ts
@@ -108,7 +108,10 @@ export const resolveSummaryScopeState = (options: {
});
const chartHoveredSeriesId = normalizeSeriesId(options.chartHoveredSeriesId);
- if (chartHoveredSeriesId && (!groupScope || isSummarySeriesInGroupScope(groupScope, chartHoveredSeriesId))) {
+ if (
+ chartHoveredSeriesId &&
+ (!groupScope || isSummarySeriesInGroupScope(groupScope, chartHoveredSeriesId))
+ ) {
return {
groupScope,
kind: 'entity',
@@ -118,7 +121,10 @@ export const resolveSummaryScopeState = (options: {
}
const hoveredSeriesId = normalizeSeriesId(options.hoveredSeriesId);
- if (hoveredSeriesId && (!groupScope || isSummarySeriesInGroupScope(groupScope, hoveredSeriesId))) {
+ if (
+ hoveredSeriesId &&
+ (!groupScope || isSummarySeriesInGroupScope(groupScope, hoveredSeriesId))
+ ) {
return {
groupScope,
kind: 'entity',
@@ -128,7 +134,10 @@ export const resolveSummaryScopeState = (options: {
}
const focusedSeriesId = normalizeSeriesId(options.focusedSeriesId);
- if (focusedSeriesId && (!groupScope || isSummarySeriesInGroupScope(groupScope, focusedSeriesId))) {
+ if (
+ focusedSeriesId &&
+ (!groupScope || isSummarySeriesInGroupScope(groupScope, focusedSeriesId))
+ ) {
return {
groupScope,
kind: 'entity',
diff --git a/frontend-modern/src/components/shared/summaryChartLayout.ts b/frontend-modern/src/components/shared/summaryChartLayout.ts
index 20b7da0eb8..16c38fdbb5 100644
--- a/frontend-modern/src/components/shared/summaryChartLayout.ts
+++ b/frontend-modern/src/components/shared/summaryChartLayout.ts
@@ -1,4 +1,3 @@
-
export const SUMMARY_CHART_SLOT_CLASS = 'h-[136px] sm:h-[150px]';
export const SUMMARY_CHART_SLOT_COMPACT_CLASS = 'h-[108px] sm:h-[120px]';
export const SUMMARY_CHART_PLOT_AREA_CLASS = 'h-[120px] sm:h-[134px]';
diff --git a/frontend-modern/src/components/shared/summaryInteractionA11y.ts b/frontend-modern/src/components/shared/summaryInteractionA11y.ts
index 0b6c628dec..dc9f549a50 100644
--- a/frontend-modern/src/components/shared/summaryInteractionA11y.ts
+++ b/frontend-modern/src/components/shared/summaryInteractionA11y.ts
@@ -59,27 +59,29 @@ interface SummaryInteractiveActionKeydownOptions {
onPreviewClear?: () => void;
}
-export const createSummaryInteractiveActionKeydownHandler = (
- options: SummaryInteractiveActionKeydownOptions,
-): JSX.EventHandler<HTMLButtonElement, KeyboardEvent> => (event) => {
- if (
- event.key === 'Enter' ||
- event.key === ' ' ||
- event.key === 'Space' ||
- event.code === 'Space'
- ) {
- event.preventDefault();
- options.onAction?.();
- return;
- }
+export const createSummaryInteractiveActionKeydownHandler =
+ (
+ options: SummaryInteractiveActionKeydownOptions,
+ ): JSX.EventHandler<HTMLButtonElement, KeyboardEvent> =>
+ (event) => {
+ if (
+ event.key === 'Enter' ||
+ event.key === ' ' ||
+ event.key === 'Space' ||
+ event.code === 'Space'
+ ) {
+ event.preventDefault();
+ options.onAction?.();
+ return;
+ }
- if (event.key !== 'Escape') {
- return;
- }
- event.preventDefault();
- options.onPreviewClear?.();
- event.currentTarget.blur();
-};
+ if (event.key !== 'Escape') {
+ return;
+ }
+ event.preventDefault();
+ options.onPreviewClear?.();
+ event.currentTarget.blur();
+ };
export const buildSummaryDisclosureControlsId = (seriesId: string): string =>
`summary-row-detail-${seriesId.replace(/[^a-zA-Z0-9_-]+/g, '-')}`;
diff --git a/frontend-modern/src/components/shared/summaryTableFocus.ts b/frontend-modern/src/components/shared/summaryTableFocus.ts
index 951007a73a..cf4936f775 100644
--- a/frontend-modern/src/components/shared/summaryTableFocus.ts
+++ b/frontend-modern/src/components/shared/summaryTableFocus.ts
@@ -52,7 +52,9 @@ const isElementVisibleWithinViewport = (element: HTMLElement): boolean => {
while (current) {
const style = getComputedStyle(current);
const clipsVertically =
- (style.overflowY === 'auto' || style.overflowY === 'scroll' || style.overflowY === 'hidden') &&
+ (style.overflowY === 'auto' ||
+ style.overflowY === 'scroll' ||
+ style.overflowY === 'hidden') &&
current.scrollHeight > current.clientHeight;
if (clipsVertically) {
const containerRect = current.getBoundingClientRect();
@@ -186,10 +188,7 @@ export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOp
return;
}
const target = event.target;
- if (
- target instanceof HTMLElement &&
- target.closest('[role="dialog"], [aria-modal="true"]')
- ) {
+ if (target instanceof HTMLElement && target.closest('[role="dialog"], [aria-modal="true"]')) {
return;
}
options.onEscapeClear?.();
@@ -388,7 +387,8 @@ export function useSummaryTableFocusBridge(options: UseSummaryTableFocusBridgeOp
activeRow,
isActiveRowVisible,
jumpToActiveRow,
- setClearSurfaceRootRef: (element: HTMLElement | undefined) => setClearSurfaceRoot(element ?? null),
+ setClearSurfaceRootRef: (element: HTMLElement | undefined) =>
+ setClearSurfaceRoot(element ?? null),
setTableRootRef: (element: HTMLElement | undefined) => setTableRoot(element ?? null),
shouldShowJumpToActiveRow,
} as const;
diff --git a/frontend-modern/src/components/shared/toggleModel.ts b/frontend-modern/src/components/shared/toggleModel.ts
index b82e1c55fb..b1e696090b 100644
--- a/frontend-modern/src/components/shared/toggleModel.ts
+++ b/frontend-modern/src/components/shared/toggleModel.ts
@@ -35,7 +35,10 @@ const toggleSizeConfig: Record<ToggleSize, { track: string; knob: string; transl
},
};
-export function resolveToggleSize(size: ToggleSize | undefined, fallback: ToggleSize = 'sm'): ToggleSize {
+export function resolveToggleSize(
+ size: ToggleSize | undefined,
+ fallback: ToggleSize = 'sm',
+): ToggleSize {
return size ?? fallback;
}
diff --git a/frontend-modern/src/components/shared/useDialogState.ts b/frontend-modern/src/components/shared/useDialogState.ts
index 2eeba7eabc..a6307954ae 100644
--- a/frontend-modern/src/components/shared/useDialogState.ts
+++ b/frontend-modern/src/components/shared/useDialogState.ts
@@ -1,10 +1,6 @@
import { createEffect, createSignal, onCleanup } from 'solid-js';
import type { Accessor } from 'solid-js';
-import {
- getDialogFocusableElements,
- getDialogLayout,
- type DialogLayout,
-} from './dialogModel';
+import { getDialogFocusableElements, getDialogLayout, type DialogLayout } from './dialogModel';
interface DialogStateOptions {
closeOnBackdrop?: boolean;
diff --git a/frontend-modern/src/components/shared/useHelpIconState.ts b/frontend-modern/src/components/shared/useHelpIconState.ts
index e635445fbc..2710fffba1 100644
--- a/frontend-modern/src/components/shared/useHelpIconState.ts
+++ b/frontend-modern/src/components/shared/useHelpIconState.ts
@@ -18,9 +18,7 @@ export function useHelpIconState(props: HelpIconProps) {
const helpContent = createMemo(() => resolveHelpContent(props));
const size = createMemo(() => getHelpIconSize(props.size));
const maxWidth = createMemo(() => getHelpPopoverMaxWidth(props.maxWidth));
- const preferredPosition = createMemo(() =>
- getHelpPopoverPreferredPosition(props.position),
- );
+ const preferredPosition = createMemo(() => getHelpPopoverPreferredPosition(props.position));
createEffect(() => {
if (!isOpen() || !buttonRef()) return;
diff --git a/frontend-modern/src/components/shared/useSelectionCardGroupState.ts b/frontend-modern/src/components/shared/useSelectionCardGroupState.ts
index a88129ba7b..f611711270 100644
--- a/frontend-modern/src/components/shared/useSelectionCardGroupState.ts
+++ b/frontend-modern/src/components/shared/useSelectionCardGroupState.ts
@@ -12,7 +12,8 @@ export function useSelectionCardGroupState<T extends string | number>(
const variant = createMemo(() => resolveSelectionCardGroupVariant(props.variant));
const isOptionActive = (option: SelectionCardOption<T>) => option.value === props.value;
- const isOptionDisabled = (option: SelectionCardOption<T>) => Boolean(props.disabled || option.disabled);
+ const isOptionDisabled = (option: SelectionCardOption<T>) =>
+ Boolean(props.disabled || option.disabled);
const getOptionTone = (option: SelectionCardOption<T>) => resolveSelectionCardTone(option.tone);
const handleOptionClick = (option: SelectionCardOption<T>) => {
diff --git a/frontend-modern/src/components/shared/useTooltipState.ts b/frontend-modern/src/components/shared/useTooltipState.ts
index cf0a7bea93..a5b7b577ed 100644
--- a/frontend-modern/src/components/shared/useTooltipState.ts
+++ b/frontend-modern/src/components/shared/useTooltipState.ts
@@ -168,9 +168,7 @@ export function useTooltipState(options: TooltipStateOptions): {
};
}
-export function useTooltipPortalState(
- options: TooltipPortalStateOptions,
-): {
+export function useTooltipPortalState(options: TooltipPortalStateOptions): {
maxWidth: Accessor<number>;
position: Accessor<TooltipPosition>;
setTooltipRef: (el: HTMLDivElement) => void;
diff --git a/frontend-modern/src/components/shared/useUpgradeNavigation.ts b/frontend-modern/src/components/shared/useUpgradeNavigation.ts
index 495d252369..2e6722db45 100644
--- a/frontend-modern/src/components/shared/useUpgradeNavigation.ts
+++ b/frontend-modern/src/components/shared/useUpgradeNavigation.ts
@@ -1,8 +1,5 @@
import { useNavigate } from '@solidjs/router';
-import {
- navigateToUpgradeDestination,
- type UpgradeDestination,
-} from '@/utils/upgradeNavigation';
+import { navigateToUpgradeDestination, type UpgradeDestination } from '@/utils/upgradeNavigation';
export function useUpgradeNavigation() {
const navigate = useNavigate();
diff --git a/frontend-modern/src/content/help/__tests__/ai.test.ts b/frontend-modern/src/content/help/__tests__/ai.test.ts
index 6904dd2e19..516d823c61 100644
--- a/frontend-modern/src/content/help/__tests__/ai.test.ts
+++ b/frontend-modern/src/content/help/__tests__/ai.test.ts
@@ -7,6 +7,8 @@ describe('AI help content', () => {
expect(providerHelp?.description).toContain('choose the route');
expect(providerHelp?.description).toContain('switch routes explicitly');
- expect(providerHelp?.description).not.toMatch(/fallback to others|automatic provider fallback/i);
+ expect(providerHelp?.description).not.toMatch(
+ /fallback to others|automatic provider fallback/i,
+ );
});
});
diff --git a/frontend-modern/src/features/actions/ActionReviewDialog.tsx b/frontend-modern/src/features/actions/ActionReviewDialog.tsx
index 3e40057480..4a5abb8a43 100644
--- a/frontend-modern/src/features/actions/ActionReviewDialog.tsx
+++ b/frontend-modern/src/features/actions/ActionReviewDialog.tsx
@@ -58,9 +58,7 @@ export const ActionReviewDialog: Component<{
// Low-risk capabilities (rollback-supported, routine) collapse the decision
// to one confirmation: a single click records the approval and dispatches
// execution. Both lifecycle records are still written server-side.
- const singleConfirmation = createMemo(
- () => audit()?.capabilityAutoAuthorization === 'low_risk',
- );
+ const singleConfirmation = createMemo(() => audit()?.capabilityAutoAuthorization === 'low_risk');
const canExecute = () =>
!readOnly() &&
reviewedPlanHash() &&
@@ -254,11 +252,7 @@ export const ActionReviewDialog: Component<{
</Button>
}
>
- <Button
- variant="primary"
- isLoading={busy()}
- onClick={() => void approveAndRun()}
- >
+ <Button variant="primary" isLoading={busy()} onClick={() => void approveAndRun()}>
Approve and run
</Button>
</Show>
diff --git a/frontend-modern/src/features/actions/__tests__/aptActionPresentation.branchcov0718.test.ts b/frontend-modern/src/features/actions/__tests__/aptActionPresentation.branchcov0718.test.ts
index c768340e2b..d7cced1d0f 100644
--- a/frontend-modern/src/features/actions/__tests__/aptActionPresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/features/actions/__tests__/aptActionPresentation.branchcov0718.test.ts
@@ -360,7 +360,10 @@ describe('getAPTActionPresentation — residual branch coverage', () => {
it('uses the cleanup title for clean_package_cache', () => {
expect(
getAPTActionPresentation(
- makeAudit({ capabilityName: 'clean_package_cache', reasonCodes: ['capability_auto_low_risk'] }),
+ makeAudit({
+ capabilityName: 'clean_package_cache',
+ reasonCodes: ['capability_auto_low_risk'],
+ }),
)?.title,
).toBe('Clear downloaded package data');
});
@@ -376,7 +379,10 @@ describe('getAPTActionPresentation — residual branch coverage', () => {
it('bounds the cleanup capability to downloaded package data only', () => {
expect(
getAPTActionPresentation(
- makeAudit({ capabilityName: 'clean_package_cache', reasonCodes: ['capability_auto_low_risk'] }),
+ makeAudit({
+ capabilityName: 'clean_package_cache',
+ reasonCodes: ['capability_auto_low_risk'],
+ }),
)?.authorityBoundary,
).toBe(
'The agent may clear only downloaded package data on the pressured filesystem. It cannot choose paths, remove installed packages, or reboot the host.',
diff --git a/frontend-modern/src/features/actions/__tests__/aptActionPresentation.test.ts b/frontend-modern/src/features/actions/__tests__/aptActionPresentation.test.ts
index 6263c09c70..c49889a892 100644
--- a/frontend-modern/src/features/actions/__tests__/aptActionPresentation.test.ts
+++ b/frontend-modern/src/features/actions/__tests__/aptActionPresentation.test.ts
@@ -1,7 +1,11 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
-import type { ActionAuditRecord, ActionExecutionStatus, ActionVerificationTruthStatus } from '@/types/actionAudit';
+import type {
+ ActionAuditRecord,
+ ActionExecutionStatus,
+ ActionVerificationTruthStatus,
+} from '@/types/actionAudit';
import { getAPTActionPresentation } from '../aptActionPresentation';
const source = readFileSync(resolve(__dirname, '..', 'aptActionPresentation.ts'), 'utf8');
@@ -21,83 +25,164 @@ const makeAudit = ({
reasonCode?: 'capability_auto_elevated' | 'capability_auto_low_risk';
params?: Record<string, unknown>;
} = {}): ActionAuditRecord => ({
- id: 'apt-action', createdAt: '2026-07-12T10:00:00Z', updatedAt: '2026-07-12T10:01:00Z', state: 'completed',
- request: { requestId: 'apt-request', resourceId: 'proxmox:node:pve-1', capabilityName, params, reason: 'Resolve the current Patrol finding', requestedBy: 'pulse_patrol' },
+ id: 'apt-action',
+ createdAt: '2026-07-12T10:00:00Z',
+ updatedAt: '2026-07-12T10:01:00Z',
+ state: 'completed',
+ request: {
+ requestId: 'apt-request',
+ resourceId: 'proxmox:node:pve-1',
+ capabilityName,
+ params,
+ reason: 'Resolve the current Patrol finding',
+ requestedBy: 'pulse_patrol',
+ },
plan: {
- actionId: 'apt-action', requestId: 'apt-request', allowed: true, requiresApproval: reasonCode === 'capability_auto_elevated', approvalPolicy: reasonCode === 'capability_auto_elevated' ? 'admin' : 'none', rollbackAvailable: false,
- policyDecision: { version: 1, status: 'resolved', decisionId: 'decision', actionId: 'apt-action', scope: { orgId: 'org-1', resourceId: 'proxmox:node:pve-1', capabilityName }, approvalRequirement: { version: 1, floor: reasonCode === 'capability_auto_elevated' ? 'admin' : 'none', quorum: 1, disallowRequester: false }, planningAllowed: true, requiresApproval: reasonCode === 'capability_auto_elevated', authorities: [{ kind: 'capability_registry', sourceId: `capability-registry:${capabilityName}`, status: 'consulted', scope: { orgId: 'org-1', resourceId: 'proxmox:node:pve-1', capabilityName }, reasonCodes: [reasonCode] }] },
+ actionId: 'apt-action',
+ requestId: 'apt-request',
+ allowed: true,
+ requiresApproval: reasonCode === 'capability_auto_elevated',
+ approvalPolicy: reasonCode === 'capability_auto_elevated' ? 'admin' : 'none',
+ rollbackAvailable: false,
+ policyDecision: {
+ version: 1,
+ status: 'resolved',
+ decisionId: 'decision',
+ actionId: 'apt-action',
+ scope: { orgId: 'org-1', resourceId: 'proxmox:node:pve-1', capabilityName },
+ approvalRequirement: {
+ version: 1,
+ floor: reasonCode === 'capability_auto_elevated' ? 'admin' : 'none',
+ quorum: 1,
+ disallowRequester: false,
+ },
+ planningAllowed: true,
+ requiresApproval: reasonCode === 'capability_auto_elevated',
+ authorities: [
+ {
+ kind: 'capability_registry',
+ sourceId: `capability-registry:${capabilityName}`,
+ status: 'consulted',
+ scope: { orgId: 'org-1', resourceId: 'proxmox:node:pve-1', capabilityName },
+ reasonCodes: [reasonCode],
+ },
+ ],
+ },
+ },
+ result: {
+ success: execution === 'succeeded',
+ actionResultV2: {
+ version: 2,
+ execution: { status: execution, summary },
+ verification: { status: verification, evidenceClass: 'agent_attested' },
+ compensation: { support: 'unavailable', status: 'not_available' },
+ },
},
- result: { success: execution === 'succeeded', actionResultV2: { version: 2, execution: { status: execution, summary }, verification: { status: verification, evidenceClass: 'agent_attested' }, compensation: { support: 'unavailable', status: 'not_available' } } },
verificationOutcome: { status: 'unknown' },
});
describe('APT action presentation', () => {
it('presents an elevated update plan with exact empty parameter authority', () => {
const presentation = getAPTActionPresentation(makeAudit());
- expect(presentation).toMatchObject({ safetyPosture: 'Elevated change', approvalPosture: 'Administrator approval required', parametersValid: true });
- expect(presentation?.parameterAuthority).toContain('accepts no command, path, package selection, removal choice, or reboot request');
+ expect(presentation).toMatchObject({
+ safetyPosture: 'Elevated change',
+ approvalPosture: 'Administrator approval required',
+ parametersValid: true,
+ });
+ expect(presentation?.parameterAuthority).toContain(
+ 'accepts no command, path, package selection, removal choice, or reboot request',
+ );
expect(presentation?.authorityBoundary).toContain('cannot remove packages or reboot');
});
it('presents cleanup as low-risk eligible but irreversible and bounded', () => {
- const presentation = getAPTActionPresentation(makeAudit({ capabilityName: 'clean_package_cache', reasonCode: 'capability_auto_low_risk' }));
- expect(presentation).toMatchObject({ safetyPosture: 'Low-risk automation eligible', approvalPosture: 'No separate approval required by this plan' });
+ const presentation = getAPTActionPresentation(
+ makeAudit({ capabilityName: 'clean_package_cache', reasonCode: 'capability_auto_low_risk' }),
+ );
+ expect(presentation).toMatchObject({
+ safetyPosture: 'Low-risk automation eligible',
+ approvalPosture: 'No separate approval required by this plan',
+ });
expect(presentation?.authorityBoundary).toContain('only downloaded package data');
});
it('shows confirmed agent-attested update facts without inventing independent proof or reboot authority', () => {
- const presentation = getAPTActionPresentation(makeAudit({
- summary: 'APT package updates: phase=complete; 6 pending before, 0 pending after; package manager health: healthy; recovery required: false; reboot required: true',
- execution: 'succeeded', verification: 'confirmed',
- }));
- expect(presentation?.facts).toEqual(expect.arrayContaining([
- { label: 'Updates remaining', value: '0' },
- { label: 'Update system health', value: 'Known healthy' },
- { label: 'Reboot required', value: 'Yes — fact only; no reboot was authorized' },
- ]));
+ const presentation = getAPTActionPresentation(
+ makeAudit({
+ summary:
+ 'APT package updates: phase=complete; 6 pending before, 0 pending after; package manager health: healthy; recovery required: false; reboot required: true',
+ execution: 'succeeded',
+ verification: 'confirmed',
+ }),
+ );
+ expect(presentation?.facts).toEqual(
+ expect.arrayContaining([
+ { label: 'Updates remaining', value: '0' },
+ { label: 'Update system health', value: 'Known healthy' },
+ { label: 'Reboot required', value: 'Yes — fact only; no reboot was authorized' },
+ ]),
+ );
expect(presentation?.nextStep).toContain('separate governed action');
});
it('makes a partial unhealthy install recovery-required and forbids automatic retry', () => {
- const presentation = getAPTActionPresentation(makeAudit({
- summary: 'APT package updates: phase=install; 6 pending before, 3 pending after; package manager health: unhealthy; recovery required: true; reboot required: false',
- execution: 'inconclusive', verification: 'contradicted',
- }));
- expect(presentation?.facts).toEqual(expect.arrayContaining([
- { label: 'Last phase reached', value: 'Install updates' },
- { label: 'Updates remaining', value: '3' },
- { label: 'Update system health', value: 'Known unhealthy' },
- { label: 'Recovery required', value: 'Yes' },
- ]));
+ const presentation = getAPTActionPresentation(
+ makeAudit({
+ summary:
+ 'APT package updates: phase=install; 6 pending before, 3 pending after; package manager health: unhealthy; recovery required: true; reboot required: false',
+ execution: 'inconclusive',
+ verification: 'contradicted',
+ }),
+ );
+ expect(presentation?.facts).toEqual(
+ expect.arrayContaining([
+ { label: 'Last phase reached', value: 'Install updates' },
+ { label: 'Updates remaining', value: '3' },
+ { label: 'Update system health', value: 'Known unhealthy' },
+ { label: 'Recovery required', value: 'Yes' },
+ ]),
+ );
expect(presentation?.nextStep).toMatch(/^Do not retry\./);
});
it('keeps a delayed legacy result inconclusive when health is unknown', () => {
- const presentation = getAPTActionPresentation(makeAudit({
- summary: 'APT package updates: phase=verify; 4 pending before, 4 pending after; package manager health: unknown; recovery required: false; reboot required: false',
- }));
+ const presentation = getAPTActionPresentation(
+ makeAudit({
+ summary:
+ 'APT package updates: phase=verify; 4 pending before, 4 pending after; package manager health: unknown; recovery required: false; reboot required: false',
+ }),
+ );
expect(presentation?.facts).toContainEqual({ label: 'Update system health', value: 'Unknown' });
expect(presentation?.nextStep).toContain('Do not retry automatically');
});
it('shows measured cleanup bytes and an irreversible rescan-required failure', () => {
- const presentation = getAPTActionPresentation(makeAudit({
- capabilityName: 'clean_package_cache', reasonCode: 'capability_auto_low_risk',
- summary: 'APT package cache: phase=clean; 104857600 bytes before, 52428800 bytes after, 52428800 bytes reclaimed; rollback available: false; rescan required: true',
- execution: 'failed', verification: 'inconclusive',
- }));
- expect(presentation?.facts).toEqual(expect.arrayContaining([
- { label: 'Downloaded package data before', value: '100 MB' },
- { label: 'Downloaded package data after', value: '50.0 MB' },
- { label: 'Space reclaimed', value: '50.0 MB' },
- { label: 'Rollback', value: 'Unavailable — cleanup is irreversible' },
- { label: 'Fresh rescan required', value: 'Yes' },
- ]));
+ const presentation = getAPTActionPresentation(
+ makeAudit({
+ capabilityName: 'clean_package_cache',
+ reasonCode: 'capability_auto_low_risk',
+ summary:
+ 'APT package cache: phase=clean; 104857600 bytes before, 52428800 bytes after, 52428800 bytes reclaimed; rollback available: false; rescan required: true',
+ execution: 'failed',
+ verification: 'inconclusive',
+ }),
+ );
+ expect(presentation?.facts).toEqual(
+ expect.arrayContaining([
+ { label: 'Downloaded package data before', value: '100 MB' },
+ { label: 'Downloaded package data after', value: '50.0 MB' },
+ { label: 'Space reclaimed', value: '50.0 MB' },
+ { label: 'Rollback', value: 'Unavailable — cleanup is irreversible' },
+ { label: 'Fresh rescan required', value: 'Yes' },
+ ]),
+ );
expect(presentation?.nextStep).toContain('Do not retry automatically');
});
it('fails closed for unexpected parameters and malformed result summaries', () => {
- const presentation = getAPTActionPresentation(makeAudit({ params: { package: 'curl' }, summary: 'phase=complete; success=true' }));
+ const presentation = getAPTActionPresentation(
+ makeAudit({ params: { package: 'curl' }, summary: 'phase=complete; success=true' }),
+ );
expect(presentation?.parametersValid).toBe(false);
expect(presentation?.facts).toEqual([]);
expect(presentation?.parameterAuthority).toContain('Unexpected parameters');
@@ -105,12 +190,36 @@ describe('APT action presentation', () => {
});
it.each([
- ['unknown update phase', 'install_os_updates', 'APT package updates: phase=download; 6 pending before, 3 pending after; package manager health: healthy; recovery required: false; reboot required: false'],
- ['cleanup-only phase in update', 'install_os_updates', 'APT package updates: phase=clean; 6 pending before, 3 pending after; package manager health: healthy; recovery required: false; reboot required: false'],
- ['update-only phase in cleanup', 'clean_package_cache', 'APT package cache: phase=install; 100 bytes before, 50 bytes after, 50 bytes reclaimed; rollback available: false; rescan required: false'],
- ['unsafe update count', 'install_os_updates', 'APT package updates: phase=verify; 999999999999999999999 pending before, 0 pending after; package manager health: healthy; recovery required: false; reboot required: false'],
- ['impossible cleanup remainder', 'clean_package_cache', 'APT package cache: phase=verify; 100 bytes before, 120 bytes after, 0 bytes reclaimed; rollback available: false; rescan required: true'],
- ['impossible cleanup reclaimed arithmetic', 'clean_package_cache', 'APT package cache: phase=verify; 100 bytes before, 50 bytes after, 40 bytes reclaimed; rollback available: false; rescan required: true'],
+ [
+ 'unknown update phase',
+ 'install_os_updates',
+ 'APT package updates: phase=download; 6 pending before, 3 pending after; package manager health: healthy; recovery required: false; reboot required: false',
+ ],
+ [
+ 'cleanup-only phase in update',
+ 'install_os_updates',
+ 'APT package updates: phase=clean; 6 pending before, 3 pending after; package manager health: healthy; recovery required: false; reboot required: false',
+ ],
+ [
+ 'update-only phase in cleanup',
+ 'clean_package_cache',
+ 'APT package cache: phase=install; 100 bytes before, 50 bytes after, 50 bytes reclaimed; rollback available: false; rescan required: false',
+ ],
+ [
+ 'unsafe update count',
+ 'install_os_updates',
+ 'APT package updates: phase=verify; 999999999999999999999 pending before, 0 pending after; package manager health: healthy; recovery required: false; reboot required: false',
+ ],
+ [
+ 'impossible cleanup remainder',
+ 'clean_package_cache',
+ 'APT package cache: phase=verify; 100 bytes before, 120 bytes after, 0 bytes reclaimed; rollback available: false; rescan required: true',
+ ],
+ [
+ 'impossible cleanup reclaimed arithmetic',
+ 'clean_package_cache',
+ 'APT package cache: phase=verify; 100 bytes before, 50 bytes after, 40 bytes reclaimed; rollback available: false; rescan required: true',
+ ],
] as const)('fails closed for %s', (_name, capabilityName, summary) => {
const presentation = getAPTActionPresentation(makeAudit({ capabilityName, summary }));
expect(presentation?.facts).toEqual([]);
@@ -118,8 +227,10 @@ describe('APT action presentation', () => {
});
it('does not declare a second frontend action truth dialect', () => {
- expect(source).not.toMatch(/(?:type|enum)\s+APT(?:Execution|Verification|Evidence|Health|Recovery|Compensation)/);
+ expect(source).not.toMatch(
+ /(?:type|enum)\s+APT(?:Execution|Verification|Evidence|Health|Recovery|Compensation)/,
+ );
expect(source).toContain("import type { ActionAuditRecord } from '@/types/actionAudit'");
- expect(source).toContain("actionResultV2?.verification");
+ expect(source).toContain('actionResultV2?.verification');
});
});
diff --git a/frontend-modern/src/features/actions/aptActionPresentation.ts b/frontend-modern/src/features/actions/aptActionPresentation.ts
index 38f1f94358..03413ff580 100644
--- a/frontend-modern/src/features/actions/aptActionPresentation.ts
+++ b/frontend-modern/src/features/actions/aptActionPresentation.ts
@@ -56,14 +56,22 @@ const getUpdateFacts = (summary: string): APTActionPresentationFact[] => {
const after = parseCount(match[3]);
const phase = formatPhase(match[1], 'update');
if (before === undefined || after === undefined || !phase) return [];
- const health = match[4] === 'healthy' ? 'Known healthy' : match[4] === 'unhealthy' ? 'Known unhealthy' : 'Unknown';
+ const health =
+ match[4] === 'healthy'
+ ? 'Known healthy'
+ : match[4] === 'unhealthy'
+ ? 'Known unhealthy'
+ : 'Unknown';
return [
{ label: 'Last phase reached', value: phase },
{ label: 'Updates before', value: String(before) },
{ label: 'Updates remaining', value: String(after) },
{ label: 'Update system health', value: health },
{ label: 'Recovery required', value: match[5] === 'true' ? 'Yes' : 'No' },
- { label: 'Reboot required', value: match[6] === 'true' ? 'Yes — fact only; no reboot was authorized' : 'No' },
+ {
+ label: 'Reboot required',
+ value: match[6] === 'true' ? 'Yes — fact only; no reboot was authorized' : 'No',
+ },
];
};
@@ -83,7 +91,8 @@ const getCleanupFacts = (summary: string): APTActionPresentationFact[] => {
!phase ||
after > before ||
reclaimed !== before - after
- ) return [];
+ )
+ return [];
return [
{ label: 'Last phase reached', value: phase },
{ label: 'Downloaded package data before', value: formatBytes(before) },
@@ -118,20 +127,25 @@ export const getAPTActionPresentation = (
let nextStep = 'Review the server policy and exact scope before making a decision.';
if (audit.result?.actionResultV2 && facts.length === 0) {
- nextStep = 'Refresh this action record and review the canonical result before deciding what to do next.';
+ nextStep =
+ 'Refresh this action record and review the canonical result before deciding what to do next.';
} else if (verification?.status === 'confirmed') {
nextStep = isUpdate
? 'Review the remaining-update and reboot facts. A reboot, if needed, is a separate governed action.'
: 'Review the measured space reclaimed. Create another cleanup plan only if a fresh scan still shows pressure.';
} else if (audit.result?.actionResultV2) {
if (isUpdate && recoveryRequired) {
- nextStep = 'Do not retry. Repair the host update system, run a fresh scan, and create a new plan only after health is known.';
+ nextStep =
+ 'Do not retry. Repair the host update system, run a fresh scan, and create a new plan only after health is known.';
} else if (isUpdate && health === 'Unknown') {
- nextStep = 'Do not retry automatically. Run a fresh host scan so update-system health and remaining updates are known.';
+ nextStep =
+ 'Do not retry automatically. Run a fresh host scan so update-system health and remaining updates are known.';
} else if (!isUpdate && rescanRequired) {
- nextStep = 'Do not retry automatically. Run a fresh scan to measure the current cache pressure before creating another plan.';
+ nextStep =
+ 'Do not retry automatically. Run a fresh scan to measure the current cache pressure before creating another plan.';
} else {
- nextStep = 'Review the separate execution and verification results, then rescan before creating another plan.';
+ nextStep =
+ 'Review the separate execution and verification results, then rescan before creating another plan.';
}
}
diff --git a/frontend-modern/src/features/alerts/AlertHistoryFrequencyCard.tsx b/frontend-modern/src/features/alerts/AlertHistoryFrequencyCard.tsx
index d9c70f92a8..97cdf057b4 100644
--- a/frontend-modern/src/features/alerts/AlertHistoryFrequencyCard.tsx
+++ b/frontend-modern/src/features/alerts/AlertHistoryFrequencyCard.tsx
@@ -27,7 +27,9 @@ export function AlertHistoryFrequencyCard(props: AlertHistoryFrequencyCardProps)
<div class="mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between sm:gap-3">
<SectionHeader
title="Alert frequency"
- description={<span class="text-xs text-muted">{props.state.alertData().length} alerts</span>}
+ description={
+ <span class="text-xs text-muted">{props.state.alertData().length} alerts</span>
+ }
size="sm"
class="flex-1"
/>
@@ -69,18 +71,14 @@ export function AlertHistoryFrequencyCard(props: AlertHistoryFrequencyCardProps)
<span class="flex items-center gap-1">
<div class={getAlertSeverityDotClass('warning')}></div>
{
- props.state
- .alertData()
- .filter((alert) => alert.severity === 'warning').length
+ props.state.alertData().filter((alert) => alert.severity === 'warning').length
}{' '}
warnings
</span>
<span class="flex items-center gap-1">
<div class={getAlertSeverityDotClass('critical')}></div>
{
- props.state
- .alertData()
- .filter((alert) => alert.severity === 'critical').length
+ props.state.alertData().filter((alert) => alert.severity === 'critical').length
}{' '}
critical
</span>
diff --git a/frontend-modern/src/features/alerts/AlertHistoryTableGroupRow.tsx b/frontend-modern/src/features/alerts/AlertHistoryTableGroupRow.tsx
index ecbf15c0d1..4899333523 100644
--- a/frontend-modern/src/features/alerts/AlertHistoryTableGroupRow.tsx
+++ b/frontend-modern/src/features/alerts/AlertHistoryTableGroupRow.tsx
@@ -25,9 +25,7 @@ function getGroupSummaryLabel(group: AlertHistoryGroup) {
parts.push(`${aiCount} patrol insight${aiCount === 1 ? '' : 's'}`);
}
- return (
- parts.join(', ') || `${group.alerts.length} item${group.alerts.length === 1 ? '' : 's'}`
- );
+ return parts.join(', ') || `${group.alerts.length} item${group.alerts.length === 1 ? '' : 's'}`;
}
export function AlertHistoryTableGroupRow(props: AlertHistoryTableGroupRowProps) {
@@ -38,9 +36,7 @@ export function AlertHistoryTableGroupRow(props: AlertHistoryTableGroupRowProps)
<span class="truncate" title={props.group.fullLabel}>
{props.group.label}
</span>
- <span class={GROUPED_TABLE_ROW_META_CLASS}>
- {getGroupSummaryLabel(props.group)}
- </span>
+ <span class={GROUPED_TABLE_ROW_META_CLASS}>{getGroupSummaryLabel(props.group)}</span>
</div>
</TableCell>
</TableRow>
diff --git a/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx b/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
index 6b43ea74e6..4cbad84dc1 100644
--- a/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
+++ b/frontend-modern/src/features/alerts/AlertOverviewActiveAlertsSection.tsx
@@ -134,9 +134,7 @@ export function AlertOverviewActiveAlertsSection(props: AlertOverviewActiveAlert
class="text-xs text-muted hover:text-base-content transition-colors"
onClick={() => toggleGroup(group.key)}
>
- {isGroupExpanded(group.key)
- ? 'Hide'
- : `+${group.related.length} related`}
+ {isGroupExpanded(group.key) ? 'Hide' : `+${group.related.length} related`}
</button>
<Show when={[group.primary, ...group.related].some((a) => !a.acknowledged)}>
<button
diff --git a/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx b/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx
index 0745d52c38..336287c59e 100644
--- a/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx
+++ b/frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx
@@ -39,12 +39,19 @@ export function AlertOverviewAlertCard(props: AlertOverviewAlertCardProps) {
const resourceLink = (): string => {
const rid = props.alert.resourceId ?? '';
- const resourceType = typeof props.alert.metadata?.resourceType === 'string'
- ? props.alert.metadata.resourceType as string
- : '';
+ const resourceType =
+ typeof props.alert.metadata?.resourceType === 'string'
+ ? (props.alert.metadata.resourceType as string)
+ : '';
if (rid.startsWith('agent:') || resourceType === 'agent') return '/machines';
- if (rid.includes('docker') || resourceType === 'docker-container' || resourceType === 'docker-host') return '/docker/overview';
- if (resourceType === 'kubernetes' || resourceType.startsWith('k8s-')) return '/kubernetes/overview';
+ if (
+ rid.includes('docker') ||
+ resourceType === 'docker-container' ||
+ resourceType === 'docker-host'
+ )
+ return '/docker/overview';
+ if (resourceType === 'kubernetes' || resourceType.startsWith('k8s-'))
+ return '/kubernetes/overview';
return '/proxmox/overview';
};
diff --git a/frontend-modern/src/features/alerts/AlertScheduleSummarySection.tsx b/frontend-modern/src/features/alerts/AlertScheduleSummarySection.tsx
index 68f59fc742..b775d2c4c6 100644
--- a/frontend-modern/src/features/alerts/AlertScheduleSummarySection.tsx
+++ b/frontend-modern/src/features/alerts/AlertScheduleSummarySection.tsx
@@ -13,12 +13,7 @@ import {
getAlertConfigSummarySuppressing,
} from '@/utils/alertConfigPresentation';
-import type {
- CooldownConfig,
- EscalationConfig,
- GroupingConfig,
- QuietHoursConfig,
-} from './types';
+import type { CooldownConfig, EscalationConfig, GroupingConfig, QuietHoursConfig } from './types';
interface QuietSuppressOption {
key: keyof QuietHoursConfig['suppress'];
diff --git a/frontend-modern/src/features/alerts/AlertWebhookDestinationsSection.tsx b/frontend-modern/src/features/alerts/AlertWebhookDestinationsSection.tsx
index 513f5b7f54..11afd982c6 100644
--- a/frontend-modern/src/features/alerts/AlertWebhookDestinationsSection.tsx
+++ b/frontend-modern/src/features/alerts/AlertWebhookDestinationsSection.tsx
@@ -20,7 +20,9 @@ export function AlertWebhookDestinationsSection(props: AlertWebhookDestinationsS
<SettingsPanel
title={getAlertWebhooksSectionTitle()}
description={getAlertWebhooksSectionDescription()}
- action={<span class="whitespace-nowrap text-xs text-muted">{props.webhooks.length} configured</span>}
+ action={
+ <span class="whitespace-nowrap text-xs text-muted">{props.webhooks.length} configured</span>
+ }
class="min-w-0"
bodyClass="space-y-4"
>
diff --git a/frontend-modern/src/features/alerts/__tests__/HistoryTab.test.tsx b/frontend-modern/src/features/alerts/__tests__/HistoryTab.test.tsx
index ba4af596d4..88c7882340 100644
--- a/frontend-modern/src/features/alerts/__tests__/HistoryTab.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/HistoryTab.test.tsx
@@ -49,12 +49,7 @@ vi.mock('../AlertHistoryAdministrationCard', () => ({
describe('HistoryTab', () => {
it('renders against the current history-state contract without depending on legacy filteredAlerts', () => {
- render(() => (
- <HistoryTab
- getResource={() => undefined}
- allResources={() => []}
- />
- ));
+ render(() => <HistoryTab getResource={() => undefined} allResources={() => []} />);
expect(screen.getByText('frequency-card')).toBeInTheDocument();
expect(screen.getByText('filters-card')).toBeInTheDocument();
diff --git a/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712.test.ts b/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712.test.ts
index 8978d80333..372a05c47a 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712.test.ts
@@ -48,40 +48,26 @@ describe('buildEmailConfigPayload — branch coverage (batch 2)', () => {
// Each entry is non-empty before trim but becomes '' after trim,
// exercising the `entry.length > 0 === false` filter arm for
// strings that only become empty *after* trimming.
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ to: [' ', '\t', '\n'] }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ to: [' ', '\t', '\n'] }));
expect(result.to).toStrictEqual([]);
});
it('strips leading-only, trailing-only, and tab-padded whitespace independently', () => {
const result = buildEmailConfigPayload(
makeUIEmailConfig({
- to: [
- ],
}),
);
- expect(result.to).toStrictEqual([
- ]);
+ expect(result.to).toStrictEqual(['[email protected]', '[email protected]', '[email protected]']);
});
it('preserves internal whitespace within recipient entries', () => {
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ to: [' alice [email protected] '] }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ to: [' alice [email protected] '] }));
expect(result.to).toStrictEqual(['alice [email protected]']);
});
it('keeps a single already-trimmed entry without modification', () => {
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ to: ['[email protected]'] }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ to: ['[email protected]'] }));
expect(result.to).toStrictEqual(['[email protected]']);
});
diff --git a/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712c.test.ts b/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712c.test.ts
index 77be9e6f0a..c29e9f8f6a 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712c.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0712c.test.ts
@@ -42,9 +42,7 @@ describe('buildEmailConfigPayload — branch coverage (batch 3 / 0712c)', () =>
// -----------------------------------------------------------------------
describe('trim arm — exotic whitespace', () => {
it('strips carriage-return and CRLF sequences from both ends', () => {
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ to: ['\r\[email protected]\r\n'] }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ to: ['\r\[email protected]\r\n'] }));
expect(result.to).toStrictEqual(['[email protected]']);
});
@@ -77,9 +75,7 @@ describe('buildEmailConfigPayload — branch coverage (batch 3 / 0712c)', () =>
// U+2028 (line separator) and U+2029 (paragraph separator) are
// whitespace from trim()'s perspective; a sole entry of them must
// be filtered out, leaving an empty to list.
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ to: ['\u2028\u2029'] }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ to: ['\u2028\u2029'] }));
expect(result.to).toStrictEqual([]);
});
});
@@ -100,9 +96,7 @@ describe('buildEmailConfigPayload — branch coverage (batch 3 / 0712c)', () =>
});
it('keeps the literal string "false" because length > 0', () => {
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ to: ['false'] }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ to: ['false'] }));
expect(result.to).toStrictEqual(['false']);
});
@@ -120,11 +114,7 @@ describe('buildEmailConfigPayload — branch coverage (batch 3 / 0712c)', () =>
}),
);
- expect(result.to).toStrictEqual([
- ]);
+ expect(result.to).toStrictEqual(['[email protected]', '[email protected]', '[email protected]']);
});
});
@@ -142,9 +132,7 @@ describe('buildEmailConfigPayload — branch coverage (batch 3 / 0712c)', () =>
});
it('preserves an internal tab while trimming ends', () => {
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ to: ['\ta\[email protected]\t'] }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ to: ['\ta\[email protected]\t'] }));
expect(result.to).toStrictEqual(['a\[email protected]']);
});
});
@@ -198,9 +186,7 @@ describe('buildEmailConfigPayload — branch coverage (batch 3 / 0712c)', () =>
});
it('forwards a custom provider string unchanged', () => {
- const result = buildEmailConfigPayload(
- makeUIEmailConfig({ provider: 'mailgun' }),
- );
+ const result = buildEmailConfigPayload(makeUIEmailConfig({ provider: 'mailgun' }));
expect(result.provider).toBe('mailgun');
});
});
diff --git a/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0713.test.ts b/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0713.test.ts
index f465a3b2cc..acd35fd099 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0713.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertDestinationsModel.branchcov0713.test.ts
@@ -172,15 +172,13 @@ describe('normalizeAppriseConfig — branch coverage (0713)', () => {
it("falls back apiKeyHeader to 'X-API-KEY' when empty or undefined", () => {
expect(normalizeAppriseConfig({ apiKeyHeader: '' }).apiKeyHeader).toBe('X-API-KEY');
- expect(normalizeAppriseConfig({ apiKeyHeader: undefined }).apiKeyHeader).toBe(
- 'X-API-KEY',
- );
+ expect(normalizeAppriseConfig({ apiKeyHeader: undefined }).apiKeyHeader).toBe('X-API-KEY');
});
it('forwards a custom apiKeyHeader verbatim', () => {
- expect(
- normalizeAppriseConfig({ apiKeyHeader: 'Authorization' }).apiKeyHeader,
- ).toBe('Authorization');
+ expect(normalizeAppriseConfig({ apiKeyHeader: 'Authorization' }).apiKeyHeader).toBe(
+ 'Authorization',
+ );
});
});
@@ -230,9 +228,7 @@ describe('normalizeAppriseConfig — branch coverage (0713)', () => {
// Documents current behaviour: the guard checks typeof and > 0 but
// not Number.isFinite, so Infinity leaks through. Pinned, not fixed.
const malformed = { timeoutSeconds: Number.POSITIVE_INFINITY } as Partial<AppriseConfig>;
- expect(normalizeAppriseConfig(malformed).timeoutSeconds).toBe(
- Number.POSITIVE_INFINITY,
- );
+ expect(normalizeAppriseConfig(malformed).timeoutSeconds).toBe(Number.POSITIVE_INFINITY);
});
});
@@ -295,10 +291,10 @@ describe('normalizeAppriseConfig — branch coverage (0713)', () => {
expect(normalizeAppriseConfig({ targets: [] }).targetsText).toBe('');
});
- it("joins a single target without a trailing newline", () => {
- expect(
- normalizeAppriseConfig({ targets: ['mailto://[email protected]'] }).targetsText,
- ).toBe('mailto://[email protected]');
+ it('joins a single target without a trailing newline', () => {
+ expect(normalizeAppriseConfig({ targets: ['mailto://[email protected]'] }).targetsText).toBe(
+ 'mailto://[email protected]',
+ );
});
it("joins multiple targets with '\\n'", () => {
@@ -348,15 +344,11 @@ describe('buildAppriseConfigPayload — branch coverage (0713)', () => {
// -----------------------------------------------------------------------
describe('mode passthrough', () => {
it("forwards mode 'http' unchanged", () => {
- expect(buildAppriseConfigPayload(makeUIAppriseConfig({ mode: 'http' })).mode).toBe(
- 'http',
- );
+ expect(buildAppriseConfigPayload(makeUIAppriseConfig({ mode: 'http' })).mode).toBe('http');
});
it("forwards mode 'cli' unchanged", () => {
- expect(buildAppriseConfigPayload(makeUIAppriseConfig({ mode: 'cli' })).mode).toBe(
- 'cli',
- );
+ expect(buildAppriseConfigPayload(makeUIAppriseConfig({ mode: 'cli' })).mode).toBe('cli');
});
});
@@ -367,28 +359,24 @@ describe('buildAppriseConfigPayload — branch coverage (0713)', () => {
// -----------------------------------------------------------------------
describe('boolean passthrough', () => {
it('forwards enabled true', () => {
- expect(buildAppriseConfigPayload(makeUIAppriseConfig({ enabled: true })).enabled).toBe(
- true,
- );
+ expect(buildAppriseConfigPayload(makeUIAppriseConfig({ enabled: true })).enabled).toBe(true);
});
it('forwards enabled false', () => {
- expect(
- buildAppriseConfigPayload(makeUIAppriseConfig({ enabled: false })).enabled,
- ).toBe(false);
+ expect(buildAppriseConfigPayload(makeUIAppriseConfig({ enabled: false })).enabled).toBe(
+ false,
+ );
});
it('forwards skipTlsVerify true', () => {
expect(
- buildAppriseConfigPayload(makeUIAppriseConfig({ skipTlsVerify: true }))
- .skipTlsVerify,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ skipTlsVerify: true })).skipTlsVerify,
).toBe(true);
});
it('forwards skipTlsVerify false', () => {
expect(
- buildAppriseConfigPayload(makeUIAppriseConfig({ skipTlsVerify: false }))
- .skipTlsVerify,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ skipTlsVerify: false })).skipTlsVerify,
).toBe(false);
});
});
@@ -408,21 +396,21 @@ describe('buildAppriseConfigPayload — branch coverage (0713)', () => {
// -----------------------------------------------------------------------
describe('targetsText → targets via parseAppriseTargets', () => {
it('returns [] for an empty targetsText', () => {
- expect(buildAppriseConfigPayload(makeUIAppriseConfig({ targetsText: '' })).targets).toStrictEqual([]);
+ expect(
+ buildAppriseConfigPayload(makeUIAppriseConfig({ targetsText: '' })).targets,
+ ).toStrictEqual([]);
});
it('returns [] for a whitespace-only targetsText (filtered after trim)', () => {
expect(
- buildAppriseConfigPayload(makeUIAppriseConfig({ targetsText: ' \n ,' }))
- .targets,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ targetsText: ' \n ,' })).targets,
).toStrictEqual([]);
});
it('returns a single-element array for a one-line targetsText', () => {
expect(
- buildAppriseConfigPayload(
- makeUIAppriseConfig({ targetsText: 'mailto://[email protected]' }),
- ).targets,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ targetsText: 'mailto://[email protected]' }))
+ .targets,
).toStrictEqual(['mailto://[email protected]']);
});
@@ -496,17 +484,13 @@ describe('buildAppriseConfigPayload — branch coverage (0713)', () => {
it('treats differently-cased entries as distinct (no lowercasing)', () => {
expect(
- buildAppriseConfigPayload(
- makeUIAppriseConfig({ targetsText: '[email protected],[email protected]' }),
- ).targets,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ targetsText: '[email protected],[email protected]' })).targets,
).toStrictEqual(['[email protected]', '[email protected]']);
});
it('preserves internal whitespace within an entry (trim is ends-only)', () => {
expect(
- buildAppriseConfigPayload(
- makeUIAppriseConfig({ targetsText: 'a [email protected]' }),
- ).targets,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ targetsText: 'a [email protected]' })).targets,
).toStrictEqual(['a [email protected]']);
});
});
@@ -537,8 +521,7 @@ describe('buildAppriseConfigPayload — branch coverage (0713)', () => {
it('forwards a positive timeoutSeconds verbatim', () => {
expect(
- buildAppriseConfigPayload(makeUIAppriseConfig({ timeoutSeconds: 45 }))
- .timeoutSeconds,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ timeoutSeconds: 45 })).timeoutSeconds,
).toBe(45);
});
@@ -547,8 +530,7 @@ describe('buildAppriseConfigPayload — branch coverage (0713)', () => {
// the inbound normalizeAppriseConfig guard is the only place 0 is
// rewritten. Pin this so a future clamp here would be noticed.
expect(
- buildAppriseConfigPayload(makeUIAppriseConfig({ timeoutSeconds: 0 }))
- .timeoutSeconds,
+ buildAppriseConfigPayload(makeUIAppriseConfig({ timeoutSeconds: 0 })).timeoutSeconds,
).toBe(0);
});
});
diff --git a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov0712.test.ts b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov0712.test.ts
index 1f62f098d3..7d42d01f66 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov0712.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov0712.test.ts
@@ -109,9 +109,9 @@ describe('buildAlertHistoryParams', () => {
});
it('falls back to limit 1000 with no startTime for an unrecognised range', () => {
- expect(
- buildAlertHistoryParams('bogus' as AlertHistoryRange, now),
- ).toStrictEqual({ limit: 1000 });
+ expect(buildAlertHistoryParams('bogus' as AlertHistoryRange, now)).toStrictEqual({
+ limit: 1000,
+ });
});
});
@@ -122,9 +122,9 @@ describe('buildAlertHistoryParams', () => {
describe('formatAlertHistoryDuration', () => {
it('returns "0m" when end is before start (negative duration)', () => {
- expect(
- formatAlertHistoryDuration('2026-03-22T10:00:00.000Z', '2026-03-22T09:00:00.000Z'),
- ).toBe('0m');
+ expect(formatAlertHistoryDuration('2026-03-22T10:00:00.000Z', '2026-03-22T09:00:00.000Z')).toBe(
+ '0m',
+ );
});
it('uses the provided `now` when endTime is omitted', () => {
@@ -139,23 +139,23 @@ describe('formatAlertHistoryDuration', () => {
});
it('formats the minute-only arm with leading minutes under one hour', () => {
- expect(
- formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T09:05:00.000Z'),
- ).toBe('5m');
+ expect(formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T09:05:00.000Z')).toBe(
+ '5m',
+ );
});
it('renders the residual minutes even when hours divide evenly', () => {
// exactly 1 hour → minutes=60, hours=1, days=0 → "1h 0m"
- expect(
- formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T10:00:00.000Z'),
- ).toBe('1h 0m');
+ expect(formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T10:00:00.000Z')).toBe(
+ '1h 0m',
+ );
});
it('renders the residual hours even when days divide evenly', () => {
// exactly 1 day → minutes=1440, hours=24, days=1 → "1d 0h"
- expect(
- formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-23T09:00:00.000Z'),
- ).toBe('1d 0h');
+ expect(formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-23T09:00:00.000Z')).toBe(
+ '1d 0h',
+ );
});
});
@@ -460,9 +460,7 @@ describe('buildAlertTrends (nice-size fallback)', () => {
// ~1801 days ago → rawRangeHours ≈ 43224 → rawBucketSize = ceil(43224/30) = 1441
// which is larger than the max nice value (1440), so `.find()` returns undefined
// and the `?? rawBucketSize` fallback engages.
- const alerts = [
- makeItem({ startTime: new Date(now - 1801 * 24 * MS_PER_HOUR).toISOString() }),
- ];
+ const alerts = [makeItem({ startTime: new Date(now - 1801 * 24 * MS_PER_HOUR).toISOString() })];
const trends = buildAlertTrends(alerts, 'all', now);
expect(trends.bucketSize).toBe(1441);
expect(trends.rangeHours).toBe(30 * 1441);
@@ -470,9 +468,7 @@ describe('buildAlertTrends (nice-size fallback)', () => {
});
it('caps the bucket count at maxBuckets (30) for a very wide range', () => {
- const alerts = [
- makeItem({ startTime: new Date(now - 5000 * 24 * MS_PER_HOUR).toISOString() }),
- ];
+ const alerts = [makeItem({ startTime: new Date(now - 5000 * 24 * MS_PER_HOUR).toISOString() })];
const trends = buildAlertTrends(alerts, 'all', now);
expect(trends.buckets.length).toBeLessThanOrEqual(30);
expect(trends.rangeHours).toBe(trends.buckets.length * trends.bucketSize);
@@ -639,9 +635,7 @@ describe('formatAlertHistoryGroupLabel', () => {
describe('getIncidentRowKey', () => {
it('joins id and startTime with "::" into a stable composite key', () => {
expect(
- getIncidentRowKey(
- makeItem({ id: 'inc-9', startTime: '2026-03-22T09:00:00.000Z' }),
- ),
+ getIncidentRowKey(makeItem({ id: 'inc-9', startTime: '2026-03-22T09:00:00.000Z' })),
).toBe('inc-9::2026-03-22T09:00:00.000Z');
});
});
diff --git a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov2.test.ts b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov2.test.ts
index a578e63d4c..ef0d600bfc 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov2.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.branchcov2.test.ts
@@ -108,9 +108,9 @@ describe('buildAlertHistoryParams', () => {
});
it('falls back to limit 1000 with no startTime for an unrecognised range', () => {
- expect(
- buildAlertHistoryParams('bogus' as AlertHistoryRange, now),
- ).toStrictEqual({ limit: 1000 });
+ expect(buildAlertHistoryParams('bogus' as AlertHistoryRange, now)).toStrictEqual({
+ limit: 1000,
+ });
});
});
@@ -121,9 +121,9 @@ describe('buildAlertHistoryParams', () => {
describe('formatAlertHistoryDuration', () => {
it('returns "0m" when end is before start (negative duration)', () => {
- expect(
- formatAlertHistoryDuration('2026-03-22T10:00:00.000Z', '2026-03-22T09:00:00.000Z'),
- ).toBe('0m');
+ expect(formatAlertHistoryDuration('2026-03-22T10:00:00.000Z', '2026-03-22T09:00:00.000Z')).toBe(
+ '0m',
+ );
});
it('uses the provided `now` when endTime is omitted', () => {
@@ -138,23 +138,23 @@ describe('formatAlertHistoryDuration', () => {
});
it('formats the minute-only arm with leading minutes under one hour', () => {
- expect(
- formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T09:05:00.000Z'),
- ).toBe('5m');
+ expect(formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T09:05:00.000Z')).toBe(
+ '5m',
+ );
});
it('renders the residual minutes even when hours divide evenly', () => {
// exactly 1 hour → minutes=60, hours=1, days=0 → "1h 0m"
- expect(
- formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T10:00:00.000Z'),
- ).toBe('1h 0m');
+ expect(formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-22T10:00:00.000Z')).toBe(
+ '1h 0m',
+ );
});
it('renders the residual hours even when days divide evenly', () => {
// exactly 1 day → minutes=1440, hours=24, days=1 → "1d 0h"
- expect(
- formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-23T09:00:00.000Z'),
- ).toBe('1d 0h');
+ expect(formatAlertHistoryDuration('2026-03-22T09:00:00.000Z', '2026-03-23T09:00:00.000Z')).toBe(
+ '1d 0h',
+ );
});
});
@@ -459,9 +459,7 @@ describe('buildAlertTrends (nice-size fallback)', () => {
// ~1801 days ago → rawRangeHours ≈ 43224 → rawBucketSize = ceil(43224/30) = 1441
// which is larger than the max nice value (1440), so `.find()` returns undefined
// and the `?? rawBucketSize` fallback engages.
- const alerts = [
- makeItem({ startTime: new Date(now - 1801 * 24 * MS_PER_HOUR).toISOString() }),
- ];
+ const alerts = [makeItem({ startTime: new Date(now - 1801 * 24 * MS_PER_HOUR).toISOString() })];
const trends = buildAlertTrends(alerts, 'all', now);
expect(trends.bucketSize).toBe(1441);
expect(trends.rangeHours).toBe(30 * 1441);
@@ -469,9 +467,7 @@ describe('buildAlertTrends (nice-size fallback)', () => {
});
it('caps the bucket count at maxBuckets (30) for a very wide range', () => {
- const alerts = [
- makeItem({ startTime: new Date(now - 5000 * 24 * MS_PER_HOUR).toISOString() }),
- ];
+ const alerts = [makeItem({ startTime: new Date(now - 5000 * 24 * MS_PER_HOUR).toISOString() })];
const trends = buildAlertTrends(alerts, 'all', now);
expect(trends.buckets.length).toBeLessThanOrEqual(30);
expect(trends.rangeHours).toBe(trends.buckets.length * trends.bucketSize);
@@ -638,9 +634,7 @@ describe('formatAlertHistoryGroupLabel', () => {
describe('getIncidentRowKey', () => {
it('joins id and startTime with "::" into a stable composite key', () => {
expect(
- getIncidentRowKey(
- makeItem({ id: 'inc-9', startTime: '2026-03-22T09:00:00.000Z' }),
- ),
+ getIncidentRowKey(makeItem({ id: 'inc-9', startTime: '2026-03-22T09:00:00.000Z' })),
).toBe('inc-9::2026-03-22T09:00:00.000Z');
});
});
diff --git a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.coverage.test.ts b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.coverage.test.ts
index bedd647537..586e2a292e 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.coverage.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertHistoryModel.coverage.test.ts
@@ -35,9 +35,9 @@ function makeItem(overrides: Partial<HistoryItem> = {}): HistoryItem {
describe('getIncidentRowKey', () => {
it('joins id and startTime with ::', () => {
- expect(
- getIncidentRowKey(makeItem({ id: 'a1', startTime: '2026-03-22T09:00:00.000Z' })),
- ).toBe('a1::2026-03-22T09:00:00.000Z');
+ expect(getIncidentRowKey(makeItem({ id: 'a1', startTime: '2026-03-22T09:00:00.000Z' }))).toBe(
+ 'a1::2026-03-22T09:00:00.000Z',
+ );
});
it('produces distinct keys for same id with different startTime', () => {
@@ -53,10 +53,7 @@ describe('getIncidentRowKey', () => {
describe('buildAlertHistoryParams', () => {
it('falls back to limit 1000 with no startTime for an unrecognised range', () => {
- const result = buildAlertHistoryParams(
- 'bogus' as AlertHistoryRange,
- Date.UTC(2026, 2, 22),
- );
+ const result = buildAlertHistoryParams('bogus' as AlertHistoryRange, Date.UTC(2026, 2, 22));
expect(result).toEqual({ limit: 1000 });
expect(result.startTime).toBeUndefined();
});
@@ -351,11 +348,7 @@ describe('groupAlertHistoryItems', () => {
it('labels today and yesterday relative to the current date', () => {
const realNow = new Date();
- const todayMidnight = new Date(
- realNow.getFullYear(),
- realNow.getMonth(),
- realNow.getDate(),
- );
+ const todayMidnight = new Date(realNow.getFullYear(), realNow.getMonth(), realNow.getDate());
const yesterdayMidnight = new Date(todayMidnight);
yesterdayMidnight.setDate(yesterdayMidnight.getDate() - 1);
diff --git a/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.coverage.test.ts b/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.coverage.test.ts
index a6dcb7178b..25acbe3c2d 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.coverage.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.coverage.test.ts
@@ -81,10 +81,7 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'Main-node-a-local-lvm': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'Main-node-a-local-lvm': cpuThreshold(90, 80) }, [storage]),
).toEqual({ 'Main-node-a-local-lvm': cpuThreshold(90, 80) });
});
@@ -99,10 +96,7 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'Main-node-a-': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'Main-node-a-': cpuThreshold(90, 80) }, [storage]),
).toEqual({ 'Main-node-a-': cpuThreshold(90, 80) });
});
@@ -116,10 +110,7 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'Main-node-a-ceph-pool': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'Main-node-a-ceph-pool': cpuThreshold(90, 80) }, [storage]),
).toEqual({ 'Main-node-a-ceph-pool': cpuThreshold(90, 80) });
});
@@ -134,10 +125,7 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'DC1-node-a-nfs-share': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'DC1-node-a-nfs-share': cpuThreshold(90, 80) }, [storage]),
).toEqual({ 'canonical-1': cpuThreshold(90, 80) });
});
@@ -152,10 +140,7 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'pve1-node-a-ceph-pool': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'pve1-node-a-ceph-pool': cpuThreshold(90, 80) }, [storage]),
).toEqual({ 'canonical-1': cpuThreshold(90, 80) });
});
@@ -170,10 +155,9 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'Main-valid-node-ceph-pool': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'Main-valid-node-ceph-pool': cpuThreshold(90, 80) }, [
+ storage,
+ ]),
).toEqual({ 'canonical-1': cpuThreshold(90, 80) });
});
@@ -188,10 +172,7 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'Main-node-a-ceph-pool': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'Main-node-a-ceph-pool': cpuThreshold(90, 80) }, [storage]),
).toEqual({ 'Main-node-a-ceph-pool': cpuThreshold(90, 80) });
});
@@ -206,10 +187,7 @@ describe('alertOverridesModel coverage', () => {
});
expect(
- normalizeRawOverridesConfig(
- { 'solo-node-ceph-pool': cpuThreshold(90, 80) },
- [storage],
- ),
+ normalizeRawOverridesConfig({ 'solo-node-ceph-pool': cpuThreshold(90, 80) }, [storage]),
).toEqual({ 'canonical-1': cpuThreshold(90, 80) });
});
});
@@ -220,9 +198,9 @@ describe('alertOverridesModel coverage', () => {
});
it('passes through plain keys unchanged', () => {
- expect(
- normalizeRawOverridesConfig({ 'plain-key': cpuThreshold(90, 80) }),
- ).toEqual({ 'plain-key': cpuThreshold(90, 80) });
+ expect(normalizeRawOverridesConfig({ 'plain-key': cpuThreshold(90, 80) })).toEqual({
+ 'plain-key': cpuThreshold(90, 80),
+ });
});
it('normalizes disk labels that collapse to empty into unknown', () => {
diff --git a/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts b/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts
index 2074a8aa10..d5199355c1 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts
@@ -41,8 +41,7 @@ const projectOverrides = (
...overrides,
});
-const makePBS = (id: string, name: string): PBSInstance =>
- ({ id, name } as unknown as PBSInstance);
+const makePBS = (id: string, name: string): PBSInstance => ({ id, name }) as unknown as PBSInstance;
// ---------------------------------------------------------------------------
// hostOverrideIdCandidates
@@ -55,9 +54,7 @@ describe('hostOverrideIdCandidates', () => {
it('prepends resource.agent.agentId when present', () => {
expect(
- hostOverrideIdCandidates(
- makeResource({ id: 'agent-1', agent: { agentId: 'explicit-aid' } }),
- ),
+ hostOverrideIdCandidates(makeResource({ id: 'agent-1', agent: { agentId: 'explicit-aid' } })),
).toEqual(['explicit-aid', 'agent-1']);
});
@@ -892,9 +889,7 @@ describe('buildProjectedOverrides — storageCoords', () => {
storageResources: [datastore],
});
- expect(result).toEqual([
- expect.objectContaining({ node: 'pbs', instance: 'pbs' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ node: 'pbs', instance: 'pbs' })]);
});
it('uses pbsInstanceName as node when present', () => {
@@ -911,9 +906,7 @@ describe('buildProjectedOverrides — storageCoords', () => {
storageResources: [datastore],
});
- expect(result).toEqual([
- expect.objectContaining({ node: 'friendly-pbs', instance: 'inst-5' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ node: 'friendly-pbs', instance: 'inst-5' })]);
});
it('uses platformData.node and platformData.instance for non-datastore storage', () => {
@@ -930,9 +923,7 @@ describe('buildProjectedOverrides — storageCoords', () => {
storageResources: [storage],
});
- expect(result).toEqual([
- expect.objectContaining({ node: 'pve-1', instance: 'Main' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ node: 'pve-1', instance: 'Main' })]);
});
it('returns empty node when platformData.node is absent for non-datastore', () => {
@@ -950,9 +941,7 @@ describe('buildProjectedOverrides — storageCoords', () => {
storageResources: [storage],
});
- expect(result).toEqual([
- expect.objectContaining({ node: '', instance: 'Main' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ node: '', instance: 'Main' })]);
});
it('falls back to platformId for instance when platformData.instance is absent', () => {
@@ -969,9 +958,7 @@ describe('buildProjectedOverrides — storageCoords', () => {
storageResources: [storage],
});
- expect(result).toEqual([
- expect.objectContaining({ node: '', instance: 'fallback-pid' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ node: '', instance: 'fallback-pid' })]);
});
it('returns empty node and instance when no coords are available', () => {
@@ -987,9 +974,7 @@ describe('buildProjectedOverrides — storageCoords', () => {
storageResources: [storage],
});
- expect(result).toEqual([
- expect.objectContaining({ node: '', instance: '' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ node: '', instance: '' })]);
});
});
@@ -1261,9 +1246,7 @@ describe('buildProjectedOverrides — agent resource override', () => {
agentResourceList: [agent],
});
- expect(result).toEqual([
- expect.objectContaining({ instance: 'Ubuntu 22.04' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ instance: 'Ubuntu 22.04' })]);
});
it('falls back to platformData.platform for instance', () => {
@@ -1280,9 +1263,7 @@ describe('buildProjectedOverrides — agent resource override', () => {
agentResourceList: [agent],
});
- expect(result).toEqual([
- expect.objectContaining({ instance: 'debian' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ instance: 'debian' })]);
});
it('returns empty string for instance when no platform/os data exists', () => {
@@ -1298,9 +1279,7 @@ describe('buildProjectedOverrides — agent resource override', () => {
agentResourceList: [agent],
});
- expect(result).toEqual([
- expect.objectContaining({ instance: '' }),
- ]);
+ expect(result).toEqual([expect.objectContaining({ instance: '' })]);
});
});
diff --git a/frontend-modern/src/features/alerts/__tests__/alertsConfigurationModel.snapshot.test.ts b/frontend-modern/src/features/alerts/__tests__/alertsConfigurationModel.snapshot.test.ts
index 86ee60069c..69f87fd492 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertsConfigurationModel.snapshot.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertsConfigurationModel.snapshot.test.ts
@@ -14,7 +14,7 @@ import {
/** Build a minimal AlertConfig from extra fields, using `as unknown as` so
* we can omit required-but-irrelevant props and inject wrong-typed values. */
const cfg = (extra: Record<string, unknown>): AlertConfig =>
- ({ overrides: {}, ...extra } as unknown as AlertConfig);
+ ({ overrides: {}, ...extra }) as unknown as AlertConfig;
const localTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC';
@@ -260,9 +260,7 @@ describe('readAlertsConfigurationSnapshot — factory fallback (undefined-trigge
describe('readAlertsConfigurationSnapshot — present-but-empty section zeroes fields', () => {
it('zeroes guestDefaults when the section object is empty', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ guestDefaults: {} }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ guestDefaults: {} }));
// getTriggerValue(undefined) = 0; 0 ?? 80 = 0 (the ?? never fires)
expect(snapshot.guestDefaults.cpu).toBe(0);
expect(snapshot.guestDefaults.memory).toBe(0);
@@ -276,9 +274,7 @@ describe('readAlertsConfigurationSnapshot — present-but-empty section zeroes f
});
it('zeroes nodeDefaults when the section object is empty', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ nodeDefaults: {} }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ nodeDefaults: {} }));
expect(snapshot.nodeDefaults.cpu).toBe(0);
expect(snapshot.nodeDefaults.memory).toBe(0);
expect(snapshot.nodeDefaults.disk).toBe(0);
@@ -514,9 +510,7 @@ describe('readAlertsConfigurationSnapshot — diskTempByType', () => {
describe('readAlertsConfigurationSnapshot — diskFillByType', () => {
it('copies the map as-is when present', () => {
const fillMap = { ssd: { trigger: 90, clear: 85 }, hdd: { trigger: 95, clear: 90 } };
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ diskFillByType: fillMap }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ diskFillByType: fillMap }));
expect(snapshot.diskFillByType).toEqual(fillMap);
});
});
@@ -634,9 +628,7 @@ describe('readAlertsConfigurationSnapshot — storageDefault', () => {
});
it('extracts trigger when storageDefault is a number (legacy)', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ storageDefault: 78 }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ storageDefault: 78 }));
expect(snapshot.storageDefault).toBe(78);
});
});
@@ -692,9 +684,7 @@ describe('readAlertsConfigurationSnapshot — timeThresholds', () => {
});
it('falls back to DEFAULT_DELAY_SECONDS for missing fields', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ timeThresholds: { guest: 30 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ timeThresholds: { guest: 30 } }));
expect(snapshot.timeThresholds.guest).toBe(30);
expect(snapshot.timeThresholds.node).toBe(5);
expect(snapshot.timeThresholds['vmware-network']).toBe(5);
@@ -1024,9 +1014,7 @@ describe('readAlertsConfigurationSnapshot — schedule.quietHours', () => {
});
it('keeps default quietHours when schedule exists but quietHours is absent', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { cooldown: 10 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { cooldown: 10 } }));
expect(snapshot.scheduleQuietHours.enabled).toBe(false);
expect(snapshot.scheduleQuietHours.start).toBe('22:00');
});
@@ -1038,33 +1026,25 @@ describe('readAlertsConfigurationSnapshot — schedule.quietHours', () => {
describe('readAlertsConfigurationSnapshot — schedule.cooldown', () => {
it('disables cooldown and zeroes minutes when value is zero', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { cooldown: 0 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { cooldown: 0 } }));
expect(snapshot.scheduleCooldown.enabled).toBe(false);
expect(snapshot.scheduleCooldown.minutes).toBe(0);
});
it('enables and clamps cooldown minutes when value is positive', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { cooldown: 200 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { cooldown: 200 } }));
expect(snapshot.scheduleCooldown.enabled).toBe(true);
expect(snapshot.scheduleCooldown.minutes).toBe(120); // clamped to max
});
it('keeps default cooldown when cooldown is undefined', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { quietHours: undefined } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { quietHours: undefined } }));
expect(snapshot.scheduleCooldown.enabled).toBe(true);
expect(snapshot.scheduleCooldown.minutes).toBe(30);
});
it('uses fallbackMaxAlertsPerHour default when maxAlertsHour is undefined', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { cooldown: 15 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { cooldown: 15 } }));
expect(snapshot.scheduleCooldown.maxAlerts).toBe(3); // MAX_ALERTS_DEFAULT
});
});
@@ -1138,9 +1118,7 @@ describe('readAlertsConfigurationSnapshot — schedule.grouping', () => {
});
it('keeps default grouping when grouping is absent', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { cooldown: 10 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { cooldown: 10 } }));
expect(snapshot.scheduleGrouping.enabled).toBe(true);
expect(snapshot.scheduleGrouping.window).toBe(1); // GROUPING_WINDOW_DEFAULT_MINUTES
});
@@ -1152,16 +1130,12 @@ describe('readAlertsConfigurationSnapshot — schedule.grouping', () => {
describe('readAlertsConfigurationSnapshot — schedule.notifyOnResolve', () => {
it('sets to false when defined as false', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { notifyOnResolve: false } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { notifyOnResolve: false } }));
expect(snapshot.notifyOnResolve).toBe(false);
});
it('keeps default true when notifyOnResolve is undefined', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { cooldown: 10 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { cooldown: 10 } }));
expect(snapshot.notifyOnResolve).toBe(true);
});
});
@@ -1244,9 +1218,7 @@ describe('readAlertsConfigurationSnapshot — schedule.escalation', () => {
});
it('keeps default escalation when escalation is absent', () => {
- const snapshot = readAlertsConfigurationSnapshot(
- cfg({ schedule: { cooldown: 10 } }),
- );
+ const snapshot = readAlertsConfigurationSnapshot(cfg({ schedule: { cooldown: 10 } }));
expect(snapshot.scheduleEscalation.enabled).toBe(false);
expect(snapshot.scheduleEscalation.levels).toEqual([]);
});
diff --git a/frontend-modern/src/features/alerts/__tests__/guestOverrideIdentity.test.ts b/frontend-modern/src/features/alerts/__tests__/guestOverrideIdentity.test.ts
index 34d34df5c3..02906853e1 100644
--- a/frontend-modern/src/features/alerts/__tests__/guestOverrideIdentity.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/guestOverrideIdentity.test.ts
@@ -153,9 +153,12 @@ describe('guestOverrideIdentity', () => {
});
it('falls instance back to the resolved node when no instance source is available', () => {
- expect(
- getGuestOverrideIdentity({ node: 'pve', vmid: 100 }),
- ).toEqual({ id: undefined, instance: 'pve', node: 'pve', vmid: 100 });
+ expect(getGuestOverrideIdentity({ node: 'pve', vmid: 100 })).toEqual({
+ id: undefined,
+ instance: 'pve',
+ node: 'pve',
+ vmid: 100,
+ });
});
it('ignores non-object proxmox and platformData values', () => {
@@ -190,9 +193,9 @@ describe('guestOverrideIdentity', () => {
});
it('uses the stable guest:instance:vmid key for cluster guests (instance !== node)', () => {
- expect(
- guestOverrideStorageId({ instance: 'cluster-a', node: 'node-1', vmid: 100 }),
- ).toBe('guest:cluster-a:100');
+ expect(guestOverrideStorageId({ instance: 'cluster-a', node: 'node-1', vmid: 100 })).toBe(
+ 'guest:cluster-a:100',
+ );
});
it('uses the canonical instance:node:vmid key for standalone guests (instance === node)', () => {
@@ -256,10 +259,9 @@ describe('guestOverrideIdentity', () => {
'cluster-a-100',
'cluster-a-node-1-100',
]);
- expect(guestOverrideIdCandidates({ id: ' ', instance: 'pve', node: 'pve', vmid: 100 })).toEqual([
- 'pve:pve:100',
- 'pve-100',
- ]);
+ expect(
+ guestOverrideIdCandidates({ id: ' ', instance: 'pve', node: 'pve', vmid: 100 }),
+ ).toEqual(['pve:pve:100', 'pve-100']);
});
});
diff --git a/frontend-modern/src/features/alerts/__tests__/helpers.branchcov2.test.ts b/frontend-modern/src/features/alerts/__tests__/helpers.branchcov2.test.ts
index b0ae348baf..04cadfdda2 100644
--- a/frontend-modern/src/features/alerts/__tests__/helpers.branchcov2.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/helpers.branchcov2.test.ts
@@ -60,7 +60,11 @@ describe('alerts helpers — branch coverage (batch 2)', () => {
});
it('falls back to the raw type string when no canonical label resolves', () => {
- expect(unifiedTypeToAlertDisplayType('' as unknown as Parameters<typeof unifiedTypeToAlertDisplayType>[0])).toBe('');
+ expect(
+ unifiedTypeToAlertDisplayType(
+ '' as unknown as Parameters<typeof unifiedTypeToAlertDisplayType>[0],
+ ),
+ ).toBe('');
});
});
@@ -70,17 +74,21 @@ describe('alerts helpers — branch coverage (batch 2)', () => {
});
it('falls back to UTC when the resolved timezone is empty', () => {
- const spy = vi.spyOn(Intl, 'DateTimeFormat').mockImplementation(
- (() => ({ resolvedOptions: () => ({ timeZone: '' }) })) as unknown as typeof Intl.DateTimeFormat,
- );
+ const spy = vi
+ .spyOn(Intl, 'DateTimeFormat')
+ .mockImplementation((() => ({
+ resolvedOptions: () => ({ timeZone: '' }),
+ })) as unknown as typeof Intl.DateTimeFormat);
expect(getLocalTimezone()).toBe('UTC');
spy.mockRestore();
});
it('returns the resolved IANA timezone when one is available', () => {
- const spy = vi.spyOn(Intl, 'DateTimeFormat').mockImplementation(
- (() => ({ resolvedOptions: () => ({ timeZone: 'Australia/Sydney' }) })) as unknown as typeof Intl.DateTimeFormat,
- );
+ const spy = vi
+ .spyOn(Intl, 'DateTimeFormat')
+ .mockImplementation((() => ({
+ resolvedOptions: () => ({ timeZone: 'Australia/Sydney' }),
+ })) as unknown as typeof Intl.DateTimeFormat);
expect(getLocalTimezone()).toBe('Australia/Sydney');
spy.mockRestore();
});
@@ -97,7 +105,7 @@ describe('alerts helpers — branch coverage (batch 2)', () => {
});
it('trims and lowercases type and metric keys and rounds fractional values', () => {
- const input = { ' VM ': { ' CPU ': 3.6, 'Memory': 7 } };
+ const input = { ' VM ': { ' CPU ': 3.6, Memory: 7 } };
expect(normalizeMetricDelayMap(input)).toEqual({ vm: { cpu: 4, memory: 7 } });
});
@@ -107,7 +115,9 @@ describe('alerts helpers — branch coverage (batch 2)', () => {
it('skips entries whose metrics value is null', () => {
expect(
- normalizeMetricDelayMap({ vm: null } as unknown as Parameters<typeof normalizeMetricDelayMap>[0]),
+ normalizeMetricDelayMap({ vm: null } as unknown as Parameters<
+ typeof normalizeMetricDelayMap
+ >[0]),
).toEqual({});
});
diff --git a/frontend-modern/src/features/alerts/__tests__/helpers.coverage.test.ts b/frontend-modern/src/features/alerts/__tests__/helpers.coverage.test.ts
index 291fc1ad7a..5ec16a61b6 100644
--- a/frontend-modern/src/features/alerts/__tests__/helpers.coverage.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/helpers.coverage.test.ts
@@ -108,17 +108,11 @@ describe('alerts helpers — coercion coverage', () => {
describe('parseAppriseTargets', () => {
it('splits newline-separated targets', () => {
- expect(parseAppriseTargets('mailto:a@x\nmailto:b@x')).toEqual([
- 'mailto:a@x',
- 'mailto:b@x',
- ]);
+ expect(parseAppriseTargets('mailto:a@x\nmailto:b@x')).toEqual(['mailto:a@x', 'mailto:b@x']);
});
it('splits comma-separated targets', () => {
- expect(parseAppriseTargets('mailto:a@x,mailto:b@x')).toEqual([
- 'mailto:a@x',
- 'mailto:b@x',
- ]);
+ expect(parseAppriseTargets('mailto:a@x,mailto:b@x')).toEqual(['mailto:a@x', 'mailto:b@x']);
});
it('splits a mix of newlines and commas', () => {
@@ -130,10 +124,7 @@ describe('alerts helpers — coercion coverage', () => {
});
it('normalizes CRLF line endings', () => {
- expect(parseAppriseTargets('mailto:a@x\r\nmailto:b@x')).toEqual([
- 'mailto:a@x',
- 'mailto:b@x',
- ]);
+ expect(parseAppriseTargets('mailto:a@x\r\nmailto:b@x')).toEqual(['mailto:a@x', 'mailto:b@x']);
});
it('trims whitespace around each target', () => {
@@ -164,9 +155,7 @@ describe('alerts helpers — coercion coverage', () => {
describe('formatAppriseTargets', () => {
it('joins targets with newlines', () => {
- expect(formatAppriseTargets(['mailto:a@x', 'mailto:b@x'])).toBe(
- 'mailto:a@x\nmailto:b@x',
- );
+ expect(formatAppriseTargets(['mailto:a@x', 'mailto:b@x'])).toBe('mailto:a@x\nmailto:b@x');
});
it('returns a single target without a trailing newline', () => {
@@ -195,9 +184,7 @@ describe('alerts helpers — coercion coverage', () => {
it('format(parse(text)) normalizes messy input to newline form', () => {
const messy = ' mailto:a@x , mailto:b@x\n\r\nmailto:a@x\n ';
- expect(formatAppriseTargets(parseAppriseTargets(messy))).toBe(
- 'mailto:a@x\nmailto:b@x',
- );
+ expect(formatAppriseTargets(parseAppriseTargets(messy))).toBe('mailto:a@x\nmailto:b@x');
});
it('an empty list round-trips through the empty string', () => {
@@ -246,7 +233,9 @@ describe('alerts helpers — coercion coverage', () => {
});
it('returns undefined when platformData is null', () => {
- expect(platformData(makeResource({ platformData: null as unknown as undefined }))).toBeUndefined();
+ expect(
+ platformData(makeResource({ platformData: null as unknown as undefined })),
+ ).toBeUndefined();
});
it('returns the unwrapped payload when present', () => {
diff --git a/frontend-modern/src/features/alerts/__tests__/useAlertHistoryState.test.tsx b/frontend-modern/src/features/alerts/__tests__/useAlertHistoryState.test.tsx
index 5ea8dddbd0..9402c28db8 100644
--- a/frontend-modern/src/features/alerts/__tests__/useAlertHistoryState.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/useAlertHistoryState.test.tsx
@@ -79,7 +79,10 @@ describe('useAlertHistoryState', () => {
vi.mocked(eventBus.on).mockClear();
navigateSpy.mockClear();
setMockLocation('');
- vi.stubGlobal('confirm', vi.fn(() => true));
+ vi.stubGlobal(
+ 'confirm',
+ vi.fn(() => true),
+ );
localStorage.clear();
});
diff --git a/frontend-modern/src/features/alerts/__tests__/useAlertIncidentTimelineState.test.tsx b/frontend-modern/src/features/alerts/__tests__/useAlertIncidentTimelineState.test.tsx
index 8bcf1fd854..1156878cb9 100644
--- a/frontend-modern/src/features/alerts/__tests__/useAlertIncidentTimelineState.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/useAlertIncidentTimelineState.test.tsx
@@ -49,10 +49,7 @@ describe('useAlertIncidentTimelineState', () => {
await result.toggleIncidentTimeline('row-1', 'alert-1', '2026-03-01T00:00:00Z');
expect(result.expandedIncidents().has('row-1')).toBe(true);
- expect(AlertsAPI.getIncidentTimeline).toHaveBeenCalledWith(
- 'alert-1',
- '2026-03-01T00:00:00Z',
- );
+ expect(AlertsAPI.getIncidentTimeline).toHaveBeenCalledWith('alert-1', '2026-03-01T00:00:00Z');
expect(result.incidentTimelines()['row-1']).toMatchObject({ id: 'incident-1' });
result.setIncidentNoteDraft('row-1', 'operator note');
diff --git a/frontend-modern/src/features/alerts/alertDestinationsModel.ts b/frontend-modern/src/features/alerts/alertDestinationsModel.ts
index 7d8d165396..8c9c748043 100644
--- a/frontend-modern/src/features/alerts/alertDestinationsModel.ts
+++ b/frontend-modern/src/features/alerts/alertDestinationsModel.ts
@@ -1,10 +1,6 @@
import type { AppriseConfig, EmailConfig } from '@/api/notifications';
-import {
- formatAppriseTargets,
- normalizeEmailConfigFromAPI,
- parseAppriseTargets,
-} from './helpers';
+import { formatAppriseTargets, normalizeEmailConfigFromAPI, parseAppriseTargets } from './helpers';
import type { UIAppriseConfig, UIEmailConfig } from './types';
export function normalizeAppriseConfig(
@@ -57,6 +53,4 @@ export function buildAppriseConfigPayload(config: UIAppriseConfig): AppriseConfi
} as AppriseConfig;
}
-export {
- normalizeEmailConfigFromAPI,
-};
+export { normalizeEmailConfigFromAPI };
diff --git a/frontend-modern/src/features/alerts/alertHistoryModel.ts b/frontend-modern/src/features/alerts/alertHistoryModel.ts
index 193b1d9707..7d6f71e5fb 100644
--- a/frontend-modern/src/features/alerts/alertHistoryModel.ts
+++ b/frontend-modern/src/features/alerts/alertHistoryModel.ts
@@ -68,11 +68,7 @@ export function buildAlertHistoryParams(range: AlertHistoryRange, now = Date.now
return params;
}
-export function formatAlertHistoryDuration(
- startTime: string,
- endTime?: string,
- now = Date.now(),
-) {
+export function formatAlertHistoryDuration(startTime: string, endTime?: string, now = Date.now()) {
const start = new Date(startTime).getTime();
const end = endTime ? new Date(endTime).getTime() : now;
const duration = end - start;
@@ -413,7 +409,11 @@ export function getAlertHistoryDaySuffix(day: number) {
}
}
-export function formatAlertHistoryGroupLabel(date: Date, todayStart: number, yesterdayStart: number) {
+export function formatAlertHistoryGroupLabel(
+ date: Date,
+ todayStart: number,
+ yesterdayStart: number,
+) {
const month = MONTH_NAMES[date.getMonth()];
const day = date.getDate();
const suffix = getAlertHistoryDaySuffix(day);
diff --git a/frontend-modern/src/features/alerts/alertOverridesModel.ts b/frontend-modern/src/features/alerts/alertOverridesModel.ts
index 8fcd9adcf0..75f2b4aa84 100644
--- a/frontend-modern/src/features/alerts/alertOverridesModel.ts
+++ b/frontend-modern/src/features/alerts/alertOverridesModel.ts
@@ -76,7 +76,10 @@ const buildSharedStorageLegacyKeyMap = (storageResources: Resource[]): Map<strin
// last slash to a dash reconstructs the legacy key exactly; carrying it as a
// trailing candidate keeps pre-existing overrides bound to the single card
// and lets the next save re-home them onto the canonical key (#1591).
-const legacyPBSDatastoreOverrideId = (resource: Resource, canonicalId?: string): string | undefined => {
+const legacyPBSDatastoreOverrideId = (
+ resource: Resource,
+ canonicalId?: string,
+): string | undefined => {
if (resource.storage?.platform !== 'pbs' || !canonicalId) return undefined;
const slash = canonicalId.lastIndexOf('/');
if (slash <= 0) return undefined;
@@ -88,11 +91,7 @@ export const storageOverrideIdCandidates = (resource: Resource): string[] => {
resource.metricsTarget?.resourceType === 'storage'
? resource.metricsTarget.resourceId
: undefined;
- return uniqueIds(
- canonicalId,
- resource.id,
- legacyPBSDatastoreOverrideId(resource, canonicalId),
- );
+ return uniqueIds(canonicalId, resource.id, legacyPBSDatastoreOverrideId(resource, canonicalId));
};
export const storageOverrideActionId = (resource: Resource): string =>
diff --git a/frontend-modern/src/features/alerts/identity.test.ts b/frontend-modern/src/features/alerts/identity.test.ts
index 8eaaa41ed5..3a5c05fe2f 100644
--- a/frontend-modern/src/features/alerts/identity.test.ts
+++ b/frontend-modern/src/features/alerts/identity.test.ts
@@ -1,10 +1,6 @@
import { describe, expect, it } from 'vitest';
-import {
- getAlertIdentifiers,
- getCanonicalAlertId,
- matchesAlertIdentifier,
-} from './identity';
+import { getAlertIdentifiers, getCanonicalAlertId, matchesAlertIdentifier } from './identity';
describe('alert identity helpers', () => {
it('treats id as the canonical alert identifier', () => {
diff --git a/frontend-modern/src/features/alerts/tabs/HistoryTab.tsx b/frontend-modern/src/features/alerts/tabs/HistoryTab.tsx
index 42cc328661..6cade14407 100644
--- a/frontend-modern/src/features/alerts/tabs/HistoryTab.tsx
+++ b/frontend-modern/src/features/alerts/tabs/HistoryTab.tsx
@@ -71,9 +71,7 @@ export function HistoryTab(props: HistoryTabProps) {
<AlertHistoryFrequencyCard state={historyState} />
<AlertHistoryFiltersCard state={historyState} isMobile={isMobile()} />
<AlertResourceIncidentsPanel state={historyState} getResource={props.getResource} />
- <AlertHistoryTableSection
- state={historyState}
- />
+ <AlertHistoryTableSection state={historyState} />
<AlertHistoryAdministrationCard state={historyState} />
</div>
);
diff --git a/frontend-modern/src/features/alerts/tabs/ScheduleTab.tsx b/frontend-modern/src/features/alerts/tabs/ScheduleTab.tsx
index e5cc0f1fc0..1b2b135a90 100644
--- a/frontend-modern/src/features/alerts/tabs/ScheduleTab.tsx
+++ b/frontend-modern/src/features/alerts/tabs/ScheduleTab.tsx
@@ -38,9 +38,7 @@ export function ScheduleTab(props: ScheduleTabProps) {
<div class="space-y-6">
<div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div>
- <h3 class="text-base font-semibold text-base-content">
- {ALERT_CONFIG_SCHEDULING_TITLE}
- </h3>
+ <h3 class="text-base font-semibold text-base-content">{ALERT_CONFIG_SCHEDULING_TITLE}</h3>
<p class="mt-1 text-sm text-muted">{ALERT_CONFIG_SCHEDULING_DESCRIPTION}</p>
</div>
<button
diff --git a/frontend-modern/src/features/alerts/thresholds/__tests__/guestThresholdOverrideMutationModel.test.ts b/frontend-modern/src/features/alerts/thresholds/__tests__/guestThresholdOverrideMutationModel.test.ts
index 3e126fcace..780ec68961 100644
--- a/frontend-modern/src/features/alerts/thresholds/__tests__/guestThresholdOverrideMutationModel.test.ts
+++ b/frontend-modern/src/features/alerts/thresholds/__tests__/guestThresholdOverrideMutationModel.test.ts
@@ -32,9 +32,10 @@ describe('guestThresholdOverrideMutationModel', () => {
});
it('uses the exact id for non-guest resources', () => {
- expect(
- getOverridePersistenceIdentity({ id: 'agent-1', type: 'agent' }),
- ).toEqual({ candidateIds: ['agent-1'], storageId: 'agent-1' });
+ expect(getOverridePersistenceIdentity({ id: 'agent-1', type: 'agent' })).toEqual({
+ candidateIds: ['agent-1'],
+ storageId: 'agent-1',
+ });
});
it('returns empty candidates for a non-guest resource with a blank id', () => {
@@ -146,9 +147,7 @@ describe('guestThresholdOverrideMutationModel', () => {
});
it('returns undefined when candidateIds is empty and overrides is non-empty', () => {
- expect(
- findOverrideForResource(overrides, { id: '', type: 'agent' }),
- ).toBeUndefined();
+ expect(findOverrideForResource(overrides, { id: '', type: 'agent' })).toBeUndefined();
});
});
@@ -164,9 +163,9 @@ describe('guestThresholdOverrideMutationModel', () => {
});
it('matches by exact id for non-guest resources', () => {
- expect(
- findRawOverrideConfigForResource(rawConfig, { id: 'agent-1', type: 'agent' }),
- ).toEqual({ cpu: { trigger: 50, clear: 45 } });
+ expect(findRawOverrideConfigForResource(rawConfig, { id: 'agent-1', type: 'agent' })).toEqual(
+ { cpu: { trigger: 50, clear: 45 } },
+ );
});
it('returns the first truthy raw config across guest candidate ids in priority order', () => {
diff --git a/frontend-modern/src/features/alerts/thresholds/__tests__/thresholdsOverrideMutationModel.test.ts b/frontend-modern/src/features/alerts/thresholds/__tests__/thresholdsOverrideMutationModel.test.ts
index e7736e69a6..bcec0397fe 100644
--- a/frontend-modern/src/features/alerts/thresholds/__tests__/thresholdsOverrideMutationModel.test.ts
+++ b/frontend-modern/src/features/alerts/thresholds/__tests__/thresholdsOverrideMutationModel.test.ts
@@ -57,12 +57,7 @@ describe('thresholdsOverrideMutationModel', () => {
});
it('preserves the order of unrelated overrides when replacing', () => {
- const existing = [
- makeOverride('a'),
- makeOverride('b'),
- makeOverride('c'),
- makeOverride('d'),
- ];
+ const existing = [makeOverride('a'), makeOverride('b'), makeOverride('c'), makeOverride('d')];
const next = upsertOverride(existing, makeOverride('c', { cpu: 90 }));
expect(next.map((o) => o.id)).toEqual(['a', 'b', 'c', 'd']);
expect(next[2].thresholds).toEqual({ cpu: 90 });
diff --git a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsDockerData.ts b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsDockerData.ts
index 72df986db9..6ac8de0669 100644
--- a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsDockerData.ts
+++ b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsDockerData.ts
@@ -47,7 +47,8 @@ export function useThresholdsDockerData(inputs: ThresholdsDataInputs) {
type: 'dockerHost' as const,
resourceType: 'Container Runtime',
node: getPreferredResourceHostname(host),
- instance: (platformData(host)?.platform as string) || (platformData(host)?.osName as string) || '',
+ instance:
+ (platformData(host)?.platform as string) || (platformData(host)?.osName as string) || '',
status: host.status,
hasOverride: disableConnectivity,
disableConnectivity,
diff --git a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsHostData.ts b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsHostData.ts
index 86429fa25d..b4e06a8a1c 100644
--- a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsHostData.ts
+++ b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsHostData.ts
@@ -123,7 +123,9 @@ export function useThresholdsHostData(inputs: ThresholdsDataInputs) {
'',
status: agentResource.status,
hasOverride:
- hasCustomThresholds || Boolean(override?.disabled) || Boolean(override?.disableConnectivity),
+ hasCustomThresholds ||
+ Boolean(override?.disabled) ||
+ Boolean(override?.disableConnectivity),
disabled: override?.disabled || false,
disableConnectivity: override?.disableConnectivity || false,
thresholds: override?.thresholds || {},
@@ -173,7 +175,9 @@ export function useThresholdsHostData(inputs: ThresholdsDataInputs) {
const data = platformData(agentResource);
const platformAgent = readRecord(data?.agent);
const disksFromPlatformRoot = Array.isArray(data?.disks) ? data.disks : null;
- const disksFromPlatformAgent = Array.isArray(platformAgent?.disks) ? platformAgent.disks : null;
+ const disksFromPlatformAgent = Array.isArray(platformAgent?.disks)
+ ? platformAgent.disks
+ : null;
const disksFromResourceAgent = Array.isArray(agentResource.agent?.disks)
? agentResource.agent.disks
: null;
@@ -247,7 +251,8 @@ export function useThresholdsHostData(inputs: ThresholdsDataInputs) {
return search
? disks.filter(
- (disk) => disk.name.toLowerCase().includes(search) || disk.node?.toLowerCase().includes(search),
+ (disk) =>
+ disk.name.toLowerCase().includes(search) || disk.node?.toLowerCase().includes(search),
)
: disks;
}, []);
diff --git a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsInfrastructureData.ts b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsInfrastructureData.ts
index eabfb61fb5..7b820dd93f 100644
--- a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsInfrastructureData.ts
+++ b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsInfrastructureData.ts
@@ -61,7 +61,8 @@ export function useThresholdsInfrastructureData(inputs: ThresholdsDataInputs) {
return search
? pbsServers.filter(
- (pbs) => pbs.name.toLowerCase().includes(search) || pbs.host?.toLowerCase().includes(search),
+ (pbs) =>
+ pbs.name.toLowerCase().includes(search) || pbs.host?.toLowerCase().includes(search),
)
: pbsServers;
}, []);
@@ -121,7 +122,8 @@ export function useThresholdsInfrastructureData(inputs: ThresholdsDataInputs) {
return search
? pmgServers.filter(
- (pmg) => pmg.name.toLowerCase().includes(search) || pmg.host?.toLowerCase().includes(search),
+ (pmg) =>
+ pmg.name.toLowerCase().includes(search) || pmg.host?.toLowerCase().includes(search),
)
: pmgServers;
}, []);
@@ -163,7 +165,8 @@ export function useThresholdsInfrastructureData(inputs: ThresholdsDataInputs) {
return search
? storageDevices.filter(
(storage) =>
- storage.name.toLowerCase().includes(search) || storage.node?.toLowerCase().includes(search),
+ storage.name.toLowerCase().includes(search) ||
+ storage.node?.toLowerCase().includes(search),
)
: storageDevices;
}, []);
diff --git a/frontend-modern/src/features/alerts/thresholds/tableTypes.ts b/frontend-modern/src/features/alerts/thresholds/tableTypes.ts
index b4f966893e..09e7032053 100644
--- a/frontend-modern/src/features/alerts/thresholds/tableTypes.ts
+++ b/frontend-modern/src/features/alerts/thresholds/tableTypes.ts
@@ -3,12 +3,7 @@ import type { BackupAlertConfig, SnapshotAlertConfig } from '@/types/alerts';
import type { AlertResourceThresholdMap } from '@/components/Alerts/alertResourceTableModel';
export type ThresholdsActiveTab =
- | 'proxmox'
- | 'docker'
- | 'kubernetes'
- | 'truenas'
- | 'vmware'
- | 'systems';
+ 'proxmox' | 'docker' | 'kubernetes' | 'truenas' | 'vmware' | 'systems';
export interface Resource {
id: string;
diff --git a/frontend-modern/src/features/alerts/thresholds/thresholdsOverrideMutationModel.ts b/frontend-modern/src/features/alerts/thresholds/thresholdsOverrideMutationModel.ts
index 3bfd9fd8e2..4c5be55e06 100644
--- a/frontend-modern/src/features/alerts/thresholds/thresholdsOverrideMutationModel.ts
+++ b/frontend-modern/src/features/alerts/thresholds/thresholdsOverrideMutationModel.ts
@@ -31,9 +31,7 @@ export const withThresholdEntries = (
return next;
};
-export const stripStateKeys = (
- thresholds: Record<string, number>,
-): Record<string, number> => {
+export const stripStateKeys = (thresholds: Record<string, number>): Record<string, number> => {
const next = { ...thresholds };
delete (next as Record<string, unknown>).disabled;
delete (next as Record<string, unknown>).disableConnectivity;
diff --git a/frontend-modern/src/features/alerts/thresholds/thresholdsResourceModel.ts b/frontend-modern/src/features/alerts/thresholds/thresholdsResourceModel.ts
index 762d1f4cae..2589662a09 100644
--- a/frontend-modern/src/features/alerts/thresholds/thresholdsResourceModel.ts
+++ b/frontend-modern/src/features/alerts/thresholds/thresholdsResourceModel.ts
@@ -47,13 +47,13 @@ export const hasThresholdDiff = (
) =>
Boolean(
override?.thresholds &&
- Object.keys(override.thresholds).some((key) => {
- const thresholdKey = key as keyof Override['thresholds'];
- return (
- override.thresholds[thresholdKey] !== undefined &&
- override.thresholds[thresholdKey] !== defaults[key]
- );
- }),
+ Object.keys(override.thresholds).some((key) => {
+ const thresholdKey = key as keyof Override['thresholds'];
+ return (
+ override.thresholds[thresholdKey] !== undefined &&
+ override.thresholds[thresholdKey] !== defaults[key]
+ );
+ }),
);
export function hostOverrideIdCandidates(resource: Resource): string[] {
@@ -89,9 +89,7 @@ export const dockerHostOverrideIdCandidates = (resource: Resource): string[] =>
};
export const dockerContainerOverrideIdCandidates = (host: Resource, shortId: string): string[] =>
- uniqueIds(
- ...dockerHostOverrideIdCandidates(host).map((hostId) => `docker:${hostId}/${shortId}`),
- );
+ uniqueIds(...dockerHostOverrideIdCandidates(host).map((hostId) => `docker:${hostId}/${shortId}`));
export const findOverrideByCandidates = (
overridesMap: Map<string, Override>,
@@ -126,7 +124,9 @@ export const getFriendlyNodeName = (value: string, clusterName?: string): string
}
if (!result) return '';
const firstWord = result.split(/\s+/)[0] || result;
- const withoutDomain = firstWord.includes('.') ? (firstWord.split('.')[0] ?? firstWord) : firstWord;
+ const withoutDomain = firstWord.includes('.')
+ ? (firstWord.split('.')[0] ?? firstWord)
+ : firstWord;
return withoutDomain.trim();
};
@@ -146,16 +146,13 @@ export const getFriendlyNodeName = (value: string, clusterName?: string): string
return base;
};
-export const getFriendlyAlertNodeName = (
- value: string,
- clusterName?: string,
-): string => getFriendlyNodeName(value, clusterName);
+export const getFriendlyAlertNodeName = (value: string, clusterName?: string): string =>
+ getFriendlyNodeName(value, clusterName);
export function buildNodeHeaderMeta(node: Resource) {
const data = platformData(node);
const clusterName = (data?.clusterName as string | undefined) ?? undefined;
- const isClusterMember =
- (data?.isClusterMember as boolean | undefined) ?? Boolean(node.clusterId);
+ const isClusterMember = (data?.isClusterMember as boolean | undefined) ?? Boolean(node.clusterId);
const originalDisplayName = getAlertResourceDisplayLabel(node);
const friendlyName = getFriendlyAlertNodeName(originalDisplayName, clusterName);
@@ -215,7 +212,11 @@ export function buildAgentHeaderMeta(agent: Resource) {
return { headerMeta, keys };
}
-export const agentDiskResourceId = (agentId: string, mountpoint: string, device?: string): string => {
+export const agentDiskResourceId = (
+ agentId: string,
+ mountpoint: string,
+ device?: string,
+): string => {
let label = (mountpoint?.trim() || device?.trim() || 'disk').toLowerCase();
label = label
.replace(/[^a-z0-9]/g, '-')
@@ -229,7 +230,10 @@ export const storageCoords = (resource: Resource): { node: string; instance: str
const data = platformData(resource);
if (resource.type === 'datastore') {
const instance =
- (data?.pbsInstanceId as string | undefined) || resource.parentId || resource.platformId || 'pbs';
+ (data?.pbsInstanceId as string | undefined) ||
+ resource.parentId ||
+ resource.platformId ||
+ 'pbs';
const node = (data?.pbsInstanceName as string | undefined) || instance;
return { node, instance };
}
diff --git a/frontend-modern/src/features/alerts/useAlertDestinationsState.ts b/frontend-modern/src/features/alerts/useAlertDestinationsState.ts
index f11dc23186..f2e847f2b0 100644
--- a/frontend-modern/src/features/alerts/useAlertDestinationsState.ts
+++ b/frontend-modern/src/features/alerts/useAlertDestinationsState.ts
@@ -11,10 +11,7 @@ import {
normalizeAppriseConfig,
normalizeEmailConfigFromAPI,
} from './alertDestinationsModel';
-import {
- createDefaultAppriseConfig,
- createDefaultEmailConfig,
-} from './helpers';
+import { createDefaultAppriseConfig, createDefaultEmailConfig } from './helpers';
import type { AlertTab, UIAppriseConfig, UIEmailConfig } from './types';
interface AlertDestinationsStateOptions {
diff --git a/frontend-modern/src/features/alerts/useAlertHistoryState.ts b/frontend-modern/src/features/alerts/useAlertHistoryState.ts
index 892cda1fef..6fef13e592 100644
--- a/frontend-modern/src/features/alerts/useAlertHistoryState.ts
+++ b/frontend-modern/src/features/alerts/useAlertHistoryState.ts
@@ -57,12 +57,9 @@ export function useAlertHistoryState(props: UseAlertHistoryStateProps) {
parsePeriod(new URLSearchParams(location.search).get('period'));
const severityFilter: Accessor<AlertSeverityFilter> = () =>
parseSeverity(new URLSearchParams(location.search).get('severity'));
- const searchTerm: Accessor<string> = () =>
- new URLSearchParams(location.search).get('q') ?? '';
+ const searchTerm: Accessor<string> = () => new URLSearchParams(location.search).get('q') ?? '';
- const updateSearchParam = (
- mutate: (params: URLSearchParams) => void,
- ): void => {
+ const updateSearchParam = (mutate: (params: URLSearchParams) => void): void => {
const params = new URLSearchParams(location.search);
mutate(params);
const query = params.toString();
@@ -258,7 +255,9 @@ export function useAlertHistoryState(props: UseAlertHistoryStateProps) {
return groupAlertHistoryItems(alertData());
});
- const bucketDurationLabel = createMemo(() => getAlertBucketDurationLabel(alertTrends().bucketSize));
+ const bucketDurationLabel = createMemo(() =>
+ getAlertBucketDurationLabel(alertTrends().bucketSize),
+ );
const rangeSummary = createMemo(() => {
return buildAlertRangeSummary(alertTrends(), userLocale);
diff --git a/frontend-modern/src/features/alerts/useAlertIncidentTimelineState.ts b/frontend-modern/src/features/alerts/useAlertIncidentTimelineState.ts
index df8198a258..22249054f0 100644
--- a/frontend-modern/src/features/alerts/useAlertIncidentTimelineState.ts
+++ b/frontend-modern/src/features/alerts/useAlertIncidentTimelineState.ts
@@ -50,7 +50,11 @@ export function useAlertIncidentTimelineState() {
}
};
- const toggleIncidentTimeline = async (key: string, alertIdentifier: string, startedAt?: string) => {
+ const toggleIncidentTimeline = async (
+ key: string,
+ alertIdentifier: string,
+ startedAt?: string,
+ ) => {
const next = new Set(expandedIncidents());
if (next.has(key)) {
next.delete(key);
diff --git a/frontend-modern/src/features/alerts/useAlertScheduleState.ts b/frontend-modern/src/features/alerts/useAlertScheduleState.ts
index 28297c3fa1..e6f5e0f488 100644
--- a/frontend-modern/src/features/alerts/useAlertScheduleState.ts
+++ b/frontend-modern/src/features/alerts/useAlertScheduleState.ts
@@ -320,9 +320,9 @@ export function useAlertScheduleState(props: UseAlertScheduleStateProps) {
};
const removeEscalationLevel = (index: number) => {
- const nextLevels = props.escalation().levels.filter(
- (_level: EscalationLevel, currentIndex: number) => currentIndex !== index,
- );
+ const nextLevels = props
+ .escalation()
+ .levels.filter((_level: EscalationLevel, currentIndex: number) => currentIndex !== index);
props.setEscalation({
...props.escalation(),
levels: nextLevels,
diff --git a/frontend-modern/src/features/alerts/useAlertsConfigurationState.ts b/frontend-modern/src/features/alerts/useAlertsConfigurationState.ts
index f94ab11d6d..b8a9cb79fc 100644
--- a/frontend-modern/src/features/alerts/useAlertsConfigurationState.ts
+++ b/frontend-modern/src/features/alerts/useAlertsConfigurationState.ts
@@ -67,11 +67,15 @@ export function useAlertsConfigurationState(props: AlertsConfigurationSurfacePro
setSuppressDirtyFlag(true);
props.setHasUnsavedChanges(false);
destinationsState.resetDestinations();
- configurationSnapshotState.applyConfigurationSnapshot(createDefaultAlertsConfigurationSnapshot());
+ configurationSnapshotState.applyConfigurationSnapshot(
+ createDefaultAlertsConfigurationSnapshot(),
+ );
try {
const config = await AlertsAPI.getConfig();
- configurationSnapshotState.applyConfigurationSnapshot(readAlertsConfigurationSnapshot(config));
+ configurationSnapshotState.applyConfigurationSnapshot(
+ readAlertsConfigurationSnapshot(config),
+ );
overridesState.replaceRawOverridesConfig(config.overrides || {});
diff --git a/frontend-modern/src/features/docker/DockerAlertsTable.tsx b/frontend-modern/src/features/docker/DockerAlertsTable.tsx
index 511464c292..40de3aeb75 100644
--- a/frontend-modern/src/features/docker/DockerAlertsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerAlertsTable.tsx
@@ -256,7 +256,8 @@ export const DockerAlertsTable: Component<{
{docker()?.hostname || docker()?.swarm?.clusterName || '-'}
</span>
<span class="block truncate text-[10px] text-muted">
- {docker()?.runtime || formatPlatformAlertCode(incident.code, 'docker')}
+ {docker()?.runtime ||
+ formatPlatformAlertCode(incident.code, 'docker')}
</span>
</TableCell>
<TableCell
diff --git a/frontend-modern/src/features/docker/DockerConfigsTable.tsx b/frontend-modern/src/features/docker/DockerConfigsTable.tsx
index de0a7c96c5..41c4bcff26 100644
--- a/frontend-modern/src/features/docker/DockerConfigsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerConfigsTable.tsx
@@ -60,7 +60,9 @@ export const DockerConfigsTable: Component<DockerNativeTableProps> = (props) =>
sortKeys: DOCKER_CONFIG_SORT_KEYS,
descendingFirst: ['created'],
});
- const sortedRows = createMemo(() => sort.sortRows(tableState.filtered(), getDockerConfigSortValue));
+ const sortedRows = createMemo(() =>
+ sort.sortRows(tableState.filtered(), getDockerConfigSortValue),
+ );
return (
<Show
diff --git a/frontend-modern/src/features/docker/DockerContainerLifecycleControls.tsx b/frontend-modern/src/features/docker/DockerContainerLifecycleControls.tsx
index 7ba1478ff2..9511a20d47 100644
--- a/frontend-modern/src/features/docker/DockerContainerLifecycleControls.tsx
+++ b/frontend-modern/src/features/docker/DockerContainerLifecycleControls.tsx
@@ -44,9 +44,12 @@ const newRequestId = (): string =>
const iconForAction = (action: DockerContainerLifecycleAction): Component<{ class?: string }> => {
switch (action) {
- case 'start': return PlayIcon;
- case 'stop': return SquareIcon;
- case 'restart': return RotateCwIcon;
+ case 'start':
+ return PlayIcon;
+ case 'stop':
+ return SquareIcon;
+ case 'restart':
+ return RotateCwIcon;
}
};
@@ -55,8 +58,12 @@ const surfaceLabel = (surface?: DockerContainerLifecycleSurface): string =>
const requestedByForSurface = (surface?: DockerContainerLifecycleSurface): string =>
surface === 'resource-detail' ? 'ui:resource-detail' : 'ui:docker-page';
-export const DockerContainerLifecycleControls: Component<DockerContainerLifecycleControlsProps> = (props) => {
- const [planningAction, setPlanningAction] = createSignal<DockerContainerLifecycleAction | null>(null);
+export const DockerContainerLifecycleControls: Component<DockerContainerLifecycleControlsProps> = (
+ props,
+) => {
+ const [planningAction, setPlanningAction] = createSignal<DockerContainerLifecycleAction | null>(
+ null,
+ );
const [reviewAction, setReviewAction] = createSignal<DockerContainerLifecycleAction | null>(null);
const [reviewDetail, setReviewDetail] = createSignal<ActionDetailResponse | null>(null);
const [lastError, setLastError] = createSignal('');
@@ -82,7 +89,10 @@ export const DockerContainerLifecycleControls: Component<DockerContainerLifecycl
setReviewAction(action);
setReviewDetail(await ResourceActionsAPI.getAction(plan.actionId));
} catch (error) {
- const message = error instanceof Error && error.message.trim() ? error.message.trim() : 'Action review could not be prepared.';
+ const message =
+ error instanceof Error && error.message.trim()
+ ? error.message.trim()
+ : 'Action review could not be prepared.';
setLastError(message);
notificationStore.error(message);
} finally {
@@ -100,14 +110,40 @@ export const DockerContainerLifecycleControls: Component<DockerContainerLifecycl
};
return (
- <div class={`inline-flex items-center justify-end gap-1 ${props.class ?? ''}`.trim()} data-prevent-toggle data-docker-container-actions-surface={props.surface ?? 'docker-page'}>
+ <div
+ class={`inline-flex items-center justify-end gap-1 ${props.class ?? ''}`.trim()}
+ data-prevent-toggle
+ data-docker-container-actions-surface={props.surface ?? 'docker-page'}
+ >
<For each={DOCKER_CONTAINER_LIFECYCLE_ACTIONS}>
{(spec) => {
- const disabled = () => Boolean(getDockerContainerLifecycleDisabledReason(props.resource, spec.action)) || (planningAction() !== null && planningAction() !== spec.action);
+ const disabled = () =>
+ Boolean(getDockerContainerLifecycleDisabledReason(props.resource, spec.action)) ||
+ (planningAction() !== null && planningAction() !== spec.action);
const Icon = iconForAction(spec.action);
return (
- <button type="button" class={`${buttonBaseClass} ${planningAction() === spec.action ? runningButtonClass : disabled() ? disabledButtonClass : enabledButtonClass}`} disabled={disabled()} title={titleForAction(spec.action, spec.label)} aria-label={titleForAction(spec.action, spec.label)} data-docker-container-action={spec.action} onMouseDown={(event) => event.stopPropagation()} onKeyDown={(event) => event.stopPropagation()} onClick={(event) => { event.stopPropagation(); void prepareLifecycleReview(spec.action); }}>
- <Switch><Match when={planningAction() === spec.action}><Loader2Icon class="h-3.5 w-3.5 animate-spin" aria-hidden="true" /></Match><Match when={true}><Icon class="h-3.5 w-3.5" aria-hidden="true" /></Match></Switch>
+ <button
+ type="button"
+ class={`${buttonBaseClass} ${planningAction() === spec.action ? runningButtonClass : disabled() ? disabledButtonClass : enabledButtonClass}`}
+ disabled={disabled()}
+ title={titleForAction(spec.action, spec.label)}
+ aria-label={titleForAction(spec.action, spec.label)}
+ data-docker-container-action={spec.action}
+ onMouseDown={(event) => event.stopPropagation()}
+ onKeyDown={(event) => event.stopPropagation()}
+ onClick={(event) => {
+ event.stopPropagation();
+ void prepareLifecycleReview(spec.action);
+ }}
+ >
+ <Switch>
+ <Match when={planningAction() === spec.action}>
+ <Loader2Icon class="h-3.5 w-3.5 animate-spin" aria-hidden="true" />
+ </Match>
+ <Match when={true}>
+ <Icon class="h-3.5 w-3.5" aria-hidden="true" />
+ </Match>
+ </Switch>
</button>
);
}}
@@ -118,11 +154,21 @@ export const DockerContainerLifecycleControls: Component<DockerContainerLifecycl
onChanged={async (detail) => {
setReviewDetail(detail);
const action = reviewAction();
- if (!action || !['completed', 'failed', 'rejected', 'expired'].includes(detail.audit.state)) return;
+ if (
+ !action ||
+ !['completed', 'failed', 'rejected', 'expired'].includes(detail.audit.state)
+ )
+ return;
try {
- await props.onActionSettled?.({ action, actionId: detail.audit.id, resource: props.resource });
+ await props.onActionSettled?.({
+ action,
+ actionId: detail.audit.id,
+ resource: props.resource,
+ });
} catch {
- notificationStore.warning('Action recorded. Refresh container inventory to see the latest state.');
+ notificationStore.warning(
+ 'Action recorded. Refresh container inventory to see the latest state.',
+ );
}
}}
/>
diff --git a/frontend-modern/src/features/docker/DockerHostDrawer.tsx b/frontend-modern/src/features/docker/DockerHostDrawer.tsx
index 0daf34584b..22fa9d55a6 100644
--- a/frontend-modern/src/features/docker/DockerHostDrawer.tsx
+++ b/frontend-modern/src/features/docker/DockerHostDrawer.tsx
@@ -6,7 +6,10 @@ import { DiscoveryLoadingFallback } from '@/components/shared/DiscoveryLoadingFa
import { DrawerSubjectHeading } from '@/components/shared/DrawerSubjectHeading';
import { Subtabs, type SubtabOption } from '@/components/shared/Subtabs';
import { getSimpleStatusIndicator } from '@/utils/status';
-import { GuestDrawerHistory, GuestDrawerHistoryRangeSelect } from '@/components/Workloads/GuestDrawerHistory';
+import {
+ GuestDrawerHistory,
+ GuestDrawerHistoryRangeSelect,
+} from '@/components/Workloads/GuestDrawerHistory';
import { GUEST_DRAWER_HISTORY_DEFAULT_RANGE } from '@/components/Workloads/guestDrawerModel';
import { toDiscoveryConfig } from '@/components/Infrastructure/resourceDetailDiscoveryModel';
import type { Resource } from '@/types/resource';
@@ -39,11 +42,7 @@ export const DockerHostDrawer: Component<DockerHostDrawerProps> = (props) => {
const headerIndicator = createMemo(() => getSimpleStatusIndicator(props.host.status));
return (
- <section
- class="space-y-3"
- aria-labelledby={headingId()}
- data-testid="docker-host-drawer"
- >
+ <section class="space-y-3" aria-labelledby={headingId()} data-testid="docker-host-drawer">
<DrawerSubjectHeading
headingId={headingId()}
title={displayName()}
diff --git a/frontend-modern/src/features/docker/DockerIdentityConflictNotice.tsx b/frontend-modern/src/features/docker/DockerIdentityConflictNotice.tsx
index 734b0073e2..b18b94abe6 100644
--- a/frontend-modern/src/features/docker/DockerIdentityConflictNotice.tsx
+++ b/frontend-modern/src/features/docker/DockerIdentityConflictNotice.tsx
@@ -21,8 +21,7 @@ export function DockerIdentityConflictNotice(props: DockerIdentityConflictNotice
const message = createMemo(() => {
if (count() === 1) {
const host = props.hosts[0];
- const names =
- host.hostnames.length > 1 ? ` (${host.hostnames.join(', ')})` : '';
+ const names = host.hostnames.length > 1 ? ` (${host.hostnames.join(', ')})` : '';
return (
`Two machines appear to share the identity of ${host.name}${names}. ` +
`They are likely cloned VMs with the same /etc/machine-id, so Pulse sees them as one host and their reports overwrite each other. ` +
diff --git a/frontend-modern/src/features/docker/DockerSecretsTable.tsx b/frontend-modern/src/features/docker/DockerSecretsTable.tsx
index 8782ddc241..f4475de47a 100644
--- a/frontend-modern/src/features/docker/DockerSecretsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerSecretsTable.tsx
@@ -62,7 +62,9 @@ export const DockerSecretsTable: Component<DockerNativeTableProps> = (props) =>
sortKeys: DOCKER_SECRET_SORT_KEYS,
descendingFirst: ['created'],
});
- const sortedRows = createMemo(() => sort.sortRows(tableState.filtered(), getDockerSecretSortValue));
+ const sortedRows = createMemo(() =>
+ sort.sortRows(tableState.filtered(), getDockerSecretSortValue),
+ );
return (
<Show
diff --git a/frontend-modern/src/features/docker/DockerServicesTable.tsx b/frontend-modern/src/features/docker/DockerServicesTable.tsx
index 8f3e464b2e..f60ee114f9 100644
--- a/frontend-modern/src/features/docker/DockerServicesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerServicesTable.tsx
@@ -131,7 +131,10 @@ export const DockerServicesTable: Component<{
descendingFirst: ['desired', 'running'],
});
const sortedRows = createMemo(() =>
- sort.sortRows([...tableState.filtered()].sort(compareDockerServices), getDockerServiceSortValue),
+ sort.sortRows(
+ [...tableState.filtered()].sort(compareDockerServices),
+ getDockerServiceSortValue,
+ ),
);
const hasFilteredSourceRows = () => (props.sourceCount ?? props.resources.length) > 0;
@@ -215,12 +218,7 @@ export const DockerServicesTable: Component<{
>
Image
</PlatformSortableTableHead>
- <PlatformSortableTableHead
- kind="text"
- sort={sort}
- sortKey="mode"
- class="md:w-[8%]"
- >
+ <PlatformSortableTableHead kind="text" sort={sort} sortKey="mode" class="md:w-[8%]">
Mode
</PlatformSortableTableHead>
<PlatformSortableTableHead
diff --git a/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx b/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx
index dfdd959dec..ed9524674d 100644
--- a/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerSwarmNodesTable.tsx
@@ -71,9 +71,7 @@ const getDockerSwarmNodeSortValue = (
? resource.docker.memoryBytes
: null;
case 'address':
- return (
- asTrimmedString(resource.docker?.address || resource.docker?.managerAddress) || null
- );
+ return asTrimmedString(resource.docker?.address || resource.docker?.managerAddress) || null;
default:
key satisfies never;
return null;
diff --git a/frontend-modern/src/features/docker/DockerVolumesTable.tsx b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
index ec87f002d3..7e1647e94f 100644
--- a/frontend-modern/src/features/docker/DockerVolumesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerVolumesTable.tsx
@@ -87,7 +87,9 @@ export const DockerVolumesTable: Component<DockerNativeTableProps> = (props) =>
sortKeys: DOCKER_VOLUME_SORT_KEYS,
descendingFirst: ['size', 'refs', 'created'],
});
- const sortedRows = createMemo(() => sort.sortRows(tableState.filtered(), getDockerVolumeSortValue));
+ const sortedRows = createMemo(() =>
+ sort.sortRows(tableState.filtered(), getDockerVolumeSortValue),
+ );
return (
<Show
diff --git a/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx
index 6b60a1649e..d3e9b02aa2 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerContainersTable.sort.test.tsx
@@ -7,8 +7,7 @@ import type { Resource } from '@/types/resource';
import { DockerContainersTable } from '../DockerContainersTable';
vi.mock('@/api/monitoring', () => ({
- MonitoringAPI: {
- },
+ MonitoringAPI: {},
}));
vi.mock('@/stores/notifications', () => ({
@@ -34,7 +33,10 @@ vi.mock('@/stores/systemSettings', () => ({
vi.mock('@/components/shared/responsive', () => ({
ResponsiveMetricCell: (props: { type: string; resourceId?: string }) => (
- <div data-testid={`responsive-${props.type}-metric`} data-resource-id={props.resourceId ?? ''} />
+ <div
+ data-testid={`responsive-${props.type}-metric`}
+ data-resource-id={props.resourceId ?? ''}
+ />
),
}));
@@ -88,15 +90,17 @@ const renderTable = () =>
<Router>
<Route
path="/"
- component={(() => (
- <DockerContainersTable
- resources={FIXTURE}
- emptyIcon={<span />}
- emptyTitle="No containers"
- emptyDescription="No containers"
- showToolbar={false}
- />
- )) as () => JSX.Element}
+ component={
+ (() => (
+ <DockerContainersTable
+ resources={FIXTURE}
+ emptyIcon={<span />}
+ emptyTitle="No containers"
+ emptyDescription="No containers"
+ showToolbar={false}
+ />
+ )) as () => JSX.Element
+ }
/>
</Router>
));
diff --git a/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
index 8be05c4717..7538a7b9f4 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
@@ -56,8 +56,36 @@ vi.mock('@/api/resourceActions', () => ({
updatedAt: '2026-06-12T20:00:00Z',
state: 'pending_approval',
decisionRevision: 0,
- request: { requestId: 'request-1', resourceId: 'container-1', capabilityName: 'restart', reason: 'restart Docker container edge-web', requestedBy: 'ui:docker-page' },
- plan: { actionId: 'action-1', requestId: 'request-1', allowed: true, requiresApproval: true, approvalPolicy: 'admin', rollbackAvailable: false, expiresAt: '2026-06-12T20:05:00Z', policyDecision: { version: 0, status: 'legacy_unknown', scope: { orgId: '', resourceId: '', capabilityName: '' }, authorities: [], approvalRequirement: { version: 0, floor: 'admin', quorum: 1, disallowRequester: false }, planningAllowed: false, requiresApproval: true } },
+ request: {
+ requestId: 'request-1',
+ resourceId: 'container-1',
+ capabilityName: 'restart',
+ reason: 'restart Docker container edge-web',
+ requestedBy: 'ui:docker-page',
+ },
+ plan: {
+ actionId: 'action-1',
+ requestId: 'request-1',
+ allowed: true,
+ requiresApproval: true,
+ approvalPolicy: 'admin',
+ rollbackAvailable: false,
+ expiresAt: '2026-06-12T20:05:00Z',
+ policyDecision: {
+ version: 0,
+ status: 'legacy_unknown',
+ scope: { orgId: '', resourceId: '', capabilityName: '' },
+ authorities: [],
+ approvalRequirement: {
+ version: 0,
+ floor: 'admin',
+ quorum: 1,
+ disallowRequester: false,
+ },
+ planningAllowed: false,
+ requiresApproval: true,
+ },
+ },
verificationOutcome: { status: 'unknown' },
},
events: [],
diff --git a/frontend-modern/src/features/docker/__tests__/dockerContainerLifecycleActions.branchcov2.test.ts b/frontend-modern/src/features/docker/__tests__/dockerContainerLifecycleActions.branchcov2.test.ts
index facfe8d3ca..34d9608455 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerContainerLifecycleActions.branchcov2.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerContainerLifecycleActions.branchcov2.test.ts
@@ -40,9 +40,9 @@ describe('dockerContainerLifecycleActions.branchcov2', () => {
});
it('falls back to displayName when name is blank', () => {
- expect(
- dockerContainerLifecycleName(resource({ name: ' ', displayName: 'Web App' })),
- ).toBe('Web App');
+ expect(dockerContainerLifecycleName(resource({ name: ' ', displayName: 'Web App' }))).toBe(
+ 'Web App',
+ );
});
it('falls back to docker.displayName when name and displayName are blank', () => {
diff --git a/frontend-modern/src/features/docker/__tests__/dockerHostDrawerModel.test.ts b/frontend-modern/src/features/docker/__tests__/dockerHostDrawerModel.test.ts
index d97cb88d66..6fef764e3e 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerHostDrawerModel.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerHostDrawerModel.test.ts
@@ -32,10 +32,12 @@ const makeHost = (over: HostOverrides = {}): Resource =>
describe('dockerHostDrawerModel', () => {
describe('getDockerHostDrawerHistoryTarget', () => {
it('builds an agent-scoped target from the agent agentId', () => {
- expect(getDockerHostDrawerHistoryTarget(makeHost({ agent: { agentId: 'agent-9' } }))).toEqual({
- resourceType: 'agent',
- resourceId: 'agent-9',
- });
+ expect(getDockerHostDrawerHistoryTarget(makeHost({ agent: { agentId: 'agent-9' } }))).toEqual(
+ {
+ resourceType: 'agent',
+ resourceId: 'agent-9',
+ },
+ );
});
it('strips a leading agent: prefix from the agentId', () => {
@@ -51,9 +53,10 @@ describe('dockerHostDrawerModel', () => {
});
it('leaves an agentId that does not start with agent: untouched', () => {
- expect(
- getDockerHostDrawerHistoryTarget(makeHost({ agent: { agentId: 'node-1' } })),
- ).toEqual({ resourceType: 'agent', resourceId: 'node-1' });
+ expect(getDockerHostDrawerHistoryTarget(makeHost({ agent: { agentId: 'node-1' } }))).toEqual({
+ resourceType: 'agent',
+ resourceId: 'node-1',
+ });
});
it('trims surrounding whitespace before resolving the id', () => {
@@ -70,9 +73,10 @@ describe('dockerHostDrawerModel', () => {
});
it('strips the agent: prefix from the id fallback too', () => {
- expect(
- getDockerHostDrawerHistoryTarget(makeHost({ id: 'agent:host-1' })),
- ).toEqual({ resourceType: 'agent', resourceId: 'host-1' });
+ expect(getDockerHostDrawerHistoryTarget(makeHost({ id: 'agent:host-1' }))).toEqual({
+ resourceType: 'agent',
+ resourceId: 'host-1',
+ });
});
it('falls back to the resource name when neither agentId nor id are present', () => {
@@ -110,17 +114,15 @@ describe('dockerHostDrawerModel', () => {
});
it('returns null when the only candidate is whitespace', () => {
- expect(
- getDockerHostDrawerHistoryTarget(makeHost({ id: ' ', name: ' ' })),
- ).toBeNull();
+ expect(getDockerHostDrawerHistoryTarget(makeHost({ id: ' ', name: ' ' }))).toBeNull();
});
});
describe('getDockerHostDrawerHistoryFallbackMetrics', () => {
it('returns the host temperature when it is a finite number', () => {
- expect(
- getDockerHostDrawerHistoryFallbackMetrics(makeHost({ temperature: 42 })),
- ).toEqual({ temperature: 42 });
+ expect(getDockerHostDrawerHistoryFallbackMetrics(makeHost({ temperature: 42 }))).toEqual({
+ temperature: 42,
+ });
});
it('falls back to docker.temperature when host temperature is absent', () => {
@@ -213,11 +215,7 @@ describe('dockerHostDrawerModel', () => {
it('declares the utilization cpu/memory/disk series', () => {
const utilization = DOCKER_HOST_DRAWER_HISTORY_GROUPS.find((g) => g.id === 'utilization');
- expect(utilization?.series.map((series) => series.metric)).toEqual([
- 'cpu',
- 'memory',
- 'disk',
- ]);
+ expect(utilization?.series.map((series) => series.metric)).toEqual(['cpu', 'memory', 'disk']);
expect(utilization?.series.every((series) => series.unit === '%')).toBe(true);
});
diff --git a/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.branchcov0717.test.ts b/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.branchcov0717.test.ts
index 4c313e9342..104b3cf12a 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.branchcov0717.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.branchcov0717.test.ts
@@ -23,10 +23,7 @@ describe('dockerIdentityConflict.branchcov', () => {
it('returns an empty array when no host has docker.identityConflict (docker absent arm)', () => {
// `host.docker?.identityConflict` short-circuits at `docker` undefined ->
// `!conflict` is true -> continue.
- const hosts = [
- host({ id: 'h1', name: 'h1' }),
- host({ id: 'h2', name: 'h2' }),
- ];
+ const hosts = [host({ id: 'h1', name: 'h1' }), host({ id: 'h2', name: 'h2' })];
expect(collectIdentityConflictHosts(hosts)).toEqual([]);
});
@@ -81,9 +78,7 @@ describe('dockerIdentityConflict.branchcov', () => {
},
}),
]);
- expect(result).toEqual([
- { name: 'h1', hostnames: ['clone-a', 'clone-b'] },
- ]);
+ expect(result).toEqual([{ name: 'h1', hostnames: ['clone-a', 'clone-b'] }]);
});
it('drops hostnames that trim to empty (length === 0 filter arm)', () => {
@@ -275,10 +270,7 @@ describe('dockerIdentityConflict.branchcov', () => {
docker: { identityConflict: { hostnames: ['a-1'] } },
}),
];
- expect(collectIdentityConflictHosts(hosts).map((h) => h.name)).toEqual([
- 'zeta',
- 'alpha',
- ]);
+ expect(collectIdentityConflictHosts(hosts).map((h) => h.name)).toEqual(['zeta', 'alpha']);
});
});
});
diff --git a/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.test.tsx b/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.test.tsx
index ee9f54c7d2..a8875f61e4 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/dockerIdentityConflict.test.tsx
@@ -15,9 +15,9 @@ const dockerHost = (overrides: Partial<Resource> = {}): Resource =>
describe('collectIdentityConflictHosts', () => {
it('returns an empty list when no host carries a conflict', () => {
- expect(collectIdentityConflictHosts([dockerHost(), dockerHost({ id: 'h2', name: 'h2' })])).toEqual(
- [],
- );
+ expect(
+ collectIdentityConflictHosts([dockerHost(), dockerHost({ id: 'h2', name: 'h2' })]),
+ ).toEqual([]);
});
it('collects conflicting hosts with their hostnames', () => {
@@ -61,7 +61,9 @@ describe('DockerIdentityConflictNotice', () => {
/>
));
const notice = screen.getByTestId('docker-identity-conflict-notice');
- expect(notice.textContent).toContain('Two machines appear to share the identity of docker-host-1');
+ expect(notice.textContent).toContain(
+ 'Two machines appear to share the identity of docker-host-1',
+ );
expect(notice.textContent).toContain('clone-a, clone-b');
expect(notice.textContent).toContain('/etc/machine-id');
});
diff --git a/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage.test.ts b/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage.test.ts
index 918e027780..2c8d05c9cb 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage.test.ts
@@ -10,9 +10,7 @@ import {
mapDockerContainerStatus,
} from '../dockerPageModel';
-const makeResource = (
- resource: Partial<Resource> & Pick<Resource, 'id' | 'type'>,
-): Resource => ({
+const makeResource = (resource: Partial<Resource> & Pick<Resource, 'id' | 'type'>): Resource => ({
...resource,
name: resource.name ?? resource.id,
displayName: resource.displayName ?? resource.id,
@@ -47,7 +45,12 @@ describe('mapDockerContainerStatus — state fallbacks', () => {
it('returns Unknown when no container state or status is present', () => {
expect(
mapDockerContainerStatus(
- makeResource({ id: 'c-empty', type: 'app-container', status: '' as unknown as Resource['status'], docker: {} }),
+ makeResource({
+ id: 'c-empty',
+ type: 'app-container',
+ status: '' as unknown as Resource['status'],
+ docker: {},
+ }),
),
).toEqual({ variant: 'muted', label: 'Unknown' });
});
@@ -55,7 +58,11 @@ describe('mapDockerContainerStatus — state fallbacks', () => {
it('returns Unknown when docker is entirely absent and status is empty', () => {
expect(
mapDockerContainerStatus(
- makeResource({ id: 'c-no-docker', type: 'app-container', status: '' as unknown as Resource['status'] }),
+ makeResource({
+ id: 'c-no-docker',
+ type: 'app-container',
+ status: '' as unknown as Resource['status'],
+ }),
),
).toEqual({ variant: 'muted', label: 'Unknown' });
});
@@ -63,7 +70,11 @@ describe('mapDockerContainerStatus — state fallbacks', () => {
it('title-cases unrecognized container states as muted', () => {
expect(
mapDockerContainerStatus(
- makeResource({ id: 'c-unknown', type: 'app-container', docker: { containerState: 'quarantined' } }),
+ makeResource({
+ id: 'c-unknown',
+ type: 'app-container',
+ docker: { containerState: 'quarantined' },
+ }),
),
).toEqual({ variant: 'muted', label: 'Quarantined' });
});
@@ -71,7 +82,12 @@ describe('mapDockerContainerStatus — state fallbacks', () => {
it('falls back to resource.status when containerState is absent', () => {
expect(
mapDockerContainerStatus(
- makeResource({ id: 'c-status', type: 'app-container', status: 'restarting' as unknown as Resource['status'], docker: {} }),
+ makeResource({
+ id: 'c-status',
+ type: 'app-container',
+ status: 'restarting' as unknown as Resource['status'],
+ docker: {},
+ }),
),
).toEqual({ variant: 'warning', label: 'Restarting' });
});
@@ -83,7 +99,11 @@ describe('mapDockerContainerStatus — state fallbacks', () => {
])('treats %s as a deliberately stopped state', (state, label) => {
expect(
mapDockerContainerStatus(
- makeResource({ id: `c-${state}`, type: 'app-container', docker: { containerState: state } }),
+ makeResource({
+ id: `c-${state}`,
+ type: 'app-container',
+ docker: { containerState: state },
+ }),
),
).toEqual({ variant: 'muted', label });
});
@@ -91,7 +111,11 @@ describe('mapDockerContainerStatus — state fallbacks', () => {
it('treats removing as a fatal state with a title-cased label', () => {
expect(
mapDockerContainerStatus(
- makeResource({ id: 'c-removing', type: 'app-container', docker: { containerState: 'removing' } }),
+ makeResource({
+ id: 'c-removing',
+ type: 'app-container',
+ docker: { containerState: 'removing' },
+ }),
),
).toEqual({ variant: 'danger', label: 'Removing' });
});
@@ -155,7 +179,12 @@ describe('dockerResourceSearchHaystack — image tags and digests', () => {
describe('dockerContainerPortLabel — port token shapes', () => {
it('formats a fully mapped port with host IP', () => {
expect(
- dockerContainerPortLabel({ ip: '0.0.0.0', publicPort: 8080, privatePort: 80, protocol: 'tcp' }),
+ dockerContainerPortLabel({
+ ip: '0.0.0.0',
+ publicPort: 8080,
+ privatePort: 80,
+ protocol: 'tcp',
+ }),
).toBe('0.0.0.0:8080->80/tcp');
});
@@ -226,7 +255,9 @@ describe('dockerResourceSearchHaystack — volume mount guards', () => {
id: 'c-ro',
type: 'app-container',
docker: {
- mounts: [{ type: 'bind', source: '/host/config', destination: '/config', mode: 'Z', rw: false }],
+ mounts: [
+ { type: 'bind', source: '/host/config', destination: '/config', mode: 'Z', rw: false },
+ ],
},
});
expect(dockerResourceSearchHaystack(container)).toContain('read-only');
diff --git a/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage2.test.ts b/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage2.test.ts
index f35bc17517..d59b6c6e41 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage2.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerPageModel.coverage2.test.ts
@@ -14,9 +14,7 @@ import {
mapDockerTaskStatus,
} from '../dockerPageModel';
-const makeResource = (
- resource: Partial<Resource> & Pick<Resource, 'id' | 'type'>,
-): Resource => ({
+const makeResource = (resource: Partial<Resource> & Pick<Resource, 'id' | 'type'>): Resource => ({
...resource,
name: resource.name ?? resource.id,
displayName: resource.displayName ?? resource.id,
@@ -320,35 +318,29 @@ describe('hasDockerStorageUsageBucket', () => {
// ---------------------------------------------------------------------------
describe('mapDockerSwarmNodeStatus — down, degraded, ready, and unknown branches', () => {
- it.each(['offline', 'stopped', 'failed'])(
- 'returns danger Down for status %s',
- (status) => {
- expect(
- mapDockerSwarmNodeStatus(
- makeResource({
- id: `n-${status}`,
- type: 'docker-swarm-node',
- status: status as Resource['status'],
- }),
- ),
- ).toEqual({ variant: 'danger', label: 'Down' });
- },
- );
-
- it.each(['degraded', 'warning'])(
- 'returns warning Degraded for status %s',
- (status) => {
- expect(
- mapDockerSwarmNodeStatus(
- makeResource({
- id: `n-${status}`,
- type: 'docker-swarm-node',
- status: status as Resource['status'],
- }),
- ),
- ).toEqual({ variant: 'warning', label: 'Degraded' });
- },
- );
+ it.each(['offline', 'stopped', 'failed'])('returns danger Down for status %s', (status) => {
+ expect(
+ mapDockerSwarmNodeStatus(
+ makeResource({
+ id: `n-${status}`,
+ type: 'docker-swarm-node',
+ status: status as Resource['status'],
+ }),
+ ),
+ ).toEqual({ variant: 'danger', label: 'Down' });
+ });
+
+ it.each(['degraded', 'warning'])('returns warning Degraded for status %s', (status) => {
+ expect(
+ mapDockerSwarmNodeStatus(
+ makeResource({
+ id: `n-${status}`,
+ type: 'docker-swarm-node',
+ status: status as Resource['status'],
+ }),
+ ),
+ ).toEqual({ variant: 'warning', label: 'Degraded' });
+ });
it('returns success Ready for an active non-leader running node', () => {
expect(
@@ -418,7 +410,11 @@ describe('mapDockerTaskStatus — uncovered state branches', () => {
it('returns success for complete', () => {
expect(
mapDockerTaskStatus(
- makeResource({ id: 't-complete', type: 'docker-task', docker: { currentState: 'complete' } }),
+ makeResource({
+ id: 't-complete',
+ type: 'docker-task',
+ docker: { currentState: 'complete' },
+ }),
),
).toEqual({ variant: 'success', label: 'Complete' });
});
@@ -470,9 +466,9 @@ describe('mapDockerTaskStatus — uncovered state branches', () => {
describe('hasDockerSwarmEvidence — inactive and active evidence branches', () => {
it('returns false when docker.swarm is absent', () => {
- expect(
- hasDockerSwarmEvidence(makeResource({ id: 'host-1', type: 'agent', docker: {} })),
- ).toBe(false);
+ expect(hasDockerSwarmEvidence(makeResource({ id: 'host-1', type: 'agent', docker: {} }))).toBe(
+ false,
+ );
});
it('returns false when docker is absent entirely', () => {
@@ -960,9 +956,7 @@ describe('buildDockerIncidentRow fallback chains (via buildDockerIncidentRows)',
makeResource({
id: 'r1',
type: 'app-container',
- incidents: [
- { code: 'docker_alert', severity: 'warning', summary: 'x', provider: 'swarm' },
- ],
+ incidents: [{ code: 'docker_alert', severity: 'warning', summary: 'x', provider: 'swarm' }],
}),
]);
expect(rows[0].source).toBe('swarm');
@@ -1233,9 +1227,9 @@ describe('dockerIncidentSearchHaystack (via filterDockerIncidents)', () => {
incidents: [{ code: 'docker_alert', severity: 'warning', summary: 'x' }],
}),
]);
- expect(
- filterDockerIncidents(incidents, 'prod-swarm', 'all').map((r) => r.resourceId),
- ).toEqual(['r1']);
+ expect(filterDockerIncidents(incidents, 'prod-swarm', 'all').map((r) => r.resourceId)).toEqual([
+ 'r1',
+ ]);
});
it('matches resource.docker.serviceName', () => {
@@ -1263,9 +1257,9 @@ describe('dockerIncidentSearchHaystack (via filterDockerIncidents)', () => {
incidents: [{ code: 'docker_alert', severity: 'warning', summary: 'x' }],
}),
]);
- expect(
- filterDockerIncidents(incidents, 'env:prod', 'all').map((r) => r.resourceId),
- ).toEqual(['r1']);
+ expect(filterDockerIncidents(incidents, 'env:prod', 'all').map((r) => r.resourceId)).toEqual([
+ 'r1',
+ ]);
});
it('matches resource.parentName', () => {
@@ -1278,9 +1272,9 @@ describe('dockerIncidentSearchHaystack (via filterDockerIncidents)', () => {
incidents: [{ code: 'docker_alert', severity: 'warning', summary: 'x' }],
}),
]);
- expect(
- filterDockerIncidents(incidents, 'parent-host', 'all').map((r) => r.resourceId),
- ).toEqual(['r1']);
+ expect(filterDockerIncidents(incidents, 'parent-host', 'all').map((r) => r.resourceId)).toEqual(
+ ['r1'],
+ );
});
it('matches resource.platformId', () => {
@@ -1309,9 +1303,9 @@ describe('dockerIncidentSearchHaystack (via filterDockerIncidents)', () => {
incidents: [{ code: 'docker_alert', severity: 'warning', summary: 'x' }],
}),
]);
- expect(
- filterDockerIncidents(incidents, 'playbook', 'all').map((r) => r.resourceId),
- ).toEqual(['r1']);
+ expect(filterDockerIncidents(incidents, 'playbook', 'all').map((r) => r.resourceId)).toEqual([
+ 'r1',
+ ]);
expect(
filterDockerIncidents(incidents, 'disk-pressure', 'all').map((r) => r.resourceId),
).toEqual(['r1']);
@@ -1339,9 +1333,9 @@ describe('mapResourceStatusToTriad (via filterDockerResources)', () => {
type: 'app-container',
status: 'stopped',
});
- expect(
- filterDockerResources([resource], '', 'offline').map((r) => r.id),
- ).toEqual(['r-stopped']);
+ expect(filterDockerResources([resource], '', 'offline').map((r) => r.id)).toEqual([
+ 'r-stopped',
+ ]);
});
it('maps unknown status to unknown (excluded from all specific filters)', () => {
diff --git a/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx
index c37c3e9045..3bf326260a 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesAlertsTable.tsx
@@ -266,7 +266,8 @@ export const KubernetesAlertsTable: Component<{
{scopeText()}
</span>
<span class="block truncate text-[10px] text-muted">
- {k()?.nodeName || formatPlatformAlertCode(incident.code, 'kubernetes')}
+ {k()?.nodeName ||
+ formatPlatformAlertCode(incident.code, 'kubernetes')}
</span>
</TableCell>
<TableCell
diff --git a/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
index 5c7d0357eb..d7d4dab744 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesAutoscalingTable.tsx
@@ -207,7 +207,11 @@ export const KubernetesAutoscalingTable: Component<{
<PlatformSortableTableHead kind="text" sort={sort} class="md:w-[11%]">
Metrics
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[7%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[7%]"
+ >
Labels
</PlatformSortableTableHead>
</>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
index 407d6c8b98..f42c6eda7d 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesConfigTable.tsx
@@ -261,7 +261,12 @@ export const KubernetesConfigTable: Component<{
>
Resource
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} sortKey="kind" class="md:w-[13%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ sortKey="kind"
+ class="md:w-[13%]"
+ >
Kind
</PlatformSortableTableHead>
<PlatformSortableTableHead
@@ -283,10 +288,18 @@ export const KubernetesConfigTable: Component<{
<PlatformSortableTableHead kind="text" sort={sort} class="md:w-[14%]">
Data shape
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[13%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[13%]"
+ >
Token refs
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[10%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[10%]"
+ >
Labels
</PlatformSortableTableHead>
</>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
index e1cf0e6b7e..f44ff77e78 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx
@@ -331,7 +331,11 @@ export const KubernetesControllersTable: Component<{
>
Exceptions
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[9%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[9%]"
+ >
Detail
</PlatformSortableTableHead>
</>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx
index 20e0f504e8..e0ea83aeda 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesNetworkingTable.tsx
@@ -205,7 +205,12 @@ export const KubernetesNetworkingTable: Component<{
>
Resource
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} sortKey="kind" class="md:w-[12%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ sortKey="kind"
+ class="md:w-[12%]"
+ >
Kind
</PlatformSortableTableHead>
<PlatformSortableTableHead
@@ -224,13 +229,21 @@ export const KubernetesNetworkingTable: Component<{
>
Type / class
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[18%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[18%]"
+ >
Address / hosts
</PlatformSortableTableHead>
<PlatformSortableTableHead kind="text" sort={sort} class="md:w-[12%]">
Ports
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[13%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[13%]"
+ >
Targets
</PlatformSortableTableHead>
</>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
index ca81901629..566480fd48 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesPodsTable.tsx
@@ -155,7 +155,10 @@ export const KubernetesPodsTable: Component<{
descendingFirst: ['restarts', 'age'],
});
const sortedRows = createMemo(() =>
- sort.sortRows([...tableState.filtered()].sort(compareKubernetesPods), getKubernetesPodSortValue),
+ sort.sortRows(
+ [...tableState.filtered()].sort(compareKubernetesPods),
+ getKubernetesPodSortValue,
+ ),
);
const drawer = createPlatformResourceDetailState({ idPrefix: 'kubernetes-pod-drawer' });
const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.resources);
@@ -220,7 +223,12 @@ export const KubernetesPodsTable: Component<{
>
Node
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} sortKey="status" class="md:w-[8%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ sortKey="status"
+ class="md:w-[8%]"
+ >
Status
</PlatformSortableTableHead>
<PlatformSortableTableHead
diff --git a/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx
index 61d9b414fb..0444e8a274 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesServicesTable.tsx
@@ -170,7 +170,12 @@ export const KubernetesServicesTable: Component<{
>
Scope
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} sortKey="type" class="md:w-[11%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ sortKey="type"
+ class="md:w-[11%]"
+ >
Type
</PlatformSortableTableHead>
<PlatformSortableTableHead
@@ -181,13 +186,21 @@ export const KubernetesServicesTable: Component<{
>
Cluster IP
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[13%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[13%]"
+ >
External IPs
</PlatformSortableTableHead>
<PlatformSortableTableHead kind="text" sort={sort} class="md:w-[16%]">
Ports
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[13%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[13%]"
+ >
Selector
</PlatformSortableTableHead>
</>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx
index f542d41431..92a497258c 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesStorageTable.tsx
@@ -275,7 +275,12 @@ export const KubernetesStorageTable: Component<{
>
Resource
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} sortKey="kind" class="md:w-[10%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ sortKey="kind"
+ class="md:w-[10%]"
+ >
Kind
</PlatformSortableTableHead>
<PlatformSortableTableHead
@@ -310,7 +315,11 @@ export const KubernetesStorageTable: Component<{
>
Size
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[12%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[12%]"
+ >
Access / policy
</PlatformSortableTableHead>
<PlatformSortableTableHead
diff --git a/frontend-modern/src/features/kubernetes/__tests__/KubernetesAlertsTable.test.tsx b/frontend-modern/src/features/kubernetes/__tests__/KubernetesAlertsTable.test.tsx
index 5cc02b5da8..5e23defdf4 100644
--- a/frontend-modern/src/features/kubernetes/__tests__/KubernetesAlertsTable.test.tsx
+++ b/frontend-modern/src/features/kubernetes/__tests__/KubernetesAlertsTable.test.tsx
@@ -62,9 +62,7 @@ describe('KubernetesAlertsTable', () => {
type: 'k8s-node',
name: 'edge-pop-lax-01',
kubernetes: { clusterName: 'edge' },
- incidents: [
- { code: 'k8s_node_version_drift', severity: 'info', summary: 'kubelet drift' },
- ],
+ incidents: [{ code: 'k8s_node_version_drift', severity: 'info', summary: 'kubelet drift' }],
}),
]);
diff --git a/frontend-modern/src/features/kubernetes/__tests__/KubernetesDeploymentsTable.test.tsx b/frontend-modern/src/features/kubernetes/__tests__/KubernetesDeploymentsTable.test.tsx
index ee844d536b..71471acabe 100644
--- a/frontend-modern/src/features/kubernetes/__tests__/KubernetesDeploymentsTable.test.tsx
+++ b/frontend-modern/src/features/kubernetes/__tests__/KubernetesDeploymentsTable.test.tsx
@@ -108,9 +108,9 @@ describe('KubernetesDeploymentsTable', () => {
/>
));
- const rows = Array.from(
- document.querySelectorAll('[data-kubernetes-deployment-row]'),
- ).map((row) => row.getAttribute('data-kubernetes-deployment-row'));
+ const rows = Array.from(document.querySelectorAll('[data-kubernetes-deployment-row]')).map(
+ (row) => row.getAttribute('data-kubernetes-deployment-row'),
+ );
expect(rows).toEqual(['broken', 'partial', 'healthy']);
expect(screen.getByTitle('0 / 3 ready')).toHaveClass('bg-red-500');
expect(screen.getByTitle('1 / 3 ready')).toHaveClass('bg-amber-500');
diff --git a/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.sort.test.tsx b/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.sort.test.tsx
index 6e9f41edbc..a2a7263d85 100644
--- a/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.sort.test.tsx
+++ b/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.sort.test.tsx
@@ -32,7 +32,9 @@ const FIXTURE: Resource[] = [
id: 'zulu',
kubernetes: {
podPhase: 'Running',
- podContainers: [{ ready: false, state: 'waiting', reason: 'CrashLoopBackOff', restartCount: 3 }],
+ podContainers: [
+ { ready: false, state: 'waiting', reason: 'CrashLoopBackOff', restartCount: 3 },
+ ],
},
}),
makePod({
diff --git a/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.test.tsx b/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.test.tsx
index c7913b0f3c..5fdb491f0c 100644
--- a/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.test.tsx
+++ b/frontend-modern/src/features/kubernetes/__tests__/KubernetesPodsTable.test.tsx
@@ -111,9 +111,7 @@ describe('KubernetesPodsTable', () => {
id: 'crashing-pod',
kubernetes: {
podPhase: 'Running',
- podContainers: [
- { ready: false, state: 'waiting', reason: 'CrashLoopBackOff' },
- ],
+ podContainers: [{ ready: false, state: 'waiting', reason: 'CrashLoopBackOff' }],
},
}),
makeResource({
@@ -134,8 +132,8 @@ describe('KubernetesPodsTable', () => {
/>
));
- const rows = Array.from(document.querySelectorAll('[data-kubernetes-pod-row]')).map(
- (row) => row.getAttribute('data-kubernetes-pod-row'),
+ const rows = Array.from(document.querySelectorAll('[data-kubernetes-pod-row]')).map((row) =>
+ row.getAttribute('data-kubernetes-pod-row'),
);
expect(rows).toEqual(['crashing-pod', 'not-ready-pod', 'happy-pod']);
// The failure reason is visible cell text, not just a dot tooltip.
diff --git a/frontend-modern/src/features/kubernetes/__tests__/kubernetesPageModel.branchcov.test.ts b/frontend-modern/src/features/kubernetes/__tests__/kubernetesPageModel.branchcov.test.ts
index ffe41de26e..f5b9ebe29b 100644
--- a/frontend-modern/src/features/kubernetes/__tests__/kubernetesPageModel.branchcov.test.ts
+++ b/frontend-modern/src/features/kubernetes/__tests__/kubernetesPageModel.branchcov.test.ts
@@ -188,9 +188,7 @@ describe('mapKubernetesNodeStatus — uncovered branches', () => {
it('returns muted Unknown for paused status (not handled by the node mapper)', () => {
expect(
- mapKubernetesNodeStatus(
- makeResource({ id: 'n-paused', type: 'k8s-node', status: 'paused' }),
- ),
+ mapKubernetesNodeStatus(makeResource({ id: 'n-paused', type: 'k8s-node', status: 'paused' })),
).toEqual({ variant: 'muted', label: 'Unknown' });
});
});
@@ -224,9 +222,7 @@ describe('kubernetesResourceSearchHaystack', () => {
resourceKind: 'Pod',
externalIps: ['1.2.3.4'],
addresses: ['10.0.0.1'],
- podContainers: [
- { name: 'main', image: 'ghcr.io/app:v1', state: 'running', reason: '' },
- ],
+ podContainers: [{ name: 'main', image: 'ghcr.io/app:v1', state: 'running', reason: '' }],
},
});
@@ -538,9 +534,7 @@ describe('buildKubernetesIncidentRow field fallbacks (via buildKubernetesInciden
makeResource({
id: 'a',
type: 'pod',
- incidents: [
- { code: 'k8s_x', severity: 'warning', summary: 's', nativeId: 'evt-42' },
- ],
+ incidents: [{ code: 'k8s_x', severity: 'warning', summary: 's', nativeId: 'evt-42' }],
}),
]);
expect(withNativeId[0].id).toBe('a:incident:evt-42:0');
@@ -560,9 +554,7 @@ describe('buildKubernetesIncidentRow field fallbacks (via buildKubernetesInciden
makeResource({
id: 'a',
type: 'pod',
- incidents: [
- { code: 'k8s_x', severity: 'warning', summary: 's', source: 'prometheus' },
- ],
+ incidents: [{ code: 'k8s_x', severity: 'warning', summary: 's', source: 'prometheus' }],
}),
]);
expect(fromSource[0].source).toBe('prometheus');
@@ -571,9 +563,7 @@ describe('buildKubernetesIncidentRow field fallbacks (via buildKubernetesInciden
makeResource({
id: 'b',
type: 'pod',
- incidents: [
- { code: 'k8s_x', severity: 'warning', summary: 's', provider: 'datadog' },
- ],
+ incidents: [{ code: 'k8s_x', severity: 'warning', summary: 's', provider: 'datadog' }],
}),
]);
expect(fromProvider[0].source).toBe('datadog');
diff --git a/frontend-modern/src/features/patrol/PatrolAutopilotAcknowledgementDialog.tsx b/frontend-modern/src/features/patrol/PatrolAutopilotAcknowledgementDialog.tsx
index d6099aafbc..fa60dae9e9 100644
--- a/frontend-modern/src/features/patrol/PatrolAutopilotAcknowledgementDialog.tsx
+++ b/frontend-modern/src/features/patrol/PatrolAutopilotAcknowledgementDialog.tsx
@@ -6,42 +6,128 @@ import type { PatrolIntelligenceState } from './usePatrolIntelligenceState';
const scopeLabel = (scope: string): string => {
switch (scope) {
- case 'policy_authorized_actions': return 'Only actions authorized by current server policy';
- case 'capability_allowlisted_only': return 'Only capabilities on the server allowlist';
- case 'outcome_truth_not_inferred': return 'Execution success is never presented as verified outcome truth';
- case 'revocation_and_version_rotation_bound': return 'Activation stops after revocation or acknowledgement version rotation';
- default: return scope.replace(/_/g, ' ');
+ case 'policy_authorized_actions':
+ return 'Only actions authorized by current server policy';
+ case 'capability_allowlisted_only':
+ return 'Only capabilities on the server allowlist';
+ case 'outcome_truth_not_inferred':
+ return 'Execution success is never presented as verified outcome truth';
+ case 'revocation_and_version_rotation_bound':
+ return 'Activation stops after revocation or acknowledgement version rotation';
+ default:
+ return scope.replace(/_/g, ' ');
}
};
-export const PatrolAutopilotAcknowledgementDialog: Component<{ state: PatrolIntelligenceState }> = (props) => {
+export const PatrolAutopilotAcknowledgementDialog: Component<{ state: PatrolIntelligenceState }> = (
+ props,
+) => {
const [accepted, setAccepted] = createSignal(false);
const status = () => props.state.autopilotStatus();
- const close = () => { setAccepted(false); props.state.setAutopilotDialogOpen(false); };
+ const close = () => {
+ setAccepted(false);
+ props.state.setAutopilotDialogOpen(false);
+ };
return (
- <Dialog isOpen={props.state.autopilotDialogOpen()} onClose={close} ariaLabelledBy="autopilot-ack-title" ariaDescribedBy="autopilot-ack-description" closeOnBackdrop={!props.state.isUpdatingAutonomy()} panelClass="max-w-2xl">
+ <Dialog
+ isOpen={props.state.autopilotDialogOpen()}
+ onClose={close}
+ ariaLabelledBy="autopilot-ack-title"
+ ariaDescribedBy="autopilot-ack-description"
+ closeOnBackdrop={!props.state.isUpdatingAutonomy()}
+ panelClass="max-w-2xl"
+ >
<div class="flex max-h-[min(90vh,800px)] flex-col">
<header class="flex items-start justify-between gap-4 border-b border-border px-5 py-4">
- <div><p class="text-xs font-semibold uppercase tracking-wide text-amber-700 dark:text-amber-300">Explicit control change</p><h2 id="autopilot-ack-title" class="mt-1 text-xl font-semibold">Activate Autopilot</h2><p id="autopilot-ack-description" class="mt-2 text-sm text-muted">Pulse will record a server-owned version {status()?.currentVersion ?? 'current'} acknowledgement before requesting full mode.</p></div>
- <Button variant="ghost" size="icon" aria-label="Close Autopilot acknowledgement" onClick={close}><XIcon class="h-5 w-5" /></Button>
+ <div>
+ <p class="text-xs font-semibold uppercase tracking-wide text-amber-700 dark:text-amber-300">
+ Explicit control change
+ </p>
+ <h2 id="autopilot-ack-title" class="mt-1 text-xl font-semibold">
+ Activate Autopilot
+ </h2>
+ <p id="autopilot-ack-description" class="mt-2 text-sm text-muted">
+ Pulse will record a server-owned version {status()?.currentVersion ?? 'current'}{' '}
+ acknowledgement before requesting full mode.
+ </p>
+ </div>
+ <Button
+ variant="ghost"
+ size="icon"
+ aria-label="Close Autopilot acknowledgement"
+ onClick={close}
+ >
+ <XIcon class="h-5 w-5" />
+ </Button>
</header>
<div class="overflow-y-auto px-5 py-4">
<div class="rounded-lg border border-amber-300 bg-amber-50 p-4 text-sm text-amber-950 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100">
- <p class="font-semibold">Autopilot may execute eligible infrastructure actions without asking each time.</p>
- <p class="mt-2">It remains bounded by approval floors, per-resource policy, the emergency stop, current licensing, and fresh execution-time authorization.</p>
+ <p class="font-semibold">
+ Autopilot may execute eligible infrastructure actions without asking each time.
+ </p>
+ <p class="mt-2">
+ It remains bounded by approval floors, per-resource policy, the emergency stop,
+ current licensing, and fresh execution-time authorization.
+ </p>
</div>
<h3 class="mt-5 text-sm font-semibold">What this acknowledgement covers</h3>
- <ul class="mt-2 space-y-2 text-sm"><For each={status()?.acceptedScope ?? ['policy_authorized_actions', 'capability_allowlisted_only', 'outcome_truth_not_inferred']}>{(scope) => <li class="flex gap-2"><span aria-hidden="true">•</span><span>{scopeLabel(scope)}</span></li>}</For></ul>
+ <ul class="mt-2 space-y-2 text-sm">
+ <For
+ each={
+ status()?.acceptedScope ?? [
+ 'policy_authorized_actions',
+ 'capability_allowlisted_only',
+ 'outcome_truth_not_inferred',
+ ]
+ }
+ >
+ {(scope) => (
+ <li class="flex gap-2">
+ <span aria-hidden="true">•</span>
+ <span>{scopeLabel(scope)}</span>
+ </li>
+ )}
+ </For>
+ </ul>
<h3 class="mt-5 text-sm font-semibold">Truth and recovery limits</h3>
<ul class="mt-2 list-disc space-y-2 pl-5 text-sm text-muted">
<li>Verification can be confirmed, contradicted, inconclusive, or not attempted.</li>
- <li>Pulse discloses whether evidence came from the executing agent or an independent observer.</li>
- <li>You can revoke this acknowledgement. Version changes, expiry, revocation, policy drift, or reconnect races demote effective mode server-side.</li>
+ <li>
+ Pulse discloses whether evidence came from the executing agent or an independent
+ observer.
+ </li>
+ <li>
+ You can revoke this acknowledgement. Version changes, expiry, revocation, policy
+ drift, or reconnect races demote effective mode server-side.
+ </li>
</ul>
- <label class="mt-5 flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-surface-hover p-4 text-sm"><input type="checkbox" class="mt-1 h-4 w-4" checked={accepted()} onChange={(event) => setAccepted(event.currentTarget.checked)} /><span><strong>I understand and accept these Autopilot limits.</strong><span class="mt-1 block text-muted">This acknowledgement applies to my authenticated organization and identity.</span></span></label>
+ <label class="mt-5 flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-surface-hover p-4 text-sm">
+ <input
+ type="checkbox"
+ class="mt-1 h-4 w-4"
+ checked={accepted()}
+ onChange={(event) => setAccepted(event.currentTarget.checked)}
+ />
+ <span>
+ <strong>I understand and accept these Autopilot limits.</strong>
+ <span class="mt-1 block text-muted">
+ This acknowledgement applies to my authenticated organization and identity.
+ </span>
+ </span>
+ </label>
</div>
- <footer class="flex flex-col-reverse gap-2 border-t border-border px-5 py-4 sm:flex-row sm:justify-end"><Button onClick={close}>Cancel</Button><Button variant="warningSolid" disabled={!accepted()} isLoading={props.state.isUpdatingAutonomy()} onClick={() => void props.state.acknowledgeAndActivateAutopilot()}>Record acknowledgement and activate</Button></footer>
+ <footer class="flex flex-col-reverse gap-2 border-t border-border px-5 py-4 sm:flex-row sm:justify-end">
+ <Button onClick={close}>Cancel</Button>
+ <Button
+ variant="warningSolid"
+ disabled={!accepted()}
+ isLoading={props.state.isUpdatingAutonomy()}
+ onClick={() => void props.state.acknowledgeAndActivateAutopilot()}
+ >
+ Record acknowledgement and activate
+ </Button>
+ </footer>
</div>
</Dialog>
);
diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
index a678a62b57..5453475856 100644
--- a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
@@ -276,14 +276,38 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState
</div>
</Show>
<Show when={state.requestedAutonomyLevel() !== state.autonomyLevel()}>
- <div role="status" class="mt-3 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200">
- Requested {PATROL_AUTONOMY_POLICY_PRESENTATION[state.requestedAutonomyLevel()].label}; effective mode is {selectedAutonomyPolicy().label}. Server status: {state.autopilotStatus()?.code.replace(/_/g, ' ') || 'unavailable'}.
+ <div
+ role="status"
+ class="mt-3 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200"
+ >
+ Requested {PATROL_AUTONOMY_POLICY_PRESENTATION[state.requestedAutonomyLevel()].label};
+ effective mode is {selectedAutonomyPolicy().label}. Server status:{' '}
+ {state.autopilotStatus()?.code.replace(/_/g, ' ') || 'unavailable'}.
</div>
</Show>
<Show when={state.autopilotStatus()?.active && state.autopilotStatus()?.acknowledgementId}>
<div class="mt-3 flex flex-col gap-2 rounded-md border border-border bg-surface px-3 py-3 text-xs sm:flex-row sm:items-center sm:justify-between">
- <div><span class="font-semibold">Autopilot acknowledgement v{state.autopilotStatus()?.acknowledgementVersion}</span><span class="ml-2 text-muted">Active for this identity<Show when={state.autopilotStatus()?.expiresAt}> until {new Date(state.autopilotStatus()!.expiresAt!).toLocaleString()}</Show>.</span></div>
- <Button size="sm" variant="dangerOutline" disabled={state.isUpdatingAutonomy()} onClick={() => void state.revokeAutopilot()}>Revoke Autopilot</Button>
+ <div>
+ <span class="font-semibold">
+ Autopilot acknowledgement v{state.autopilotStatus()?.acknowledgementVersion}
+ </span>
+ <span class="ml-2 text-muted">
+ Active for this identity
+ <Show when={state.autopilotStatus()?.expiresAt}>
+ {' '}
+ until {new Date(state.autopilotStatus()!.expiresAt!).toLocaleString()}
+ </Show>
+ .
+ </span>
+ </div>
+ <Button
+ size="sm"
+ variant="dangerOutline"
+ disabled={state.isUpdatingAutonomy()}
+ onClick={() => void state.revokeAutopilot()}
+ >
+ Revoke Autopilot
+ </Button>
</div>
</Show>
</>
diff --git a/frontend-modern/src/features/patrol/__tests__/PatrolAutopilotAcknowledgementDialog.test.tsx b/frontend-modern/src/features/patrol/__tests__/PatrolAutopilotAcknowledgementDialog.test.tsx
index 5195db8ebf..68b30dfa89 100644
--- a/frontend-modern/src/features/patrol/__tests__/PatrolAutopilotAcknowledgementDialog.test.tsx
+++ b/frontend-modern/src/features/patrol/__tests__/PatrolAutopilotAcknowledgementDialog.test.tsx
@@ -10,13 +10,21 @@ describe('PatrolAutopilotAcknowledgementDialog', () => {
const activate = vi.fn();
const state = {
autopilotDialogOpen: () => true,
- autopilotStatus: () => ({ code: 'acknowledgement_required', active: false, currentVersion: 1, acceptedScope: ['policy_authorized_actions', 'outcome_truth_not_inferred'], acceptedLimits: {} }),
+ autopilotStatus: () => ({
+ code: 'acknowledgement_required',
+ active: false,
+ currentVersion: 1,
+ acceptedScope: ['policy_authorized_actions', 'outcome_truth_not_inferred'],
+ acceptedLimits: {},
+ }),
isUpdatingAutonomy: () => false,
setAutopilotDialogOpen: vi.fn(),
acknowledgeAndActivateAutopilot: activate,
} as unknown as PatrolIntelligenceState;
render(() => <PatrolAutopilotAcknowledgementDialog state={state} />);
- const activateButton = screen.getByRole('button', { name: 'Record acknowledgement and activate' });
+ const activateButton = screen.getByRole('button', {
+ name: 'Record acknowledgement and activate',
+ });
expect(activateButton).toBeDisabled();
expect(screen.getByText(/version 1 acknowledgement/i)).toBeInTheDocument();
fireEvent.click(screen.getByRole('checkbox'));
diff --git a/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts b/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts
index c814595338..33a3ae448c 100644
--- a/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts
+++ b/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts
@@ -78,7 +78,7 @@ describe('PatrolIntelligenceHeader', () => {
expect(headerSource).toContain('getPatrolSetupAction');
expect(headerSource).toContain('providerSetupAction().href');
expect(headerSource).toContain('Fix setup');
- expect(headerSource).toContain("getPatrolSetupAction(state.patrolReadiness()?.cause)");
+ expect(headerSource).toContain('getPatrolSetupAction(state.patrolReadiness()?.cause)');
expect(headerSource).toContain('runButtonDisabled');
expect(headerSource).not.toContain('!state.canTriggerPatrol() ||');
});
@@ -100,8 +100,7 @@ describe('PatrolIntelligenceHeader', () => {
},
approval: {
label: 'Ask first',
- detail:
- 'Patrol investigates and prepares fixes, but every change waits for your approval.',
+ detail: 'Patrol investigates and prepares fixes, but every change waits for your approval.',
compactLabel: 'Ask first',
},
assisted: {
diff --git a/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.ts b/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.ts
index 7b96139ef1..100d81e519 100644
--- a/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.ts
+++ b/frontend-modern/src/features/patrol/__tests__/patrolAutonomyAvailability.test.ts
@@ -41,9 +41,7 @@ const runtimeBlock = (
...overrides,
});
-const runtime = (
- overrides: Partial<LicenseRuntimeIdentity> = {},
-): LicenseRuntimeIdentity => ({
+const runtime = (overrides: Partial<LicenseRuntimeIdentity> = {}): LicenseRuntimeIdentity => ({
build: 'community-1',
label: 'Community runtime',
...overrides,
diff --git a/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.branchcov2.test.ts b/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.branchcov2.test.ts
index 4b01061100..60a80c6e56 100644
--- a/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.branchcov2.test.ts
@@ -227,25 +227,22 @@ describe('patrolControlPresentation branch coverage (set 2)', () => {
['approval work-type composition', { approval: 1 }],
['in-progress work-type composition', { inProgress: 1 }],
['recurring work-type composition', { recurring: 1 }],
- ] as const)(
- 'suppresses the posture when %s is present',
- (_label, compositionOverride) => {
- expect(
- getMonitorContextPatrolProtectionPosture({
- ...baseMonitorInput,
- workTypeComposition: {
- total: 1,
- approval: 0,
- failed: 0,
- inProgress: 0,
- recurring: 0,
- newIssues: 0,
- ...compositionOverride,
- },
- }),
- ).toEqual([]);
- },
- );
+ ] as const)('suppresses the posture when %s is present', (_label, compositionOverride) => {
+ expect(
+ getMonitorContextPatrolProtectionPosture({
+ ...baseMonitorInput,
+ workTypeComposition: {
+ total: 1,
+ approval: 0,
+ failed: 0,
+ inProgress: 0,
+ recurring: 0,
+ newIssues: 0,
+ ...compositionOverride,
+ },
+ }),
+ ).toEqual([]);
+ });
it('suppresses the posture when the status reports open findings', () => {
// OR operand: `statusFindingCount > 0`.
diff --git a/frontend-modern/src/features/patrol/__tests__/patrolInvestigationContextModel.branchcov.test.ts b/frontend-modern/src/features/patrol/__tests__/patrolInvestigationContextModel.branchcov.test.ts
index e9ca409644..3b26c3b5a3 100644
--- a/frontend-modern/src/features/patrol/__tests__/patrolInvestigationContextModel.branchcov.test.ts
+++ b/frontend-modern/src/features/patrol/__tests__/patrolInvestigationContextModel.branchcov.test.ts
@@ -138,18 +138,10 @@ describe('buildPatrolInvestigationRecordPresentation (branch coverage)', () => {
subject: { resource_id: 'vm-1' },
trigger: { detected_at: '2026-01-01T00:00:00Z' },
status: 'completed',
- evidence: [
- { kind: 'metrics' },
- { id: 'ev-2' },
- { summary: 'has summary' },
- ],
+ evidence: [{ kind: 'metrics' }, { id: 'ev-2' }, { summary: 'has summary' }],
} as unknown as InvestigationRecord);
- expect(presentation.evidenceSummaries).toEqual([
- 'metrics',
- 'ev-2',
- 'has summary',
- ]);
+ expect(presentation.evidenceSummaries).toEqual(['metrics', 'ev-2', 'has summary']);
});
it('keeps a proposed fix that has only a command summary but no description', () => {
@@ -251,9 +243,9 @@ describe('buildPatrolAssistantProposedFixBriefingInput (branch coverage)', () =>
});
it('treats a source with neither commandCount nor commands as zero commands', () => {
- expect(
- buildPatrolAssistantProposedFixBriefingInput({ description: 'd' }),
- ).toMatchObject({ commandCount: 0 });
+ expect(buildPatrolAssistantProposedFixBriefingInput({ description: 'd' })).toMatchObject({
+ commandCount: 0,
+ });
});
it('returns undefined when every field is empty and the fix is not destructive', () => {
@@ -270,9 +262,7 @@ describe('buildPatrolAssistantProposedFixBriefingInput (branch coverage)', () =>
});
it('keeps a fix whose only signal is that it is destructive', () => {
- expect(
- buildPatrolAssistantProposedFixBriefingInput({ destructive: true }),
- ).toEqual({
+ expect(buildPatrolAssistantProposedFixBriefingInput({ destructive: true })).toEqual({
description: '',
riskLevel: '',
targetHost: '',
@@ -320,9 +310,7 @@ describe('buildPatrolAssistantProposedFixBriefingInputFromApproval (branch cover
});
it('returns undefined for a null approval', () => {
- expect(
- buildPatrolAssistantProposedFixBriefingInputFromApproval(null),
- ).toBeUndefined();
+ expect(buildPatrolAssistantProposedFixBriefingInputFromApproval(null)).toBeUndefined();
});
});
@@ -547,12 +535,8 @@ describe('buildPatrolAssistantFindingHandoffInputFromUnifiedFinding (branch cove
describe('buildPatrolConfigurationFailureHandoff (branch coverage)', () => {
it('falls back to the default message and bare subject when message and code are empty', () => {
const handoff = buildPatrolConfigurationFailureHandoff({ message: '' });
- expect(handoff.context.briefing?.subject).toBe(
- 'Patrol mode could not be saved.',
- );
- expect(handoff.context.briefing?.title).toBe(
- 'Patrol mode save failure attached',
- );
+ expect(handoff.context.briefing?.subject).toBe('Patrol mode could not be saved.');
+ expect(handoff.context.briefing?.title).toBe('Patrol mode save failure attached');
expect(handoff.context.briefing?.statusLabel).toBeUndefined();
expect(handoff.context.briefing?.detailLines).toEqual([]);
});
@@ -564,9 +548,7 @@ describe('buildPatrolConfigurationFailureHandoff (branch coverage)', () => {
});
expect(handoff.context.briefing?.statusLabel).toBe('provider_unavailable');
- expect(handoff.context.briefing?.detailLines).toEqual([
- 'Cause: Provider Unavailable',
- ]);
+ expect(handoff.context.briefing?.detailLines).toEqual(['Cause: Provider Unavailable']);
expect(handoff.context.context?.readinessCause).toBe('provider_unavailable');
});
@@ -590,10 +572,7 @@ describe('buildPatrolConfigurationFailureHandoff (branch coverage)', () => {
readiness: { provider: 'ollama', model: 'm1' },
});
- expect(handoff.context.briefing?.detailLines).toEqual([
- 'Provider: ollama',
- 'Model: m1',
- ]);
+ expect(handoff.context.briefing?.detailLines).toEqual(['Provider: ollama', 'Model: m1']);
expect(handoff.context.context?.provider).toBe('ollama');
expect(handoff.context.context?.model).toBe('m1');
});
@@ -621,9 +600,7 @@ describe('buildPatrolConfigurationFailureHandoff (branch coverage)', () => {
describe('buildPatrolAssistantFindingBriefing (branch coverage)', () => {
it('returns undefined when there are no finding facts, record, approval, or fix', () => {
- expect(
- buildPatrolAssistantFindingBriefing({ title: 'T', subject: 'S' }),
- ).toBeUndefined();
+ expect(buildPatrolAssistantFindingBriefing({ title: 'T', subject: 'S' })).toBeUndefined();
});
it('uses the commands-plus-approval safety note when the fix is not destructive', () => {
diff --git a/frontend-modern/src/features/patrol/__tests__/usePatrolIntelligenceState.test.ts b/frontend-modern/src/features/patrol/__tests__/usePatrolIntelligenceState.test.ts
index 0d3131cd49..c5b76d9bcb 100644
--- a/frontend-modern/src/features/patrol/__tests__/usePatrolIntelligenceState.test.ts
+++ b/frontend-modern/src/features/patrol/__tests__/usePatrolIntelligenceState.test.ts
@@ -75,7 +75,9 @@ describe('usePatrolIntelligenceState', () => {
expect(patrolIntelligenceStateSource).toContain('rememberPatrolLoadError');
expect(patrolIntelligenceStateSource).toContain('Promise.allSettled([');
expect(patrolIntelligenceStateSource).toContain('setInitialSurfaceReady(true);');
- expect(patrolIntelligenceStateSource).toContain("logger.debug('[Patrol] Failed to refresh Patrol data'");
+ expect(patrolIntelligenceStateSource).toContain(
+ "logger.debug('[Patrol] Failed to refresh Patrol data'",
+ );
expect(patrolIntelligenceStateSource).toContain('patrolLoadError,');
});
diff --git a/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts b/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts
index a9d07fd8e1..d6ac6637c4 100644
--- a/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts
+++ b/frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts
@@ -232,7 +232,8 @@ export function usePatrolIntelligenceState() {
const [isRefreshing, setIsRefreshing] = createSignal(false);
const [isManualRefreshRunning, setIsManualRefreshRunning] = createSignal(false);
const [autonomyLevel, setAutonomyLevel] = createSignal<PatrolAutonomyLevel>('monitor');
- const [requestedAutonomyLevel, setRequestedAutonomyLevel] = createSignal<PatrolAutonomyLevel>('monitor');
+ const [requestedAutonomyLevel, setRequestedAutonomyLevel] =
+ createSignal<PatrolAutonomyLevel>('monitor');
const [autopilotStatus, setAutopilotStatus] = createSignal<PatrolAutopilotStatus | null>(null);
const [autopilotDialogOpen, setAutopilotDialogOpen] = createSignal(false);
const [isUpdatingAutonomy, setIsUpdatingAutonomy] = createSignal(false);
@@ -609,9 +610,7 @@ export function usePatrolIntelligenceState() {
return;
}
const previousLevel = autonomyLevel();
- const shouldRecordPatrolControlStarter =
- !controlLocked &&
- level !== previousLevel;
+ const shouldRecordPatrolControlStarter = !controlLocked && level !== previousLevel;
setIsUpdatingAutonomy(true);
try {
@@ -677,7 +676,9 @@ export function usePatrolIntelligenceState() {
await loadAutonomySettings();
notificationStore.success('Autopilot acknowledgement revoked. Effective mode refreshed.');
} catch (err) {
- notificationStore.error((err as Error).message || 'Autopilot acknowledgement could not be revoked.');
+ notificationStore.error(
+ (err as Error).message || 'Autopilot acknowledgement could not be revoked.',
+ );
} finally {
setIsUpdatingAutonomy(false);
}
diff --git a/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.branchcov2.test.ts b/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.branchcov2.test.ts
index 284951d4de..4272010da7 100644
--- a/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.branchcov2.test.ts
+++ b/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.branchcov2.test.ts
@@ -440,7 +440,12 @@ describe('buildPrimaryPlatformNavigationVisibility — standalone via availabili
it('shows standalone when resource.sources includes "availability"', () => {
const visibility = buildPrimaryPlatformNavigationVisibility([
- resource({ id: 'avail-src-1', type: 'agent', platformType: 'agent', sources: ['availability'] }),
+ resource({
+ id: 'avail-src-1',
+ type: 'agent',
+ platformType: 'agent',
+ sources: ['availability'],
+ }),
]);
expect(visibility.standalone).toBe(true);
});
diff --git a/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts b/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
index 59f089ef3a..ba845326f3 100644
--- a/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
+++ b/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
@@ -10,12 +10,7 @@ import {
import { normalizeSourcePlatformKey, resolveResourcePlatformType } from '@/utils/sourcePlatforms';
export type PrimaryPlatformNavId =
- | 'proxmox'
- | 'docker'
- | 'kubernetes'
- | 'truenas'
- | 'vmware'
- | 'standalone';
+ 'proxmox' | 'docker' | 'kubernetes' | 'truenas' | 'vmware' | 'standalone';
export type PlatformNavigationVisibility = Record<PrimaryPlatformNavId, boolean>;
diff --git a/frontend-modern/src/features/platformPage/__tests__/agentVersion.branchcov0712.test.ts b/frontend-modern/src/features/platformPage/__tests__/agentVersion.branchcov0712.test.ts
index 22213dce5e..443ab9a0e6 100644
--- a/frontend-modern/src/features/platformPage/__tests__/agentVersion.branchcov0712.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/agentVersion.branchcov0712.test.ts
@@ -18,9 +18,7 @@ describe('hostAgentConnectionID', () => {
it('trims whitespace on the agent meta id before prefixing', () => {
expect(
- hostAgentConnectionID(
- host({ agent: { agentId: ' agent-delly ' } as Resource['agent'] }),
- ),
+ hostAgentConnectionID(host({ agent: { agentId: ' agent-delly ' } as Resource['agent'] })),
).toBe('agent:agent-delly');
});
@@ -33,9 +31,7 @@ describe('hostAgentConnectionID', () => {
});
it('uses host.id for a type="agent" row with no agent meta id', () => {
- expect(hostAgentConnectionID(host({ type: 'agent', id: 'agent-123' }))).toBe(
- 'agent:agent-123',
- );
+ expect(hostAgentConnectionID(host({ type: 'agent', id: 'agent-123' }))).toBe('agent:agent-123');
});
it('uses an already-prefixed host.id for a type="agent" row without re-prefixing', () => {
diff --git a/frontend-modern/src/features/platformPage/__tests__/platformTableSortState.test.ts b/frontend-modern/src/features/platformPage/__tests__/platformTableSortState.test.ts
index e807c3677d..fab7a1863d 100644
--- a/frontend-modern/src/features/platformPage/__tests__/platformTableSortState.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/platformTableSortState.test.ts
@@ -21,7 +21,7 @@ const ROWS: readonly Row[] = [
{ name: 'charlie', cpu: 90 },
];
-const withSortState = <T,>(
+const withSortState = <T>(
fn: (sort: ReturnType<typeof createPlatformTableSortState<SortKey>>) => T,
): T =>
createRoot((dispose) => {
diff --git a/frontend-modern/src/features/platformPage/__tests__/sensorSetup.branchcov0712.test.ts b/frontend-modern/src/features/platformPage/__tests__/sensorSetup.branchcov0712.test.ts
index 9f2b1ecd91..ce1e3a6d06 100644
--- a/frontend-modern/src/features/platformPage/__tests__/sensorSetup.branchcov0712.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/sensorSetup.branchcov0712.test.ts
@@ -133,12 +133,14 @@ describe('isSMARTOnlyDiskWithoutTemperature (via collectOutdatedSensorSetupNodes
const node = legacyNode({ id: 'n-sas', proxmox: { node: 'pve' } });
const result = collectOutdatedSensorSetupNodes(
[node],
- [disk({
- id: 'd-sas',
- parentId: 'n-sas',
- diskType: ' SAS ',
- temperature: 0,
- })],
+ [
+ disk({
+ id: 'd-sas',
+ parentId: 'n-sas',
+ diskType: ' SAS ',
+ temperature: 0,
+ }),
+ ],
);
expect(result).toStrictEqual([{ id: 'n-sas', name: 'pve' }]);
});
diff --git a/frontend-modern/src/features/platformPage/columnAlignment.test.ts b/frontend-modern/src/features/platformPage/columnAlignment.test.ts
index 3cb49e9104..673683c7dc 100644
--- a/frontend-modern/src/features/platformPage/columnAlignment.test.ts
+++ b/frontend-modern/src/features/platformPage/columnAlignment.test.ts
@@ -40,9 +40,7 @@ describe('columnAlignment', () => {
);
it('is exhaustive over the PlatformTableColumnKind union (no missing or extra keys)', () => {
- expect(Object.keys(PLATFORM_COLUMN_ALIGN_BY_KIND).sort()).toEqual(
- [...ALL_KINDS].sort(),
- );
+ expect(Object.keys(PLATFORM_COLUMN_ALIGN_BY_KIND).sort()).toEqual([...ALL_KINDS].sort());
});
it('only emits valid PlatformTableCellAlign values', () => {
diff --git a/frontend-modern/src/features/platformPage/columnAlignment.ts b/frontend-modern/src/features/platformPage/columnAlignment.ts
index e4a05f93da..0f33e2bc53 100644
--- a/frontend-modern/src/features/platformPage/columnAlignment.ts
+++ b/frontend-modern/src/features/platformPage/columnAlignment.ts
@@ -84,12 +84,7 @@ import type { PlatformTableCellAlign } from './sharedPlatformPage';
* content demands it; the bar block contiguity and the Uptime-after-bars
* rule are the load-bearing parts of the convention.
*/
-export type PlatformTableColumnKind =
- | 'name'
- | 'text'
- | 'metric-bar'
- | 'numeric-value'
- | 'badge';
+export type PlatformTableColumnKind = 'name' | 'text' | 'metric-bar' | 'numeric-value' | 'badge';
export const PLATFORM_COLUMN_ALIGN_BY_KIND: Record<
PlatformTableColumnKind,
@@ -102,6 +97,5 @@ export const PLATFORM_COLUMN_ALIGN_BY_KIND: Record<
badge: 'center',
};
-export const getPlatformColumnAlign = (
- kind: PlatformTableColumnKind,
-): PlatformTableCellAlign => PLATFORM_COLUMN_ALIGN_BY_KIND[kind];
+export const getPlatformColumnAlign = (kind: PlatformTableColumnKind): PlatformTableCellAlign =>
+ PLATFORM_COLUMN_ALIGN_BY_KIND[kind];
diff --git a/frontend-modern/src/features/platformPage/platformIcon.test.ts b/frontend-modern/src/features/platformPage/platformIcon.test.ts
index 5b48e3f62b..f17336fa89 100644
--- a/frontend-modern/src/features/platformPage/platformIcon.test.ts
+++ b/frontend-modern/src/features/platformPage/platformIcon.test.ts
@@ -9,10 +9,7 @@ import { KubernetesIcon } from '@/components/icons/KubernetesIcon';
import { ProxmoxIcon } from '@/components/icons/ProxmoxIcon';
import { TrueNASIcon } from '@/components/icons/TrueNASIcon';
-import {
- getPlatformIcon,
- type PlatformIconKey,
-} from './platformIcon';
+import { getPlatformIcon, type PlatformIconKey } from './platformIcon';
const ALL_KEYS: PlatformIconKey[] = [
'proxmox',
@@ -68,9 +65,7 @@ describe('platformIcon', () => {
});
it('returns undefined for an unknown key at runtime', () => {
- expect(
- getPlatformIcon('does-not-exist' as unknown as PlatformIconKey),
- ).toBeUndefined();
+ expect(getPlatformIcon('does-not-exist' as unknown as PlatformIconKey)).toBeUndefined();
});
it('every resolved icon accepts a Solid props object (renderable component shape)', () => {
diff --git a/frontend-modern/src/features/platformPage/platformIcon.ts b/frontend-modern/src/features/platformPage/platformIcon.ts
index ae9f540171..9dba638ec6 100644
--- a/frontend-modern/src/features/platformPage/platformIcon.ts
+++ b/frontend-modern/src/features/platformPage/platformIcon.ts
@@ -8,13 +8,7 @@ import { ProxmoxIcon } from '@/components/icons/ProxmoxIcon';
import { TrueNASIcon } from '@/components/icons/TrueNASIcon';
export type PlatformIconKey =
- | 'proxmox'
- | 'docker'
- | 'kubernetes'
- | 'truenas'
- | 'vmware'
- | 'standalone'
- | 'systems';
+ 'proxmox' | 'docker' | 'kubernetes' | 'truenas' | 'vmware' | 'standalone' | 'systems';
export type PlatformIcon = (props: { class?: string }) => JSX.Element;
diff --git a/frontend-modern/src/features/platformPage/sensorSetup.test.ts b/frontend-modern/src/features/platformPage/sensorSetup.test.ts
index 4b205c68e1..9d42cbecc9 100644
--- a/frontend-modern/src/features/platformPage/sensorSetup.test.ts
+++ b/frontend-modern/src/features/platformPage/sensorSetup.test.ts
@@ -54,9 +54,9 @@ describe('collectOutdatedSensorSetupNodes', () => {
const wrapperNode = node({
proxmox: { node: 'pve1', temperatureDetails: { available: true } },
});
- expect(
- collectOutdatedSensorSetupNodes([wrapperNode], [disk({ nodeName: 'pve1' })]),
- ).toEqual([]);
+ expect(collectOutdatedSensorSetupNodes([wrapperNode], [disk({ nodeName: 'pve1' })])).toEqual(
+ [],
+ );
});
it('ignores legacy nodes when temperature collection did not succeed', () => {
@@ -90,9 +90,9 @@ describe('collectOutdatedSensorSetupNodes', () => {
});
it('ignores disks that belong to a different node', () => {
- expect(
- collectOutdatedSensorSetupNodes([legacyNode()], [disk({ nodeName: 'pve2' })]),
- ).toEqual([]);
+ expect(collectOutdatedSensorSetupNodes([legacyNode()], [disk({ nodeName: 'pve2' })])).toEqual(
+ [],
+ );
});
it('sorts multiple affected nodes by name', () => {
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 2f8cdf9684..824ffd3ae8 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -960,9 +960,11 @@ export const getPlatformResourceCountNoun = (rowNoun: string, count: number): st
return words.join(' ');
};
-export const PlatformResourceCounter: Component<{ visible: number; total: number; rowNoun: string }> = (
- props,
-) => {
+export const PlatformResourceCounter: Component<{
+ visible: number;
+ total: number;
+ rowNoun: string;
+}> = (props) => {
const totalNoun = () => getPlatformResourceCountNoun(props.rowNoun, props.total);
return (
<span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
diff --git a/frontend-modern/src/features/proxmox/ProxmoxBackupsCoverageStrip.tsx b/frontend-modern/src/features/proxmox/ProxmoxBackupsCoverageStrip.tsx
index e9306f53dd..f922f990be 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxBackupsCoverageStrip.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxBackupsCoverageStrip.tsx
@@ -28,7 +28,10 @@ export interface CoverageStripProps {
export const ProxmoxBackupsCoverageStrip: Component<CoverageStripProps> = (props) => {
const total = () =>
- props.segments.reduce((sum, seg) => sum + (Number.isFinite(seg.value) ? Math.max(0, seg.value) : 0), 0);
+ props.segments.reduce(
+ (sum, seg) => sum + (Number.isFinite(seg.value) ? Math.max(0, seg.value) : 0),
+ 0,
+ );
return (
<div class="rounded-lg border border-border-subtle bg-surface-alt/25 px-3 py-2">
@@ -42,9 +45,7 @@ export const ProxmoxBackupsCoverageStrip: Component<CoverageStripProps> = (props
</div>
<Show
when={total() > 0}
- fallback={
- <div class="mt-2 h-2 w-full rounded-full bg-surface" aria-hidden="true" />
- }
+ fallback={<div class="mt-2 h-2 w-full rounded-full bg-surface" aria-hidden="true" />}
>
<div class="mt-2 flex h-2 w-full overflow-hidden rounded-full bg-surface">
<For each={props.segments}>
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
index d6169bf298..1df8725dbe 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx
@@ -223,9 +223,7 @@ describe('ProxmoxPageSurface contract', () => {
render(() => <ProxmoxPageSurface />);
expect(screen.getByTestId('platform-table-loading-state')).toBeInTheDocument();
- expect(
- screen.queryByRole('list', { name: 'Proxmox Patrol coverage' }),
- ).not.toBeInTheDocument();
+ expect(screen.queryByRole('list', { name: 'Proxmox Patrol coverage' })).not.toBeInTheDocument();
});
it('does not surface stale-agent notices for development builds without an agent target', () => {
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
index 3a517c5c6a..f77766c51f 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
@@ -71,16 +71,21 @@ describe('proxmoxBackupActivityPresentation', () => {
['ok', 'OK', 'bg-emerald-500', 'bg-emerald-500'],
['failed', 'Failed', 'bg-red-500', 'bg-red-500'],
['running', 'Running', 'bg-amber-500', 'bg-amber-500'],
- ])('returns the canonical presentation for %s', (kind, label, segmentClassName, swatchClassName) => {
- expect(getBackupActivitySegmentPresentation(kind as BackupActivitySegmentKind)).toEqual({
- label,
- segmentClassName,
- swatchClassName,
- });
- });
+ ])(
+ 'returns the canonical presentation for %s',
+ (kind, label, segmentClassName, swatchClassName) => {
+ expect(getBackupActivitySegmentPresentation(kind as BackupActivitySegmentKind)).toEqual({
+ label,
+ segmentClassName,
+ swatchClassName,
+ });
+ },
+ );
it('returns a stable reference for repeated lookups', () => {
- expect(getBackupActivitySegmentPresentation('ok')).toBe(getBackupActivitySegmentPresentation('ok'));
+ expect(getBackupActivitySegmentPresentation('ok')).toBe(
+ getBackupActivitySegmentPresentation('ok'),
+ );
});
it('delegates source kinds to the proxmox backup source vocabulary', () => {
@@ -265,13 +270,29 @@ describe('proxmoxBackupActivityPresentation', () => {
it.each<[string, ActivityItem[], number]>([
['empty stays at the floor of 2', [], 2],
- ['a max of 1 stays at the floor of 2', [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 1 }], 2],
+ [
+ 'a max of 1 stays at the floor of 2',
+ [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 1 }],
+ 2,
+ ],
['a max of 2 maps to 2', [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 2 }], 2],
['a max of 5 maps to 5', [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 5 }], 5],
- ['a max of 6 rounds up to 10', [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 6 }], 10],
+ [
+ 'a max of 6 rounds up to 10',
+ [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 6 }],
+ 10,
+ ],
['a max of 50 maps to 50', [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 50 }], 50],
- ['a max of 100 maps to 100', [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 100 }], 100],
- ['a max of 1000 maps to 1000', [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 1000 }], 1000],
+ [
+ 'a max of 100 maps to 100',
+ [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 100 }],
+ 100,
+ ],
+ [
+ 'a max of 1000 maps to 1000',
+ [{ ts: localMs(2026, 1, 13, 9, 0), kind: 'ok', bytes: 1000 }],
+ 1000,
+ ],
])('axisMax %s', (_label, items, axisMax) => {
const timeline = buildBackupActivityTimeline(7, items, itemMs, classify, {
now: NOW,
@@ -306,12 +327,22 @@ describe('proxmoxBackupActivityPresentation', () => {
it('omits the percentage when a single kind is requested', () => {
const rows = getBackupActivityTooltipRows(point({ total: 5, ok: 5 }), ['ok']);
expect(rows).toEqual([
- { kind: 'ok', label: 'OK', count: 5, value: '5', segmentClassName: 'bg-emerald-500', muted: false },
+ {
+ kind: 'ok',
+ label: 'OK',
+ count: 5,
+ value: '5',
+ segmentClassName: 'bg-emerald-500',
+ muted: false,
+ },
]);
});
it('appends rounded percentages when multiple kinds are requested', () => {
- const rows = getBackupActivityTooltipRows(point({ total: 10, ok: 6, failed: 4 }), ['ok', 'failed']);
+ const rows = getBackupActivityTooltipRows(point({ total: 10, ok: 6, failed: 4 }), [
+ 'ok',
+ 'failed',
+ ]);
expect(rows.map((row) => [row.value, row.muted])).toEqual([
['6 (60%)', false],
['4 (40%)', false],
@@ -331,16 +362,20 @@ describe('proxmoxBackupActivityPresentation', () => {
});
it('clamps negative totals and counts to zero', () => {
- const rows = getBackupActivityTooltipRows(
- point({ total: -5, ok: -3, failed: -2 }),
- ['ok', 'failed'],
- );
+ const rows = getBackupActivityTooltipRows(point({ total: -5, ok: -3, failed: -2 }), [
+ 'ok',
+ 'failed',
+ ]);
expect(rows.map((row) => row.value)).toEqual(['0', '0']);
expect(rows.every((row) => row.count === 0 && row.muted)).toBe(true);
});
it('reads missing count keys as zero', () => {
- const partial = { key: '2026-02-13', total: 2, counts: { ok: 2 } } as unknown as BackupActivityPoint;
+ const partial = {
+ key: '2026-02-13',
+ total: 2,
+ counts: { ok: 2 },
+ } as unknown as BackupActivityPoint;
const rows = getBackupActivityTooltipRows(partial, ['ok', 'failed']);
expect(rows[1].count).toBe(0);
expect(rows[1].muted).toBe(true);
@@ -361,7 +396,11 @@ describe('proxmoxBackupActivityPresentation', () => {
});
it('formats a single volume-mode row without a percentage', () => {
- const rows = getBackupActivityTooltipRows(point({ total: 1073741824, ok: 1073741824 }), ['ok'], 'volume');
+ const rows = getBackupActivityTooltipRows(
+ point({ total: 1073741824, ok: 1073741824 }),
+ ['ok'],
+ 'volume',
+ );
expect(rows[0].value).toBe('1.00 GB');
});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.coverage.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.coverage.test.ts
index 41c7f645f3..68f9c83054 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.coverage.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.coverage.test.ts
@@ -223,45 +223,57 @@ describe('workloadFallbackLabel coverage (via fallback workloads)', () => {
describe('resourceVmid coverage (via buildCandidateFromResource)', () => {
it('prefers proxmox meta vmid over platformData', () => {
- const model = emptyModel([], [
- workload({
- id: 'vm-300',
- proxmox: { vmid: 300, node: 'node-a' },
- platformData: { proxmox: { vmid: 999 } },
- }),
- ]);
+ const model = emptyModel(
+ [],
+ [
+ workload({
+ id: 'vm-300',
+ proxmox: { vmid: 300, node: 'node-a' },
+ platformData: { proxmox: { vmid: 999 } },
+ }),
+ ],
+ );
expect(model.coverageRows[0].workload.vmid).toBe('300');
});
it('reads a numeric vmid from platformData.proxmox when meta vmid is absent', () => {
- const model = emptyModel([], [
- workload({
- id: 'vm-500',
- proxmox: { node: 'node-a' },
- platformData: { proxmox: { vmid: 500 } },
- }),
- ]);
+ const model = emptyModel(
+ [],
+ [
+ workload({
+ id: 'vm-500',
+ proxmox: { node: 'node-a' },
+ platformData: { proxmox: { vmid: 500 } },
+ }),
+ ],
+ );
expect(model.coverageRows[0].workload.vmid).toBe('500');
});
it('reads a string vmid from platformData.proxmox when meta vmid is absent', () => {
- const model = emptyModel([], [
- workload({
- id: 'vm-600',
- proxmox: { node: 'node-a' },
- platformData: { proxmox: { vmid: '600' } },
- }),
- ]);
+ const model = emptyModel(
+ [],
+ [
+ workload({
+ id: 'vm-600',
+ proxmox: { node: 'node-a' },
+ platformData: { proxmox: { vmid: '600' } },
+ }),
+ ],
+ );
expect(model.coverageRows[0].workload.vmid).toBe('600');
});
it('produces no candidate when neither meta nor platformData provides a vmid', () => {
- const model = emptyModel([], [
- workload({
- id: 'vm-noid',
- proxmox: { node: 'node-a' },
- }),
- ]);
+ const model = emptyModel(
+ [],
+ [
+ workload({
+ id: 'vm-noid',
+ proxmox: { node: 'node-a' },
+ }),
+ ],
+ );
expect(model.coverageRows).toHaveLength(0);
});
});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableModel.branchcov2.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableModel.branchcov2.test.ts
index b45bff74d6..187bf716a0 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableModel.branchcov2.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableModel.branchcov2.test.ts
@@ -212,9 +212,7 @@ describe('pbsRepositoryLabel — uncovered branches', () => {
it('treats a whitespace-only namespace as root', () => {
// `namespace?.trim()` -> '' (falsy) -> '(root)'.
- expect(pbsRepositoryLabel(pbs({ datastore: 'main', namespace: ' ' }))).toBe(
- 'main / (root)',
- );
+ expect(pbsRepositoryLabel(pbs({ datastore: 'main', namespace: ' ' }))).toBe('main / (root)');
});
it('trims surrounding whitespace from a named namespace', () => {
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.ts
index 2d8f9548ca..e3e709ad7b 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxPageModel.branchcov2.test.ts
@@ -1,5 +1,11 @@
import { describe, expect, it } from 'vitest';
-import type { PlatformType, Resource, ResourceAlert, ResourceMetric, ResourceType } from '@/types/resource';
+import type {
+ PlatformType,
+ Resource,
+ ResourceAlert,
+ ResourceMetric,
+ ResourceType,
+} from '@/types/resource';
import {
buildProxmoxPageModel,
@@ -609,8 +615,18 @@ describe('buildProxmoxPageModel estate classification, status counts, and alert
});
const guests = [
- makeResource({ id: 'vm-r', type: 'vm', status: 'running', proxmox: { vmid: 1, nodeName: 'node-a' } }),
- makeResource({ id: 'vm-o', type: 'vm', status: 'online', proxmox: { vmid: 2, nodeName: 'node-a' } }),
+ makeResource({
+ id: 'vm-r',
+ type: 'vm',
+ status: 'running',
+ proxmox: { vmid: 1, nodeName: 'node-a' },
+ }),
+ makeResource({
+ id: 'vm-o',
+ type: 'vm',
+ status: 'online',
+ proxmox: { vmid: 2, nodeName: 'node-a' },
+ }),
makeResource({
id: 'vm-d',
type: 'vm',
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts b/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
index 8524177ad5..a7bde2a46e 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
@@ -18,12 +18,7 @@ export const BACKUP_ACTIVITY_RANGE_DAYS = [
export type BackupActivityMetricMode = 'count' | 'volume';
export type BackupActivitySegmentKind =
- | 'archive'
- | 'pbs'
- | 'ok'
- | 'failed'
- | 'running'
- | 'snapshot';
+ 'archive' | 'pbs' | 'ok' | 'failed' | 'running' | 'snapshot';
interface BackupActivitySegmentPresentation {
label: string;
diff --git a/frontend-modern/src/features/proxmox/proxmoxHostTableModel.ts b/frontend-modern/src/features/proxmox/proxmoxHostTableModel.ts
index 1af1445857..ab9fcf46f8 100644
--- a/frontend-modern/src/features/proxmox/proxmoxHostTableModel.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxHostTableModel.ts
@@ -5,16 +5,7 @@ import type { PlatformTableColumnKind } from '@/features/platformPage/columnAlig
import { getPlatformTableWeightedColumnWidthStyle } from '@/features/platformPage/sharedPlatformPage';
export type ProxmoxHostTableColumnId =
- | 'node'
- | 'version'
- | 'uptime'
- | 'cpu'
- | 'memory'
- | 'disk'
- | 'temp'
- | 'vms'
- | 'cts'
- | 'cluster';
+ 'node' | 'version' | 'uptime' | 'cpu' | 'memory' | 'disk' | 'temp' | 'vms' | 'cts' | 'cluster';
export type ProxmoxHostTableColumn = {
id: ProxmoxHostTableColumnId;
diff --git a/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage.test.ts b/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage.test.ts
index fb62e7b979..baac00806e 100644
--- a/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage.test.ts
+++ b/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage.test.ts
@@ -30,13 +30,16 @@ const resource = (overrides: Partial<Resource>): Resource =>
const rowsFor = (
sections: readonly AgentMachineTemperatureDetailSection[],
heading: string,
-): AgentMachineTemperatureDetailRow[] => sections.find((entry) => entry.heading === heading)?.rows ?? [];
+): AgentMachineTemperatureDetailRow[] =>
+ sections.find((entry) => entry.heading === heading)?.rows ?? [];
describe('agentMachineTableModel coverage', () => {
describe('getAgentMachineMemoryPercent', () => {
it('derives the percentage from total/used and ignores the current fallback', () => {
expect(
- getAgentMachineMemoryPercent(resource({ memory: { current: 99, total: 16_000, used: 4_000 } })),
+ getAgentMachineMemoryPercent(
+ resource({ memory: { current: 99, total: 16_000, used: 4_000 } }),
+ ),
).toBe(25);
});
@@ -68,9 +71,7 @@ describe('agentMachineTableModel coverage', () => {
});
it('falls back to agent.memory.usage only when memory.current is absent', () => {
- expect(
- getAgentMachineMemoryPercent(resource({ agent: { memory: { usage: 42 } } })),
- ).toBe(42);
+ expect(getAgentMachineMemoryPercent(resource({ agent: { memory: { usage: 42 } } }))).toBe(42);
});
it('returns undefined when no memory source is available', () => {
@@ -232,7 +233,9 @@ describe('agentMachineTableModel coverage', () => {
it('does not cap sections with six or fewer rows', () => {
const sections = getAgentMachineTemperatureDetailSections(
resource({
- agent: { sensors: { temperatureCelsius: { s1: 10, s2: 20, s3: 30, s4: 40, s5: 50, s6: 60 } } },
+ agent: {
+ sensors: { temperatureCelsius: { s1: 10, s2: 20, s3: 30, s4: 40, s5: 50, s6: 60 } },
+ },
}),
);
const rows = rowsFor(sections, 'Temperatures');
diff --git a/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage2.test.ts b/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage2.test.ts
index 67275fbe1c..3cf0943bc9 100644
--- a/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage2.test.ts
+++ b/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.coverage2.test.ts
@@ -155,8 +155,7 @@ describe('agentMachineTableModel coverage2', () => {
});
it('sorts by agent label descending and keeps empty labels at the bottom', () => {
- const getAgent = (m: Resource): string =>
- m.id === 'x' ? '6.0' : m.id === 'y' ? '5.0' : '';
+ const getAgent = (m: Resource): string => (m.id === 'x' ? '6.0' : m.id === 'y' ? '5.0' : '');
const sorted = sortAgentMachines(
[resource({ id: 'y' }), resource({ id: 'z' }), resource({ id: 'x' })],
'agent',
@@ -335,13 +334,17 @@ describe('agentMachineTableModel coverage2', () => {
it('returns read only when write is absent', () => {
expect(
- getAgentMachineDiskIOTotal(resource({ diskIO: { readRate: 500 } as unknown as ResourceDiskIO })),
+ getAgentMachineDiskIOTotal(
+ resource({ diskIO: { readRate: 500 } as unknown as ResourceDiskIO }),
+ ),
).toBe(500);
});
it('returns write only when read is absent', () => {
expect(
- getAgentMachineDiskIOTotal(resource({ diskIO: { writeRate: 300 } as unknown as ResourceDiskIO })),
+ getAgentMachineDiskIOTotal(
+ resource({ diskIO: { writeRate: 300 } as unknown as ResourceDiskIO }),
+ ),
).toBe(300);
});
@@ -354,7 +357,9 @@ describe('agentMachineTableModel coverage2', () => {
it('prefers agent disk percentages over machine-level disk metrics', () => {
const machine = resource({
disk: { total: 1000, used: 900, current: 90 },
- agent: { disks: [{ device: '/dev/sda1', mountpoint: '/', type: 'ext4', total: 1000, used: 500 }] },
+ agent: {
+ disks: [{ device: '/dev/sda1', mountpoint: '/', type: 'ext4', total: 1000, used: 500 }],
+ },
});
expect(getAgentMachineDiskPercent(machine)).toBe(50);
});
@@ -362,7 +367,9 @@ describe('agentMachineTableModel coverage2', () => {
it('returns zero rather than falling back when agent disks exist but are all empty', () => {
const machine = resource({
disk: { total: 1000, used: 900, current: 90 },
- agent: { disks: [{ device: '/dev/sda1', mountpoint: '/', type: 'ext4', total: 0, used: 0 }] },
+ agent: {
+ disks: [{ device: '/dev/sda1', mountpoint: '/', type: 'ext4', total: 0, used: 0 }],
+ },
});
expect(getAgentMachineDiskPercent(machine)).toBe(0);
});
@@ -604,7 +611,12 @@ describe('agentMachineTableModel coverage2', () => {
agent: {
sensors: {
smart: [
- { device: '/dev/sda', model: 'Samsung', serial: 'SN123', standby: true } as unknown as HostDiskSMART,
+ {
+ device: '/dev/sda',
+ model: 'Samsung',
+ serial: 'SN123',
+ standby: true,
+ } as unknown as HostDiskSMART,
],
},
},
diff --git a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts
index dc91d629ac..d39708adc7 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts
@@ -1,6 +1,10 @@
import { describe, expect, it } from 'vitest';
import type { CephCluster } from '@/types/api';
-import type { NormalizedHealth, StorageCategory, StorageRecord } from '@/features/storageBackups/models';
+import type {
+ NormalizedHealth,
+ StorageCategory,
+ StorageRecord,
+} from '@/features/storageBackups/models';
import {
consolidateCephClusterPoolRecords,
getCephClusterKeyFromStorageRecord,
@@ -97,18 +101,14 @@ describe('isCephClusterPoolStorageRecord branch coverage', () => {
it('returns true when type is "ceph" and details.node === "cluster"', () => {
expect(
- isCephClusterPoolStorageRecord(
- makeRecord({ details: { type: 'ceph', node: 'cluster' } }),
- ),
+ isCephClusterPoolStorageRecord(makeRecord({ details: { type: 'ceph', node: 'cluster' } })),
).toBe(true);
});
it('returns false when type is "ceph" but details.node is not "cluster"', () => {
// Exercises the `details.node === 'cluster'` false arm with a valid ceph type.
expect(
- isCephClusterPoolStorageRecord(
- makeRecord({ details: { type: 'ceph', node: 'pve1' } }),
- ),
+ isCephClusterPoolStorageRecord(makeRecord({ details: { type: 'ceph', node: 'pve1' } })),
).toBe(false);
});
@@ -117,9 +117,7 @@ describe('isCephClusterPoolStorageRecord branch coverage', () => {
// is undefined → not 'cluster' → false. The type-only path proves the
// `|| {}` branch is taken (no throw, undefined.node coerced via {}).
expect(
- isCephClusterPoolStorageRecord(
- makeRecord({ details: { type: 'ceph' } }) as StorageRecord,
- ),
+ isCephClusterPoolStorageRecord(makeRecord({ details: { type: 'ceph' } }) as StorageRecord),
).toBe(false);
});
});
@@ -526,40 +524,34 @@ describe('getCephSummaryText branch coverage', () => {
// ---- Cluster arm: OSDs omitted when numOsds/numOsdsUp not finite --------
it('omits the OSDs part when numOsds is NaN', () => {
expect(
- getCephSummaryText(
- makeRecord(),
- makeCluster({ numOsds: NaN, numOsdsUp: 6, numPGs: 0 }),
- ),
+ getCephSummaryText(makeRecord(), makeCluster({ numOsds: NaN, numOsdsUp: 6, numPGs: 0 })),
).toBe('400 B / 1000 B (40%)');
});
it('omits the OSDs part when numOsdsUp is NaN even if numOsds is finite', () => {
expect(
- getCephSummaryText(
- makeRecord(),
- makeCluster({ numOsds: 6, numOsdsUp: NaN, numPGs: 0 }),
- ),
+ getCephSummaryText(makeRecord(), makeCluster({ numOsds: 6, numOsdsUp: NaN, numPGs: 0 })),
).toBe('400 B / 1000 B (40%)');
});
// ---- Cluster arm: PGs omitted when numPGs is 0 or not finite ------------
it('keeps OSDs but omits PGs when numPGs is 0', () => {
- expect(
- getCephSummaryText(makeRecord(), makeCluster({ numPGs: 0 })),
- ).toBe('400 B / 1000 B (40%) • OSDs 6/6');
+ expect(getCephSummaryText(makeRecord(), makeCluster({ numPGs: 0 }))).toBe(
+ '400 B / 1000 B (40%) • OSDs 6/6',
+ );
});
it('omits PGs when numPGs is NaN (Number.isFinite false)', () => {
- expect(
- getCephSummaryText(makeRecord(), makeCluster({ numPGs: NaN })),
- ).toBe('400 B / 1000 B (40%) • OSDs 6/6');
+ expect(getCephSummaryText(makeRecord(), makeCluster({ numPGs: NaN }))).toBe(
+ '400 B / 1000 B (40%) • OSDs 6/6',
+ );
});
// ---- Cluster arm: large numPGs is rendered via toLocaleString ----------
it('renders a large numPGs count with toLocaleString grouping', () => {
- expect(
- getCephSummaryText(makeRecord(), makeCluster({ numPGs: 1_500 })),
- ).toBe('400 B / 1000 B (40%) • OSDs 6/6 • PGs 1,500');
+ expect(getCephSummaryText(makeRecord(), makeCluster({ numPGs: 1_500 }))).toBe(
+ '400 B / 1000 B (40%) • OSDs 6/6 • PGs 1,500',
+ );
});
// ---- Cluster `|| 0` clamps: negative bytes treated as 0 ----------------
@@ -585,7 +577,9 @@ describe('getCephSummaryText branch coverage', () => {
// Number.isFinite(NaN) is false → the whole cluster arm is skipped.
expect(
getCephSummaryText(
- makeRecord({ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 } }),
+ makeRecord({
+ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 },
+ }),
makeCluster({ totalBytes: NaN }),
),
).toBe('400 B / 1000 B (40%)');
@@ -595,7 +589,9 @@ describe('getCephSummaryText branch coverage', () => {
it('formats the record capacity summary when cluster is null', () => {
expect(
getCephSummaryText(
- makeRecord({ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 } }),
+ makeRecord({
+ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 },
+ }),
null,
),
).toBe('400 B / 1000 B (40%)');
diff --git a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts
index e7f31cb376..e4c531f50e 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts
@@ -97,18 +97,14 @@ describe('isCephClusterPoolStorageRecord branch coverage', () => {
it('returns true when type is "ceph" and details.node === "cluster"', () => {
expect(
- isCephClusterPoolStorageRecord(
- makeRecord({ details: { type: 'ceph', node: 'cluster' } }),
- ),
+ isCephClusterPoolStorageRecord(makeRecord({ details: { type: 'ceph', node: 'cluster' } })),
).toBe(true);
});
it('returns false when type is "ceph" but details.node is not "cluster"', () => {
// Exercises the `details.node === 'cluster'` false arm with a valid ceph type.
expect(
- isCephClusterPoolStorageRecord(
- makeRecord({ details: { type: 'ceph', node: 'pve1' } }),
- ),
+ isCephClusterPoolStorageRecord(makeRecord({ details: { type: 'ceph', node: 'pve1' } })),
).toBe(false);
});
@@ -117,9 +113,7 @@ describe('isCephClusterPoolStorageRecord branch coverage', () => {
// is undefined → not 'cluster' → false. The type-only path proves the
// `|| {}` branch is taken (no throw, undefined.node coerced via {}).
expect(
- isCephClusterPoolStorageRecord(
- makeRecord({ details: { type: 'ceph' } }) as StorageRecord,
- ),
+ isCephClusterPoolStorageRecord(makeRecord({ details: { type: 'ceph' } }) as StorageRecord),
).toBe(false);
});
});
@@ -526,40 +520,34 @@ describe('getCephSummaryText branch coverage', () => {
// ---- Cluster arm: OSDs omitted when numOsds/numOsdsUp not finite --------
it('omits the OSDs part when numOsds is NaN', () => {
expect(
- getCephSummaryText(
- makeRecord(),
- makeCluster({ numOsds: NaN, numOsdsUp: 6, numPGs: 0 }),
- ),
+ getCephSummaryText(makeRecord(), makeCluster({ numOsds: NaN, numOsdsUp: 6, numPGs: 0 })),
).toBe('400 B / 1000 B (40%)');
});
it('omits the OSDs part when numOsdsUp is NaN even if numOsds is finite', () => {
expect(
- getCephSummaryText(
- makeRecord(),
- makeCluster({ numOsds: 6, numOsdsUp: NaN, numPGs: 0 }),
- ),
+ getCephSummaryText(makeRecord(), makeCluster({ numOsds: 6, numOsdsUp: NaN, numPGs: 0 })),
).toBe('400 B / 1000 B (40%)');
});
// ---- Cluster arm: PGs omitted when numPGs is 0 or not finite ------------
it('keeps OSDs but omits PGs when numPGs is 0', () => {
- expect(
- getCephSummaryText(makeRecord(), makeCluster({ numPGs: 0 })),
- ).toBe('400 B / 1000 B (40%) • OSDs 6/6');
+ expect(getCephSummaryText(makeRecord(), makeCluster({ numPGs: 0 }))).toBe(
+ '400 B / 1000 B (40%) • OSDs 6/6',
+ );
});
it('omits PGs when numPGs is NaN (Number.isFinite false)', () => {
- expect(
- getCephSummaryText(makeRecord(), makeCluster({ numPGs: NaN })),
- ).toBe('400 B / 1000 B (40%) • OSDs 6/6');
+ expect(getCephSummaryText(makeRecord(), makeCluster({ numPGs: NaN }))).toBe(
+ '400 B / 1000 B (40%) • OSDs 6/6',
+ );
});
// ---- Cluster arm: large numPGs is rendered via toLocaleString ----------
it('renders a large numPGs count with toLocaleString grouping', () => {
- expect(
- getCephSummaryText(makeRecord(), makeCluster({ numPGs: 1_500 })),
- ).toBe('400 B / 1000 B (40%) • OSDs 6/6 • PGs 1,500');
+ expect(getCephSummaryText(makeRecord(), makeCluster({ numPGs: 1_500 }))).toBe(
+ '400 B / 1000 B (40%) • OSDs 6/6 • PGs 1,500',
+ );
});
// ---- Cluster `|| 0` clamps: negative bytes treated as 0 ----------------
@@ -585,7 +573,9 @@ describe('getCephSummaryText branch coverage', () => {
// Number.isFinite(NaN) is false → the whole cluster arm is skipped.
expect(
getCephSummaryText(
- makeRecord({ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 } }),
+ makeRecord({
+ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 },
+ }),
makeCluster({ totalBytes: NaN }),
),
).toBe('400 B / 1000 B (40%)');
@@ -595,7 +585,9 @@ describe('getCephSummaryText branch coverage', () => {
it('formats the record capacity summary when cluster is null', () => {
expect(
getCephSummaryText(
- makeRecord({ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 } }),
+ makeRecord({
+ capacity: { totalBytes: 1_000, usedBytes: 400, freeBytes: 600, usagePercent: 40 },
+ }),
null,
),
).toBe('400 B / 1000 B (40%)');
diff --git a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts
index e916593f59..079b679c69 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts
@@ -79,7 +79,14 @@ describe('cephRecordPresentation', () => {
makeRecord(),
makeCluster({
pools: [
- { id: 1, name: 'rbd', storedBytes: 75, availableBytes: 25, objects: 1, percentUsed: 75 },
+ {
+ id: 1,
+ name: 'rbd',
+ storedBytes: 75,
+ availableBytes: 25,
+ objects: 1,
+ percentUsed: 75,
+ },
],
}),
),
diff --git a/frontend-modern/src/features/storageBackups/__tests__/cephSummaryPresentation.branchcov.test.ts b/frontend-modern/src/features/storageBackups/__tests__/cephSummaryPresentation.branchcov.test.ts
index 1d39a922a2..bba74a61c0 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/cephSummaryPresentation.branchcov.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/cephSummaryPresentation.branchcov.test.ts
@@ -148,9 +148,7 @@ describe('buildExplicitCephClusters branch coverage', () => {
});
it('defaults everything when platformData is missing entirely', () => {
- const [cluster] = buildExplicitCephClusters([
- makeResource({ platformData: undefined }),
- ]);
+ const [cluster] = buildExplicitCephClusters([makeResource({ platformData: undefined })]);
// platformData || {} -> cephMeta {} -> all ceph fields default.
expect(cluster.health).toBe('HEALTH_UNKNOWN');
expect(cluster.healthMessage).toBe('');
@@ -201,9 +199,7 @@ describe('buildExplicitCephClusters branch coverage', () => {
});
it('defaults all disk metrics to 0 when resource.disk is absent', () => {
- const [cluster] = buildExplicitCephClusters([
- makeResource({ disk: undefined }),
- ]);
+ const [cluster] = buildExplicitCephClusters([makeResource({ disk: undefined })]);
expect(cluster.totalBytes).toBe(0);
expect(cluster.usedBytes).toBe(0);
expect(cluster.availableBytes).toBe(0);
@@ -248,9 +244,7 @@ describe('buildExplicitCephClusters branch coverage', () => {
});
it('uses lastSeen verbatim when it is a positive finite number', () => {
- const [cluster] = buildExplicitCephClusters([
- makeResource({ lastSeen: 9_999_999 }),
- ]);
+ const [cluster] = buildExplicitCephClusters([makeResource({ lastSeen: 9_999_999 })]);
expect(cluster.lastUpdated).toBe(9_999_999);
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
index 5d4a1fb9f8..8edf3ca711 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
@@ -69,28 +69,31 @@ describe('diskDetailPresentation', () => {
);
expect(
- getDiskDetailAttributeCards({
- node: 'tower',
- instance: 'cluster-main',
- devPath: '/dev/nvme0n1',
- model: 'NVMe',
- serial: 'SERIAL-2',
- wwn: '',
- size: 1,
- health: 'PASSED',
- wearout: -1,
- type: 'nvme',
- temperature: 55,
- rpm: 0,
- used: '',
- riskReasons: [],
- smartAttributes: {
- percentageUsed: 12,
- availableSpare: 97,
- mediaErrors: 0,
- unsafeShutdowns: 4,
+ getDiskDetailAttributeCards(
+ {
+ node: 'tower',
+ instance: 'cluster-main',
+ devPath: '/dev/nvme0n1',
+ model: 'NVMe',
+ serial: 'SERIAL-2',
+ wwn: '',
+ size: 1,
+ health: 'PASSED',
+ wearout: -1,
+ type: 'nvme',
+ temperature: 55,
+ rpm: 0,
+ used: '',
+ riskReasons: [],
+ smartAttributes: {
+ percentageUsed: 12,
+ availableSpare: 97,
+ mediaErrors: 0,
+ unsafeShutdowns: 4,
+ },
},
- }, { warning: 65, critical: 70 }),
+ { warning: 65, critical: 70 },
+ ),
).toEqual(
expect.arrayContaining([
{ label: 'Temperature', value: '55°C', ok: true },
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov.test.ts
index 731b2021d1..4b7a278ee4 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov.test.ts
@@ -311,27 +311,27 @@ describe('matchesPhysicalDiskFilterState branch coverage', () => {
});
it('returns false when roleFilter does not match', () => {
- expect(
- matchesPhysicalDiskFilterState(baseResource, baseDisk, { roleFilter: 'parity' }),
- ).toBe(false);
+ expect(matchesPhysicalDiskFilterState(baseResource, baseDisk, { roleFilter: 'parity' })).toBe(
+ false,
+ );
});
it('returns true when roleFilter matches', () => {
- expect(
- matchesPhysicalDiskFilterState(baseResource, baseDisk, { roleFilter: 'cache' }),
- ).toBe(true);
+ expect(matchesPhysicalDiskFilterState(baseResource, baseDisk, { roleFilter: 'cache' })).toBe(
+ true,
+ );
});
it('returns false when groupFilter does not match', () => {
- expect(
- matchesPhysicalDiskFilterState(baseResource, baseDisk, { groupFilter: 'mirror' }),
- ).toBe(false);
+ expect(matchesPhysicalDiskFilterState(baseResource, baseDisk, { groupFilter: 'mirror' })).toBe(
+ false,
+ );
});
it('returns true when groupFilter matches', () => {
- expect(
- matchesPhysicalDiskFilterState(baseResource, baseDisk, { groupFilter: 'tank' }),
- ).toBe(true);
+ expect(matchesPhysicalDiskFilterState(baseResource, baseDisk, { groupFilter: 'tank' })).toBe(
+ true,
+ );
});
it('returns false when search term does not match any haystack field', () => {
@@ -414,9 +414,9 @@ describe('getPhysicalDiskHostLabel branch coverage', () => {
});
it('trims whitespace from the resolved host label', () => {
- expect(
- getPhysicalDiskHostLabel(makeDiskData({ node: ' tower ' }), {} as Resource),
- ).toBe('tower');
+ expect(getPhysicalDiskHostLabel(makeDiskData({ node: ' tower ' }), {} as Resource)).toBe(
+ 'tower',
+ );
});
});
@@ -481,9 +481,9 @@ describe('hasPhysicalDiskSmartWarning branch coverage', () => {
});
it('returns true when mediaErrors > 0', () => {
- expect(
- hasPhysicalDiskSmartWarning(makeDiskData({ smartAttributes: { mediaErrors: 3 } })),
- ).toBe(true);
+ expect(hasPhysicalDiskSmartWarning(makeDiskData({ smartAttributes: { mediaErrors: 3 } }))).toBe(
+ true,
+ );
});
it('returns false when all warning counters are zero', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov0712b.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov0712b.test.ts
index 118509f838..34007257af 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.branchcov0712b.test.ts
@@ -263,21 +263,17 @@ describe('matchesPhysicalDiskHealthFilter (branchcov2)', () => {
expect(matchesPhysicalDiskHealthFilter('critical', 'all')).toBe(true);
});
- it.each([
- ['warning'],
- ['critical'],
- ['offline'],
- ] as const)('returns true for "attention" when health is %s', (health) => {
- expect(matchesPhysicalDiskHealthFilter(health, 'attention')).toBe(true);
- });
-
- it.each(['healthy', 'unknown'])(
- 'returns false for "attention" when health is %s',
+ it.each([['warning'], ['critical'], ['offline']] as const)(
+ 'returns true for "attention" when health is %s',
(health) => {
- expect(matchesPhysicalDiskHealthFilter(health as 'healthy', 'attention')).toBe(false);
+ expect(matchesPhysicalDiskHealthFilter(health, 'attention')).toBe(true);
},
);
+ it.each(['healthy', 'unknown'])('returns false for "attention" when health is %s', (health) => {
+ expect(matchesPhysicalDiskHealthFilter(health as 'healthy', 'attention')).toBe(false);
+ });
+
it('returns true on an exact health/filter match', () => {
expect(matchesPhysicalDiskHealthFilter('warning', 'warning')).toBe(true);
expect(matchesPhysicalDiskHealthFilter('critical', 'critical')).toBe(true);
@@ -295,7 +291,7 @@ describe('matchesPhysicalDiskHealthFilter (branchcov2)', () => {
describe('getPhysicalDiskHealthSummary (branchcov2)', () => {
const statusWith = (summary?: string): DiskHealthStatusPresentation =>
- ({ label: 'X', summary, tone: 't' } as unknown as DiskHealthStatusPresentation);
+ ({ label: 'X', summary, tone: 't' }) as unknown as DiskHealthStatusPresentation;
it('returns empty string when summary is undefined (optional-chain arm)', () => {
expect(getPhysicalDiskHealthSummary(statusWith(undefined))).toBe('');
@@ -306,9 +302,7 @@ describe('getPhysicalDiskHealthSummary (branchcov2)', () => {
});
it('returns empty string when summary equals the canonical "no issues" message', () => {
- expect(
- getPhysicalDiskHealthSummary(statusWith('No active disk-health issues.')),
- ).toBe('');
+ expect(getPhysicalDiskHealthSummary(statusWith('No active disk-health issues.'))).toBe('');
});
it('returns the trimmed summary for a real, non-canonical message', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.coverage.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.coverage.test.ts
index c195db66bc..94ac627f59 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.coverage.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.coverage.test.ts
@@ -37,32 +37,24 @@ function makeDiskData(
describe('normalizePhysicalDiskState via isUnraidPhysicalDisk', () => {
it('lowercases and trims storageGroup before comparing to "unraid-array"', () => {
- expect(
- isUnraidPhysicalDisk(makeDiskData({ storageGroup: ' UNRAID-Array ' })),
- ).toBe(true);
+ expect(isUnraidPhysicalDisk(makeDiskData({ storageGroup: ' UNRAID-Array ' }))).toBe(true);
});
it('lowercases and trims storageRole on the role+state path', () => {
expect(
- isUnraidPhysicalDisk(
- makeDiskData({ storageRole: ' Cache ', storageState: ' spinning ' }),
- ),
+ isUnraidPhysicalDisk(makeDiskData({ storageRole: ' Cache ', storageState: ' spinning ' })),
).toBe(true);
});
it('returns false on the role path when storageState is whitespace-only', () => {
- expect(
- isUnraidPhysicalDisk(
- makeDiskData({ storageRole: 'data', storageState: ' ' }),
- ),
- ).toBe(false);
+ expect(isUnraidPhysicalDisk(makeDiskData({ storageRole: 'data', storageState: ' ' }))).toBe(
+ false,
+ );
});
it('returns false when neither storageGroup nor role+state match', () => {
expect(
- isUnraidPhysicalDisk(
- makeDiskData({ storageRole: 'hot-spare', storageState: 'active' }),
- ),
+ isUnraidPhysicalDisk(makeDiskData({ storageRole: 'hot-spare', storageState: 'active' })),
).toBe(false);
});
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/recordPresentation.branchcov0718.test.ts b/frontend-modern/src/features/storageBackups/__tests__/recordPresentation.branchcov0718.test.ts
index 9a1e6bb9c1..9980a6ceaf 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/recordPresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/recordPresentation.branchcov0718.test.ts
@@ -60,10 +60,7 @@ describe('getStorageRecordNodeHints branch coverage', () => {
parentName: { deep: true },
},
});
- expect(getStorageRecordNodeHints(record)).toEqual([
- 'truenas01',
- 'truenas01/pool/tank',
- ]);
+ expect(getStorageRecordNodeHints(record)).toEqual(['truenas01', 'truenas01/pool/tank']);
});
it('returns an empty array when every candidate hint trims to empty', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.branchcov2.test.ts b/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.branchcov2.test.ts
index 1c6a2c6bdf..ed1c3360f0 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.branchcov2.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.branchcov2.test.ts
@@ -34,10 +34,9 @@ const FALLBACK_PLATFORM_STORAGE = { type: 'fallback-marker' } as const;
// sentinel in platformData.storage lets us detect when normalizeStorageMeta
// returned null (fallthrough) vs. returned the normalized direct meta.
const normalizeOf = (input: unknown): ResourceStorageMeta | undefined =>
- readResourceStorageMeta(
- { ...makeResource(), storage: input } as unknown as Resource,
- { storage: FALLBACK_PLATFORM_STORAGE },
- );
+ readResourceStorageMeta({ ...makeResource(), storage: input } as unknown as Resource, {
+ storage: FALLBACK_PLATFORM_STORAGE,
+ });
// ===========================================================================
// normalizeStorageMeta (module-private — exercised via readResourceStorageMeta)
@@ -63,10 +62,9 @@ describe('normalizeStorageMeta (via readResourceStorageMeta)', () => {
// resolves to `null || undefined` → undefined (the `nestedMeta || undefined`
// arm of readResourceStorageMeta, exercised through normalizeStorageMeta).
expect(
- readResourceStorageMeta(
- { ...makeResource(), storage: null } as unknown as Resource,
- { storage: 'not-an-object-either' },
- ),
+ readResourceStorageMeta({ ...makeResource(), storage: null } as unknown as Resource, {
+ storage: 'not-an-object-either',
+ }),
).toBeUndefined();
});
@@ -257,9 +255,9 @@ describe('isCanonicalDatastoreStorageResource', () => {
// storageMeta.platform path
expect(isCanonicalDatastoreStorageResource('vmfs', { platform: 'vmware-vsphere' })).toBe(true);
// value.length === 0 → false even with vmware platform
- expect(
- isCanonicalDatastoreStorageResource('', undefined, { platform: 'vmware-vsphere' }),
- ).toBe(false);
+ expect(isCanonicalDatastoreStorageResource('', undefined, { platform: 'vmware-vsphere' })).toBe(
+ false,
+ );
expect(isCanonicalDatastoreStorageResource('', { platform: 'vmware-vsphere' })).toBe(false);
});
@@ -274,9 +272,9 @@ describe('isCanonicalDatastoreStorageResource', () => {
),
).toBe(false);
// context.platform undefined → fallback to storageMeta.platform.
- expect(
- isCanonicalDatastoreStorageResource('vmfs', { platform: 'vmware-vsphere' }, {}),
- ).toBe(true);
+ expect(isCanonicalDatastoreStorageResource('vmfs', { platform: 'vmware-vsphere' }, {})).toBe(
+ true,
+ );
});
// ---- Branch: fall-through → false ------------------------------------
@@ -303,7 +301,9 @@ describe('getStorageCategoryFromType', () => {
// value.includes('pbs')
expect(getStorageCategoryFromType('pbs')).toBe('backup-repository');
// context.resourceType === 'pbs'
- expect(getStorageCategoryFromType('mystery', { resourceType: 'pbs' })).toBe('backup-repository');
+ expect(getStorageCategoryFromType('mystery', { resourceType: 'pbs' })).toBe(
+ 'backup-repository',
+ );
// context.platform includes 'pbs'
expect(getStorageCategoryFromType('mystery', { platform: 'proxmox-pbs' })).toBe(
'backup-repository',
@@ -375,13 +375,9 @@ describe('getStorageCapabilitiesForResource', () => {
'namespaces',
]);
// Same caps via context signal rather than the type substring.
- expect(getStorageCapabilitiesForResource('mystery', undefined, { resourceType: 'pbs' })).toEqual([
- 'capacity',
- 'health',
- 'backup-repository',
- 'deduplication',
- 'namespaces',
- ]);
+ expect(
+ getStorageCapabilitiesForResource('mystery', undefined, { resourceType: 'pbs' }),
+ ).toEqual(['capacity', 'health', 'backup-repository', 'deduplication', 'namespaces']);
});
// ---- Branch: `storageMeta?.isZfs || value.includes('zfs')` ------------
diff --git a/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.test.ts b/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.test.ts
index b424d94402..5c6476ab88 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/resourceStorageMapping.test.ts
@@ -38,7 +38,9 @@ describe('resourceStorageMapping', () => {
},
});
- expect(readResourceStorageMeta(resource, resource.platformData as Record<string, unknown>)).toEqual({
+ expect(
+ readResourceStorageMeta(resource, resource.platformData as Record<string, unknown>),
+ ).toEqual({
type: 'rbd',
platform: 'proxmox-pve',
topology: 'pool',
@@ -51,13 +53,9 @@ describe('resourceStorageMapping', () => {
});
it('resolves canonical storage content from direct, contentTypes, or platform fallback', () => {
- expect(
- resolveResourceStorageContent(
- { content: 'backup' },
- { content: 'ignored' },
- '',
- ),
- ).toBe('backup');
+ expect(resolveResourceStorageContent({ content: 'backup' }, { content: 'ignored' }, '')).toBe(
+ 'backup',
+ );
expect(
resolveResourceStorageContent(
{ contentTypes: ['images', 'rootdir'] },
diff --git a/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.coverage.test.ts b/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.coverage.test.ts
index c10570d0b3..adb3d87884 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.coverage.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/resourceStoragePresentation.coverage.test.ts
@@ -90,9 +90,7 @@ describe('collectRiskReasons (via getResourceStorageIssueLabel on Unraid resourc
pbs: {
storageRisk: {
level: 'warning',
- reasons: [
- { code: 'unraid_disabled_disks', severity: 'warning', summary: 'pbs-disk' },
- ],
+ reasons: [{ code: 'unraid_disabled_disks', severity: 'warning', summary: 'pbs-disk' }],
},
},
});
@@ -176,7 +174,10 @@ describe('findRiskReason (exercised via hasUnraidStorageAttentionIssue)', () =>
arrayState: 'STARTED',
risk: {
level: 'warning',
- reasons: [{ code: '', summary: 'x' }, { summary: 'y' }] as unknown as ResourceStorageRiskReason[],
+ reasons: [
+ { code: '', summary: 'x' },
+ { summary: 'y' },
+ ] as unknown as ResourceStorageRiskReason[],
},
},
} as unknown as Resource;
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageAdapterCore.branchcov.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageAdapterCore.branchcov.test.ts
index a35779afa3..1a50fb3fae 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageAdapterCore.branchcov.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageAdapterCore.branchcov.test.ts
@@ -35,37 +35,26 @@ describe('normalizeHealthValue via normalizeStorageResourceHealth', () => {
expect(normalizeStorageResourceHealth(' ', undefined, ' ')).toBe('unknown');
});
- it.each([
- 'online',
- 'running',
- 'available',
- 'healthy',
- 'ok',
- 'optimal',
- ])('maps exact healthy keyword %s to "healthy"', (status) => {
- expect(normalizeStorageResourceHealth(status, undefined)).toBe('healthy');
- });
+ it.each(['online', 'running', 'available', 'healthy', 'ok', 'optimal'])(
+ 'maps exact healthy keyword %s to "healthy"',
+ (status) => {
+ expect(normalizeStorageResourceHealth(status, undefined)).toBe('healthy');
+ },
+ );
- it.each([
- 'warning',
- 'warn',
- 'degraded',
- 'health_warn',
- ])('maps exact warning keyword %s to "warning"', (status) => {
- expect(normalizeStorageResourceHealth(status, undefined)).toBe('warning');
- });
+ it.each(['warning', 'warn', 'degraded', 'health_warn'])(
+ 'maps exact warning keyword %s to "warning"',
+ (status) => {
+ expect(normalizeStorageResourceHealth(status, undefined)).toBe('warning');
+ },
+ );
- it.each([
- 'critical',
- 'faulted',
- 'failed',
- 'error',
- 'unhealthy',
- 'health_crit',
- 'health_err',
- ])('maps exact critical keyword %s to "critical"', (status) => {
- expect(normalizeStorageResourceHealth(status, undefined)).toBe('critical');
- });
+ it.each(['critical', 'faulted', 'failed', 'error', 'unhealthy', 'health_crit', 'health_err'])(
+ 'maps exact critical keyword %s to "critical"',
+ (status) => {
+ expect(normalizeStorageResourceHealth(status, undefined)).toBe('critical');
+ },
+ );
it.each(['offline', 'stopped', 'down', 'unavailable'])(
'maps exact offline keyword %s to "offline"',
@@ -127,12 +116,12 @@ describe('extractHealthTag via normalizeStorageResourceHealth', () => {
});
it('uses the LAST health: tag when several are present', () => {
- expect(
- normalizeStorageResourceHealth('online', ['health:ok', 'health:critical']),
- ).toBe('critical');
- expect(
- normalizeStorageResourceHealth('offline', ['health:critical', 'health:healthy']),
- ).toBe('healthy');
+ expect(normalizeStorageResourceHealth('online', ['health:ok', 'health:critical'])).toBe(
+ 'critical',
+ );
+ expect(normalizeStorageResourceHealth('offline', ['health:critical', 'health:healthy'])).toBe(
+ 'healthy',
+ );
});
it('matches the health: prefix case-insensitively after trimming each tag', () => {
@@ -143,9 +132,9 @@ describe('extractHealthTag via normalizeStorageResourceHealth', () => {
describe('normalizeStorageResourceHealth priority chain', () => {
it('prefers incidentSeverity over health tag over status', () => {
// incidentSeverity beats a health tag and the status
- expect(
- normalizeStorageResourceHealth('online', ['health:warning'], 'critical'),
- ).toBe('critical');
+ expect(normalizeStorageResourceHealth('online', ['health:warning'], 'critical')).toBe(
+ 'critical',
+ );
// health tag beats status
expect(normalizeStorageResourceHealth('online', ['health:critical'])).toBe('critical');
});
@@ -243,9 +232,7 @@ describe('canonicalStorageIdentityKey', () => {
it('uses "unknown-location" when both location.label and refs.platformEntityId are blank', () => {
expect(
- canonicalStorageIdentityKey(
- makeRecord({ location: { label: '', scope: 'node' }, refs: {} }),
- ),
+ canonicalStorageIdentityKey(makeRecord({ location: { label: '', scope: 'node' }, refs: {} })),
).toBe('proxmox-pve|unknown-location|tank|pool');
// refs absent entirely as well
expect(
@@ -262,9 +249,9 @@ describe('canonicalStorageIdentityKey', () => {
});
it('uses "unknown-name" when both name and id are blank', () => {
- expect(
- canonicalStorageIdentityKey(makeRecord({ name: '', id: '' })),
- ).toBe('proxmox-pve|pve1|unknown-name|pool');
+ expect(canonicalStorageIdentityKey(makeRecord({ name: '', id: '' }))).toBe(
+ 'proxmox-pve|pve1|unknown-name|pool',
+ );
});
it('defaults a missing category to "other"', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageAdapters.branchcov.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageAdapters.branchcov.test.ts
index 093fd53b6b..3a7ff0249b 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageAdapters.branchcov.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageAdapters.branchcov.test.ts
@@ -300,7 +300,10 @@ describe('storageAdapters.branchcov - mapResourceStorageRecord (via resource ada
});
it('classifies a plain proxmox storage resource with node scope', () => {
- const resource = makeResource({ id: 'node-scope', platformData: { type: 'dir', node: 'pve1' } });
+ const resource = makeResource({
+ id: 'node-scope',
+ platformData: { type: 'dir', node: 'pve1' },
+ });
const records = resourceAdapter.build(ctx([resource]));
expect(records[0].location.scope).toBe('node');
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageCapacityDeltaPresentation.branchcov0712b.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageCapacityDeltaPresentation.branchcov0712b.test.ts
index d45dc23bd8..a04e3ae0be 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageCapacityDeltaPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageCapacityDeltaPresentation.branchcov0712b.test.ts
@@ -151,20 +151,18 @@ describe('computeStorageCapacityDeltaAnalysis branch coverage — delta sign and
});
it('clamps a sub-byte positive delta (abs < 1) to exactly 0', () => {
- expect(
- computeStorageCapacityDeltaAnalysis([point(1_000, 100.0), point(2_000, 100.4)]),
- ).toEqual({
- deltaBytes: 0, // raw delta 0.4 -> clamped
- durationMs: 1_000,
- startTimestamp: 1_000,
- endTimestamp: 2_000,
- });
+ expect(computeStorageCapacityDeltaAnalysis([point(1_000, 100.0), point(2_000, 100.4)])).toEqual(
+ {
+ deltaBytes: 0, // raw delta 0.4 -> clamped
+ durationMs: 1_000,
+ startTimestamp: 1_000,
+ endTimestamp: 2_000,
+ },
+ );
});
it('clamps a sub-byte negative delta (abs < 1) to exactly 0', () => {
- expect(
- computeStorageCapacityDeltaAnalysis([point(1_000, 100.0), point(2_000, 99.6)]),
- ).toEqual({
+ expect(computeStorageCapacityDeltaAnalysis([point(1_000, 100.0), point(2_000, 99.6)])).toEqual({
deltaBytes: 0, // raw delta -0.4 -> abs < 1 -> clamped
durationMs: 1_000,
startTimestamp: 1_000,
@@ -179,9 +177,7 @@ describe('computeStorageCapacityDeltaAnalysis branch coverage — delta sign and
describe('computeStorageCapacityDeltaAnalysis branch coverage — finite/duration guard', () => {
it('returns null when start and end timestamps are equal (durationMs === 0, <= 0 arm)', () => {
- expect(
- computeStorageCapacityDeltaAnalysis([point(1_000, 100), point(1_000, 200)]),
- ).toBeNull();
+ expect(computeStorageCapacityDeltaAnalysis([point(1_000, 100), point(1_000, 200)])).toBeNull();
});
it('returns null when end timestamp precedes start after sorting only equal timestamps collapse (durationMs 0)', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageMetricsIdentity.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageMetricsIdentity.test.ts
index 7f7238d1f7..b7949fba30 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageMetricsIdentity.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageMetricsIdentity.test.ts
@@ -80,9 +80,7 @@ describe('resolveStorageRecordMetricResourceId', () => {
makeRecord({ id: 'storage-1', refs: { resourceId: ' ' } }),
),
).toBe('storage-1');
- expect(resolveStorageRecordMetricResourceId(makeRecord({ id: 'storage-1' }))).toBe(
- 'storage-1',
- );
+ expect(resolveStorageRecordMetricResourceId(makeRecord({ id: 'storage-1' }))).toBe('storage-1');
});
it('trims whitespace from the selected field at every precedence level', () => {
@@ -98,9 +96,9 @@ describe('resolveStorageRecordMetricResourceId', () => {
makeRecord({ refs: { resourceId: ' trimmed-refs ' } }),
),
).toBe('trimmed-refs');
- expect(
- resolveStorageRecordMetricResourceId(makeRecord({ id: ' trimmed-id ' })),
- ).toBe('trimmed-id');
+ expect(resolveStorageRecordMetricResourceId(makeRecord({ id: ' trimmed-id ' }))).toBe(
+ 'trimmed-id',
+ );
});
it('returns an empty string when id is empty and no higher-precedence field is set', () => {
@@ -183,9 +181,7 @@ describe('resolvePhysicalDiskMetricResourceId', () => {
it('returns serial from disk.physicalDisk.serial', () => {
expect(
- resolvePhysicalDiskMetricResourceId(
- makeResource({ physicalDisk: { serial: 'SERIAL-1' } }),
- ),
+ resolvePhysicalDiskMetricResourceId(makeResource({ physicalDisk: { serial: 'SERIAL-1' } })),
).toBe('SERIAL-1');
});
@@ -220,9 +216,7 @@ describe('resolvePhysicalDiskMetricResourceId', () => {
it('falls through to wwn when no serial is available', () => {
expect(
- resolvePhysicalDiskMetricResourceId(
- makeResource({ physicalDisk: { wwn: 'WWN-1' } }),
- ),
+ resolvePhysicalDiskMetricResourceId(makeResource({ physicalDisk: { wwn: 'WWN-1' } })),
).toBe('WWN-1');
});
@@ -256,9 +250,7 @@ describe('resolvePhysicalDiskMetricResourceId', () => {
});
it('falls back to id when serial, wwn, and metricsTarget are all absent', () => {
- expect(resolvePhysicalDiskMetricResourceId(makeResource({ id: 'disk-1' }))).toBe(
- 'disk-1',
- );
+ expect(resolvePhysicalDiskMetricResourceId(makeResource({ id: 'disk-1' }))).toBe('disk-1');
});
it('falls back to id when serial and wwn are whitespace-only', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts
index a67236bda8..f5a5f649ca 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts
@@ -277,10 +277,7 @@ describe('sortStorageRecords branch coverage', () => {
it('sorts by name through the default else arm', () => {
const a = makeRecord({ id: 'a', name: 'Zeta' });
const b = makeRecord({ id: 'b', name: 'Alpha' });
- expect(sortStorageRecords([a, b], 'name', 'asc').map((r) => r.name)).toEqual([
- 'Alpha',
- 'Zeta',
- ]);
+ expect(sortStorageRecords([a, b], 'name', 'asc').map((r) => r.name)).toEqual(['Alpha', 'Zeta']);
expect(sortStorageRecords([a, b], 'name', 'desc').map((r) => r.name)).toEqual([
'Zeta',
'Alpha',
@@ -391,9 +388,10 @@ describe('sortStorageRecords branch coverage', () => {
['v', growthEntry(50)],
]),
};
- expect(
- sortStorageRecords([nullDelta, val], 'growth', 'asc', ctx).map((r) => r.id),
- ).toEqual(['v', 'nd']);
+ expect(sortStorageRecords([nullDelta, val], 'growth', 'asc', ctx).map((r) => r.id)).toEqual([
+ 'v',
+ 'nd',
+ ]);
});
it('returns a new sorted array and does not mutate the input ([...records] copy)', () => {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.branchcov.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.branchcov.test.ts
index 4d662bb933..4c1627996f 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.branchcov.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.branchcov.test.ts
@@ -43,7 +43,9 @@ const rowValue = (rows: { label: string; value: string }[], label: string): stri
describe('buildStoragePoolDetailConfigRows branch coverage', () => {
it('splices a Content row at index 3 (before Status) when details.content is present', () => {
- const rows = buildStoragePoolDetailConfigRows(buildRecord({ details: { content: 'Media share' } }));
+ const rows = buildStoragePoolDetailConfigRows(
+ buildRecord({ details: { content: 'Media share' } }),
+ );
expect(rows[3]).toEqual({ label: 'Content', value: 'Media share' });
expect(rows[4]).toEqual({ label: 'Status', value: 'available' });
});
@@ -54,18 +56,28 @@ describe('buildStoragePoolDetailConfigRows branch coverage', () => {
});
it('renders Shared as "Yes" / "No" from a boolean details.shared and "-" when absent', () => {
- expect(rowValue(buildStoragePoolDetailConfigRows(buildRecord({ details: { shared: true } })), 'Shared')).toBe(
- 'Yes',
- );
- expect(rowValue(buildStoragePoolDetailConfigRows(buildRecord({ details: { shared: false } })), 'Shared')).toBe(
- 'No',
+ expect(
+ rowValue(
+ buildStoragePoolDetailConfigRows(buildRecord({ details: { shared: true } })),
+ 'Shared',
+ ),
+ ).toBe('Yes');
+ expect(
+ rowValue(
+ buildStoragePoolDetailConfigRows(buildRecord({ details: { shared: false } })),
+ 'Shared',
+ ),
+ ).toBe('No');
+ expect(rowValue(buildStoragePoolDetailConfigRows(buildRecord({ details: {} })), 'Shared')).toBe(
+ '-',
);
- expect(rowValue(buildStoragePoolDetailConfigRows(buildRecord({ details: {} })), 'Shared')).toBe('-');
});
it('shows "n/a" for Used/Free/Total when totalBytes is null (falsy)', () => {
const rows = buildStoragePoolDetailConfigRows(
- buildRecord({ capacity: { totalBytes: null, usedBytes: null, freeBytes: null, usagePercent: null } }),
+ buildRecord({
+ capacity: { totalBytes: null, usedBytes: null, freeBytes: null, usagePercent: null },
+ }),
);
expect(rowValue(rows, 'Used')).toBe('n/a');
expect(rowValue(rows, 'Free')).toBe('n/a');
@@ -74,7 +86,9 @@ describe('buildStoragePoolDetailConfigRows branch coverage', () => {
it('computes freeBytes from total - used when freeBytes is null and totalBytes > 0', () => {
const rows = buildStoragePoolDetailConfigRows(
- buildRecord({ capacity: { totalBytes: 2048, usedBytes: 1024, freeBytes: null, usagePercent: 50 } }),
+ buildRecord({
+ capacity: { totalBytes: 2048, usedBytes: 1024, freeBytes: null, usagePercent: 50 },
+ }),
);
expect(rowValue(rows, 'Used')).toBe('1.00 KB');
expect(rowValue(rows, 'Free')).toBe('1.00 KB');
@@ -83,7 +97,9 @@ describe('buildStoragePoolDetailConfigRows branch coverage', () => {
it('clamps the computed freeBytes to 0 when used exceeds total', () => {
const rows = buildStoragePoolDetailConfigRows(
- buildRecord({ capacity: { totalBytes: 100, usedBytes: 200, freeBytes: null, usagePercent: 200 } }),
+ buildRecord({
+ capacity: { totalBytes: 100, usedBytes: 200, freeBytes: null, usagePercent: 200 },
+ }),
);
expect(rowValue(rows, 'Free')).toBe('0 B');
});
@@ -161,7 +177,13 @@ describe('buildStoragePoolDetailTopologyRows branch coverage', () => {
it('renders the Sync action without a percentage when syncProgress is 0', () => {
const record = buildRecord({
source: unraidSource(),
- details: { type: 'unraid-array', platform: 'unraid', topology: 'array', syncAction: 'checking', syncProgress: 0 },
+ details: {
+ type: 'unraid-array',
+ platform: 'unraid',
+ topology: 'array',
+ syncAction: 'checking',
+ syncProgress: 0,
+ },
});
expect(rowValue(buildStoragePoolDetailTopologyRows(record, []), 'Sync')).toBe('checking');
});
@@ -177,7 +199,9 @@ describe('buildStoragePoolDetailTopologyRows branch coverage', () => {
syncProgress: 45.6,
},
});
- expect(rowValue(buildStoragePoolDetailTopologyRows(record, []), 'Sync')).toBe('rebuilding (46%)');
+ expect(rowValue(buildStoragePoolDetailTopologyRows(record, []), 'Sync')).toBe(
+ 'rebuilding (46%)',
+ );
});
it.each([
@@ -185,19 +209,22 @@ describe('buildStoragePoolDetailTopologyRows branch coverage', () => {
['NaN', Number.NaN],
['Infinity', Number.POSITIVE_INFINITY],
['-Infinity', Number.NEGATIVE_INFINITY],
- ])('treats non-finite/non-numeric syncProgress (%s) as 0 so no percentage is shown', (_label, progress) => {
- const record = buildRecord({
- source: unraidSource(),
- details: {
- type: 'unraid-array',
- platform: 'unraid',
- topology: 'array',
- syncAction: 'checking',
- syncProgress: progress,
- },
- });
- expect(rowValue(buildStoragePoolDetailTopologyRows(record, []), 'Sync')).toBe('checking');
- });
+ ])(
+ 'treats non-finite/non-numeric syncProgress (%s) as 0 so no percentage is shown',
+ (_label, progress) => {
+ const record = buildRecord({
+ source: unraidSource(),
+ details: {
+ type: 'unraid-array',
+ platform: 'unraid',
+ topology: 'array',
+ syncAction: 'checking',
+ syncProgress: progress,
+ },
+ });
+ expect(rowValue(buildStoragePoolDetailTopologyRows(record, []), 'Sync')).toBe('checking');
+ },
+ );
});
// ---------------------------------------------------------------------------
@@ -237,7 +264,14 @@ describe('buildStoragePoolDetailZfsSummary branch coverage', () => {
it('treats an empty-string scan the same as "none"', () => {
const record = buildRecord({
details: {
- zfsPool: { state: 'DEGRADED', scan: '', readErrors: 0, writeErrors: 0, checksumErrors: 0, devices: [] },
+ zfsPool: {
+ state: 'DEGRADED',
+ scan: '',
+ readErrors: 0,
+ writeErrors: 0,
+ checksumErrors: 0,
+ devices: [],
+ },
},
});
expect(buildStoragePoolDetailZfsSummary(record)).toEqual({
@@ -353,20 +387,53 @@ describe('getStoragePoolLinkedDisks branch coverage', () => {
it('breaks role ties by devPath localeCompare', () => {
const record = buildRecord({ id: 'pool-1' });
const disks = [
- { id: 'b', name: 'b', parentId: 'pool-1', physicalDisk: { devPath: '/dev/sdd', storageRole: 'data' } },
- { id: 'a', name: 'a', parentId: 'pool-1', physicalDisk: { devPath: '/dev/sdc', storageRole: 'data' } },
+ {
+ id: 'b',
+ name: 'b',
+ parentId: 'pool-1',
+ physicalDisk: { devPath: '/dev/sdd', storageRole: 'data' },
+ },
+ {
+ id: 'a',
+ name: 'a',
+ parentId: 'pool-1',
+ physicalDisk: { devPath: '/dev/sdc', storageRole: 'data' },
+ },
] as unknown as Resource[];
- expect(getStoragePoolLinkedDisks(record, disks).map((d) => d.devPath)).toEqual(['/dev/sdc', '/dev/sdd']);
+ expect(getStoragePoolLinkedDisks(record, disks).map((d) => d.devPath)).toEqual([
+ '/dev/sdc',
+ '/dev/sdd',
+ ]);
});
it('ranks roles parity(0) < data(1) < cache(2) < unknown(3)', () => {
const record = buildRecord({ id: 'pool-1' });
const disks = [
- { id: 'u', name: 'u', parentId: 'pool-1', physicalDisk: { devPath: '/dev/sdz', storageRole: 'spare' } },
- { id: 'c', name: 'c', parentId: 'pool-1', physicalDisk: { devPath: '/dev/sdy', storageRole: 'cache' } },
- { id: 'p', name: 'p', parentId: 'pool-1', physicalDisk: { devPath: '/dev/sdv', storageRole: 'parity' } },
- { id: 'd', name: 'd', parentId: 'pool-1', physicalDisk: { devPath: '/dev/sdx', storageRole: 'data' } },
+ {
+ id: 'u',
+ name: 'u',
+ parentId: 'pool-1',
+ physicalDisk: { devPath: '/dev/sdz', storageRole: 'spare' },
+ },
+ {
+ id: 'c',
+ name: 'c',
+ parentId: 'pool-1',
+ physicalDisk: { devPath: '/dev/sdy', storageRole: 'cache' },
+ },
+ {
+ id: 'p',
+ name: 'p',
+ parentId: 'pool-1',
+ physicalDisk: { devPath: '/dev/sdv', storageRole: 'parity' },
+ },
+ {
+ id: 'd',
+ name: 'd',
+ parentId: 'pool-1',
+ physicalDisk: { devPath: '/dev/sdx', storageRole: 'data' },
+ },
] as unknown as Resource[];
expect(getStoragePoolLinkedDisks(record, disks).map((d) => d.role)).toEqual([
@@ -385,8 +452,16 @@ describe('getStoragePoolLinkedDisks branch coverage', () => {
details: { type: 'unraid-cache-pool', platform: 'unraid' },
});
const disks = [
- { id: 'in', name: 'in', physicalDisk: { devPath: '/dev/sda', storageRole: 'cache', storageGroup: 'My Cache' } },
- { id: 'out', name: 'out', physicalDisk: { devPath: '/dev/sdb', storageRole: 'cache', storageGroup: 'other' } },
+ {
+ id: 'in',
+ name: 'in',
+ physicalDisk: { devPath: '/dev/sda', storageRole: 'cache', storageGroup: 'My Cache' },
+ },
+ {
+ id: 'out',
+ name: 'out',
+ physicalDisk: { devPath: '/dev/sdb', storageRole: 'cache', storageGroup: 'other' },
+ },
] as unknown as Resource[];
expect(getStoragePoolLinkedDisks(record, disks).map((d) => d.id)).toEqual(['in']);
@@ -400,8 +475,16 @@ describe('getStoragePoolLinkedDisks branch coverage', () => {
details: { type: 'pool', platform: 'unraid', topology: 'array' },
});
const disks = [
- { id: 'in', name: 'in', physicalDisk: { devPath: '/dev/sda', storageRole: 'data', storageGroup: 'unraid-array' } },
- { id: 'out', name: 'out', physicalDisk: { devPath: '/dev/sdb', storageRole: 'data', storageGroup: 'nope' } },
+ {
+ id: 'in',
+ name: 'in',
+ physicalDisk: { devPath: '/dev/sda', storageRole: 'data', storageGroup: 'unraid-array' },
+ },
+ {
+ id: 'out',
+ name: 'out',
+ physicalDisk: { devPath: '/dev/sdb', storageRole: 'data', storageGroup: 'nope' },
+ },
] as unknown as Resource[];
expect(getStoragePoolLinkedDisks(record, disks).map((d) => d.id)).toEqual(['in']);
@@ -415,7 +498,11 @@ describe('getStoragePoolLinkedDisks branch coverage', () => {
details: { type: 'pool', platform: 'unraid', topology: '' },
});
const disks = [
- { id: 'x', name: 'x', physicalDisk: { devPath: '/dev/sda', storageRole: 'data', storageGroup: 'unraid-array' } },
+ {
+ id: 'x',
+ name: 'x',
+ physicalDisk: { devPath: '/dev/sda', storageRole: 'data', storageGroup: 'unraid-array' },
+ },
] as unknown as Resource[];
expect(getStoragePoolLinkedDisks(record, disks)).toEqual([]);
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.branchcov0713.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.branchcov0713.test.ts
index e8174719b1..1f8edace56 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.branchcov0713.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.branchcov0713.test.ts
@@ -13,9 +13,7 @@ import {
// getStorageRowAlertPresentation.
// ---------------------------------------------------------------------------
-const makeAlertState = (
- overrides: Partial<StorageAlertRowState> = {},
-): StorageAlertRowState => ({
+const makeAlertState = (overrides: Partial<StorageAlertRowState> = {}): StorageAlertRowState => ({
hasAlert: false,
alertCount: 0,
severity: null,
@@ -179,9 +177,7 @@ describe('getStorageRowAlertPresentation branch coverage', () => {
// ---- No arm of the if/else-if chain (all flags false) --------------------
// Only BASE_ROW_CLASSES remain; every data attr is the neutral default.
it('returns only the base classes when no alert, highlight or expand flags are set', () => {
- const result: StorageRowAlertPresentation = getStorageRowAlertPresentation(
- makeOptions(),
- );
+ const result: StorageRowAlertPresentation = getStorageRowAlertPresentation(makeOptions());
expect(result.rowClass).toBe(BASE_ROW_CLASS);
expect(result.dataAlertState).toBe('none');
@@ -192,9 +188,7 @@ describe('getStorageRowAlertPresentation branch coverage', () => {
// ---- L45 isExpanded true arm ---------------------------------------------
it('appends the expanded bg-surface-alt class when isExpanded is true', () => {
- const result = getStorageRowAlertPresentation(
- makeOptions({ isExpanded: true }),
- );
+ const result = getStorageRowAlertPresentation(makeOptions({ isExpanded: true }));
// Base classes are still present and the expanded class is appended.
expect(result.rowClass).toContain('transition-all duration-200');
@@ -322,9 +316,7 @@ describe('getStorageRowAlertPresentation branch coverage', () => {
// ---- L57 isResourceHighlighted false -> 'false' (explicit boundary) ------
it('reports dataResourceHighlighted as false when isResourceHighlighted is false', () => {
- const result = getStorageRowAlertPresentation(
- makeOptions({ isResourceHighlighted: false }),
- );
+ const result = getStorageRowAlertPresentation(makeOptions({ isResourceHighlighted: false }));
expect(result.dataResourceHighlighted).toBe('false');
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts
index 25a548545d..f9a1e6246e 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts
@@ -1,7 +1,5 @@
import { describe, expect, it } from 'vitest';
-import {
- getStorageRowAlertPresentation,
-} from '@/features/storageBackups/storageRowAlertPresentation';
+import { getStorageRowAlertPresentation } from '@/features/storageBackups/storageRowAlertPresentation';
describe('storageRowAlertPresentation', () => {
it('returns unacknowledged critical row styling canonically', () => {
diff --git a/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts b/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts
index 70ff10fc3e..dbd72ab2a9 100644
--- a/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts
@@ -87,8 +87,7 @@ export const consolidateCephClusterPoolRecords = (records: StorageRecord[]): Sto
...record,
health: pool.health,
statusLabel: poolStatus,
- issueSummary:
- pool.issueSummary?.trim() || `Ceph reports pool ${pool.name} ${poolStatus}`,
+ issueSummary: pool.issueSummary?.trim() || `Ceph reports pool ${pool.name} ${poolStatus}`,
details: { ...(record.details || {}), status: poolStatus },
};
});
@@ -100,10 +99,7 @@ export const getCephClusterKeyFromStorageRecord = (record: StorageRecord): strin
return record.refs?.platformEntityId || parent || record.location.label || record.source.platform;
};
-export const getCephSummaryText = (
- record: StorageRecord,
- cluster: CephCluster | null,
-): string => {
+export const getCephSummaryText = (record: StorageRecord, cluster: CephCluster | null): string => {
if (cluster && Number.isFinite(cluster.totalBytes)) {
const total = Math.max(0, cluster.totalBytes || 0);
const used = Math.max(0, cluster.usedBytes || 0);
@@ -141,7 +137,5 @@ export const getCephPoolsText = (record: StorageRecord, cluster: CephCluster | n
return `${record.name}: ${formatPercent(percent)}`;
};
-export const collectCephClusterNodes = (
- nodes: Set<string>,
- record: StorageRecord,
-): Set<string> => new Set([...nodes, getStorageRecordNodeLabel(record)]);
+export const collectCephClusterNodes = (nodes: Set<string>, record: StorageRecord): Set<string> =>
+ new Set([...nodes, getStorageRecordNodeLabel(record)]);
diff --git a/frontend-modern/src/features/storageBackups/cephSummaryPresentation.ts b/frontend-modern/src/features/storageBackups/cephSummaryPresentation.ts
index dde5b2f77d..2f9df42e75 100644
--- a/frontend-modern/src/features/storageBackups/cephSummaryPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/cephSummaryPresentation.ts
@@ -57,9 +57,7 @@ export const buildExplicitCephClusters = (resources: Resource[]): CephCluster[]
});
};
-export const deriveCephClustersFromStorageRecords = (
- records: StorageRecord[],
-): CephCluster[] => {
+export const deriveCephClustersFromStorageRecords = (records: StorageRecord[]): CephCluster[] => {
const summaryByKey = new Map<
string,
{ total: number; used: number; available: number; records: number; nodes: Set<string> }
@@ -131,9 +129,7 @@ export const summarizeCephClusters = (clusters: CephCluster[]): CephSummaryStats
};
};
-export const buildCephClusterLookup = (
- clusters: CephCluster[],
-): Record<string, CephCluster> => {
+export const buildCephClusterLookup = (clusters: CephCluster[]): Record<string, CephCluster> => {
const map: Record<string, CephCluster> = {};
clusters.forEach((cluster) => {
[cluster.instance, cluster.id, cluster.name].forEach((key) => {
diff --git a/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts b/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
index 6e2282e755..7e8ddcf01d 100644
--- a/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
@@ -49,7 +49,8 @@ export type DiskDetailLiveChartConfig = {
};
export type DiskDetailHistoryChartConfig = {
- metric: 'smart_temp' | 'smart_reallocated_sectors' | 'smart_percentage_used' | 'smart_available_spare';
+ metric:
+ 'smart_temp' | 'smart_reallocated_sectors' | 'smart_percentage_used' | 'smart_available_spare';
label: string;
unit: string;
color: string;
diff --git a/frontend-modern/src/features/storageBackups/diskPresentation.ts b/frontend-modern/src/features/storageBackups/diskPresentation.ts
index e23146748d..744d66b3b1 100644
--- a/frontend-modern/src/features/storageBackups/diskPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/diskPresentation.ts
@@ -196,9 +196,7 @@ export function isUnraidPhysicalDisk(disk: PhysicalDiskPresentationData): boolea
);
}
-export function hasUnraidPhysicalDiskFaultSignal(
- disk: PhysicalDiskPresentationData,
-): boolean {
+export function hasUnraidPhysicalDiskFaultSignal(disk: PhysicalDiskPresentationData): boolean {
if (!isUnraidPhysicalDisk(disk)) return false;
if ((disk.errorCount || 0) > 0) return true;
if (UNRAID_PHYSICAL_DISK_FAULT_STATES.has(normalizePhysicalDiskState(disk.storageState))) {
diff --git a/frontend-modern/src/features/storageBackups/storageBarPresentation.ts b/frontend-modern/src/features/storageBackups/storageBarPresentation.ts
index 6c7ae39add..02b7fda274 100644
--- a/frontend-modern/src/features/storageBackups/storageBarPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storageBarPresentation.ts
@@ -24,7 +24,8 @@ export const STORAGE_BAR_LABEL_WRAP_CLASS =
export const STORAGE_BAR_LABEL_TEXT_CLASS =
'max-w-full min-w-0 whitespace-nowrap overflow-hidden text-ellipsis px-0.5 text-center';
export const STORAGE_BAR_TOOLTIP_WRAP_CLASS = 'min-w-[160px]';
-export const STORAGE_BAR_TOOLTIP_TITLE_CLASS = 'font-medium mb-1 text-slate-300 border-b border-border pb-1';
+export const STORAGE_BAR_TOOLTIP_TITLE_CLASS =
+ 'font-medium mb-1 text-slate-300 border-b border-border pb-1';
export const STORAGE_BAR_TOOLTIP_LABEL_CLASS = 'text-slate-400';
export const STORAGE_BAR_TOOLTIP_VALUE_CLASS = 'text-base-content';
export const STORAGE_BAR_ZFS_SECTION_CLASS = 'mt-1 pt-1 border-t border-slate-600';
@@ -61,8 +62,7 @@ export const getStorageBarZfsSummary = (zfsPool?: ZFSPool): StorageBarZfsSummary
if (!zfsPool) return null;
const scan = zfsPool.scan || '';
- const hasErrors =
- zfsPool.readErrors > 0 || zfsPool.writeErrors > 0 || zfsPool.checksumErrors > 0;
+ const hasErrors = zfsPool.readErrors > 0 || zfsPool.writeErrors > 0 || zfsPool.checksumErrors > 0;
return {
hasErrors,
diff --git a/frontend-modern/src/features/storageBackups/storageFilterPresentation.ts b/frontend-modern/src/features/storageBackups/storageFilterPresentation.ts
index ac93c34e7e..3be5ad9135 100644
--- a/frontend-modern/src/features/storageBackups/storageFilterPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storageFilterPresentation.ts
@@ -1,6 +1,5 @@
-export const getNextStorageSortDirection = (
- direction: 'asc' | 'desc',
-): 'asc' | 'desc' => (direction === 'asc' ? 'desc' : 'asc');
+export const getNextStorageSortDirection = (direction: 'asc' | 'desc'): 'asc' | 'desc' =>
+ direction === 'asc' ? 'desc' : 'asc';
export const getStorageSortDirectionTitle = (direction: 'asc' | 'desc'): string =>
`Sort ${direction === 'asc' ? 'descending' : 'ascending'}`;
diff --git a/frontend-modern/src/features/storageBackups/storageMetricsIdentity.ts b/frontend-modern/src/features/storageBackups/storageMetricsIdentity.ts
index 10eef97375..ed442bd07e 100644
--- a/frontend-modern/src/features/storageBackups/storageMetricsIdentity.ts
+++ b/frontend-modern/src/features/storageBackups/storageMetricsIdentity.ts
@@ -21,7 +21,8 @@ export const resolvePhysicalDiskMetricResourceId = (disk: Resource): string => {
return metricsTargetId;
}
- const platformData = ((disk.platformData as DiskPlatformData | undefined) || {}) as DiskPlatformData;
+ const platformData = ((disk.platformData as DiskPlatformData | undefined) ||
+ {}) as DiskPlatformData;
const serial = trim(disk.physicalDisk?.serial || platformData.physicalDisk?.serial);
if (serial) return serial;
diff --git a/frontend-modern/src/features/storageBackups/storageModelCore.ts b/frontend-modern/src/features/storageBackups/storageModelCore.ts
index fa1c19c18e..6550892ae0 100644
--- a/frontend-modern/src/features/storageBackups/storageModelCore.ts
+++ b/frontend-modern/src/features/storageBackups/storageModelCore.ts
@@ -20,21 +20,10 @@ import {
getStorageRecordType,
getStorageRecordUsagePercent,
} from './recordPresentation';
-import {
- getCompactStoragePoolProtectionLabel,
- getStoragePoolStateLabel,
-} from './rowPresentation';
+import { getCompactStoragePoolProtectionLabel, getStoragePoolStateLabel } from './rowPresentation';
export type StorageSortKey =
- | 'priority'
- | 'name'
- | 'state'
- | 'source'
- | 'type'
- | 'host'
- | 'protection'
- | 'usage'
- | 'growth';
+ 'priority' | 'name' | 'state' | 'source' | 'type' | 'host' | 'protection' | 'usage' | 'growth';
export type StorageGroupKey = 'node' | 'type' | 'status' | 'none';
export type StorageSortContext = {
diff --git a/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts b/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts
index 6034a798af..c24b9ca7b7 100644
--- a/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts
@@ -258,8 +258,7 @@ export function buildStoragePoolDetailZfsSummary(
const readPhysicalDisk = (disk: Resource): NonNullable<Resource['physicalDisk']> => {
const platformData = (disk.platformData || {}) as Record<string, unknown>;
const platformDisk = platformData.physicalDisk as
- | NonNullable<Resource['physicalDisk']>
- | undefined;
+ NonNullable<Resource['physicalDisk']> | undefined;
return (disk.physicalDisk || platformDisk || {}) as NonNullable<Resource['physicalDisk']>;
};
diff --git a/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts b/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts
index 1f7f2b654b..3ec31127fd 100644
--- a/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts
@@ -19,8 +19,7 @@ export const getStorageRowAlertPresentation = (options: {
isExpanded: boolean;
isResourceHighlighted: boolean;
}): StorageRowAlertPresentation => {
- const showAlertHighlight =
- options.alertState.hasUnacknowledgedAlert && options.parentNodeOnline;
+ const showAlertHighlight = options.alertState.hasUnacknowledgedAlert && options.parentNodeOnline;
const hasAcknowledgedOnlyAlert =
options.alertState.hasAcknowledgedOnlyAlert && options.parentNodeOnline;
diff --git a/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
index 66458702e4..f98e7bf1c9 100644
--- a/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
@@ -126,14 +126,7 @@ const UpdatePills: Component<{ app: ResourceTrueNASAppMeta | undefined }> = (pro
// Columns a user can sort by. Ports and Images summarize several values at
// once, so they carry no single scalar to order on. Updates orders on how
// many update kinds (app / image) are pending so outdated apps surface first.
-const TRUENAS_APP_SORT_KEYS = [
- 'app',
- 'version',
- 'cpu',
- 'memory',
- 'containers',
- 'updates',
-] as const;
+const TRUENAS_APP_SORT_KEYS = ['app', 'version', 'cpu', 'memory', 'containers', 'updates'] as const;
type TrueNASAppSortKey = (typeof TRUENAS_APP_SORT_KEYS)[number];
@@ -166,7 +159,9 @@ const getTrueNASAppSortValue = (
case 'containers':
return appContainerCount(app);
case 'updates':
- return (app?.upgradeAvailable === true ? 1 : 0) + (app?.imageUpdatesAvailable === true ? 1 : 0);
+ return (
+ (app?.upgradeAvailable === true ? 1 : 0) + (app?.imageUpdatesAvailable === true ? 1 : 0)
+ );
default:
key satisfies never;
return null;
@@ -271,10 +266,18 @@ export const TrueNASAppsTable: Component<{
>
Containers
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[18%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[18%]"
+ >
Ports
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden lg:table-cell md:w-[12%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden lg:table-cell md:w-[12%]"
+ >
Images
</PlatformSortableTableHead>
<PlatformSortableTableHead
diff --git a/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx b/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
index b819b8ba01..e5728f4fde 100644
--- a/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
@@ -209,7 +209,11 @@ export const TrueNASNetworkSharesTable: Component<{
<PlatformSortableTableHead kind="text" sort={sort} class="md:w-[19%]">
Access
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden lg:table-cell md:w-[13%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden lg:table-cell md:w-[13%]"
+ >
Clients
</PlatformSortableTableHead>
<PlatformSortableTableHead
diff --git a/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx b/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
index f8cbe6f7e9..e96039790a 100644
--- a/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
@@ -171,8 +171,9 @@ const getTrueNASServiceSortValue = (
case 'boot':
return row.service.enabled ? 'Enabled' : 'Disabled';
case 'pids': {
- const count = (row.service.pids ?? []).filter((pid) => Number.isFinite(pid) && pid > 0)
- .length;
+ const count = (row.service.pids ?? []).filter(
+ (pid) => Number.isFinite(pid) && pid > 0,
+ ).length;
return count > 0 ? count : null;
}
case 'system':
diff --git a/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx b/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
index 85d5b7e9d9..33e15d763e 100644
--- a/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
@@ -239,7 +239,11 @@ export const TrueNASVirtualMachinesTable: Component<{
>
Boot
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[18%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[18%]"
+ >
Devices
</PlatformSortableTableHead>
<PlatformSortableTableHead kind="text" sort={sort} class="md:w-[19%]">
diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx
index e78e171f6c..f760058a54 100644
--- a/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx
+++ b/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx
@@ -17,9 +17,7 @@ const makeSystem = (overrides: Partial<Resource> = {}): Resource =>
truenas: {
hostname: 'nas-primary',
version: 'TrueNAS-SCALE-24.10.2',
- services: [
- { id: '1', service: 'smb', enabled: true, state: 'RUNNING', pids: [2418, 2420] },
- ],
+ services: [{ id: '1', service: 'smb', enabled: true, state: 'RUNNING', pids: [2418, 2420] }],
},
...overrides,
}) as Resource;
diff --git a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage.test.ts b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage.test.ts
index 936469fce3..fdbc91fde2 100644
--- a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage.test.ts
+++ b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage.test.ts
@@ -265,7 +265,12 @@ describe('truenasPageModel coverage', () => {
const posture = buildTrueNASProtectionPosture([
makeRecoveryPoint({ id: 'ok', kind: 'snapshot', mode: 'snapshot', outcome: 'success' }),
makeRecoveryPoint({ id: 'fail', kind: 'snapshot', mode: 'snapshot', outcome: 'failed' }),
- makeRecoveryPoint({ id: 'mystery', kind: 'snapshot', mode: 'snapshot', outcome: 'pending' }),
+ makeRecoveryPoint({
+ id: 'mystery',
+ kind: 'snapshot',
+ mode: 'snapshot',
+ outcome: 'pending',
+ }),
]);
expect(posture).toEqual({
healthy: 1,
diff --git a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage2.test.ts b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage2.test.ts
index 7954e39f23..5c6bb7a038 100644
--- a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage2.test.ts
+++ b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.coverage2.test.ts
@@ -80,19 +80,27 @@ describe('truenasPageModel coverage2', () => {
it('maps shutoff/shutdown/poweroff vm states to stopped', () => {
expect(
- mapTrueNASVMStatus(makeResource({ id: 'a', type: 'vm', truenas: { vm: { state: 'SHUTOFF' } } })),
+ mapTrueNASVMStatus(
+ makeResource({ id: 'a', type: 'vm', truenas: { vm: { state: 'SHUTOFF' } } }),
+ ),
).toBe('stopped');
expect(
- mapTrueNASVMStatus(makeResource({ id: 'b', type: 'vm', truenas: { vm: { state: 'shutdown' } } })),
+ mapTrueNASVMStatus(
+ makeResource({ id: 'b', type: 'vm', truenas: { vm: { state: 'shutdown' } } }),
+ ),
).toBe('stopped');
expect(
- mapTrueNASVMStatus(makeResource({ id: 'c', type: 'vm', truenas: { vm: { state: 'POWEROFF' } } })),
+ mapTrueNASVMStatus(
+ makeResource({ id: 'c', type: 'vm', truenas: { vm: { state: 'POWEROFF' } } }),
+ ),
).toBe('stopped');
});
it('maps paused/suspended/error/crashed vm states to attention', () => {
expect(
- mapTrueNASVMStatus(makeResource({ id: 'a', type: 'vm', truenas: { vm: { state: 'PAUSED' } } })),
+ mapTrueNASVMStatus(
+ makeResource({ id: 'a', type: 'vm', truenas: { vm: { state: 'PAUSED' } } }),
+ ),
).toBe('attention');
expect(
mapTrueNASVMStatus(
@@ -100,7 +108,9 @@ describe('truenasPageModel coverage2', () => {
),
).toBe('attention');
expect(
- mapTrueNASVMStatus(makeResource({ id: 'c', type: 'vm', truenas: { vm: { state: 'error' } } })),
+ mapTrueNASVMStatus(
+ makeResource({ id: 'c', type: 'vm', truenas: { vm: { state: 'error' } } }),
+ ),
).toBe('attention');
expect(
mapTrueNASVMStatus(
@@ -152,7 +162,11 @@ describe('truenasPageModel coverage2', () => {
).toBe('attention');
expect(
mapTrueNASAppStatus(
- makeResource({ id: 'b', type: 'app-container', truenas: { app: { state: 'deploying' } } }),
+ makeResource({
+ id: 'b',
+ type: 'app-container',
+ truenas: { app: { state: 'deploying' } },
+ }),
),
).toBe('attention');
expect(
@@ -202,48 +216,34 @@ describe('truenasPageModel coverage2', () => {
it('marks offline/stopped resource status as disabled even without share metadata', () => {
expect(
- mapTrueNASShareStatus(
- makeResource({ id: 'a', type: 'network-share', status: 'offline' }),
- ),
+ mapTrueNASShareStatus(makeResource({ id: 'a', type: 'network-share', status: 'offline' })),
).toBe('disabled');
expect(
- mapTrueNASShareStatus(
- makeResource({ id: 'b', type: 'network-share', status: 'stopped' }),
- ),
+ mapTrueNASShareStatus(makeResource({ id: 'b', type: 'network-share', status: 'stopped' })),
).toBe('disabled');
});
it('marks degraded/paused resource status as attention', () => {
expect(
- mapTrueNASShareStatus(
- makeResource({ id: 'a', type: 'network-share', status: 'degraded' }),
- ),
+ mapTrueNASShareStatus(makeResource({ id: 'a', type: 'network-share', status: 'degraded' })),
).toBe('attention');
expect(
- mapTrueNASShareStatus(
- makeResource({ id: 'b', type: 'network-share', status: 'paused' }),
- ),
+ mapTrueNASShareStatus(makeResource({ id: 'b', type: 'network-share', status: 'paused' })),
).toBe('attention');
});
it('marks online/running resource status as active when share.enabled is absent', () => {
expect(
- mapTrueNASShareStatus(
- makeResource({ id: 'a', type: 'network-share', status: 'online' }),
- ),
+ mapTrueNASShareStatus(makeResource({ id: 'a', type: 'network-share', status: 'online' })),
).toBe('active');
expect(
- mapTrueNASShareStatus(
- makeResource({ id: 'b', type: 'network-share', status: 'running' }),
- ),
+ mapTrueNASShareStatus(makeResource({ id: 'b', type: 'network-share', status: 'running' })),
).toBe('active');
});
it('returns attention for an unrecognized status with no share metadata', () => {
expect(
- mapTrueNASShareStatus(
- makeResource({ id: 'a', type: 'network-share', status: 'unknown' }),
- ),
+ mapTrueNASShareStatus(makeResource({ id: 'a', type: 'network-share', status: 'unknown' })),
).toBe('attention');
});
});
@@ -265,11 +265,13 @@ describe('truenasPageModel coverage2', () => {
});
it('maps stop/inactive service states to stopped when enabled is not false', () => {
- expect(mapTrueNASServiceStatus(makeServiceRow({ service: { state: 'STOP', enabled: true } }))).toBe(
- 'stopped',
- );
expect(
- mapTrueNASServiceStatus(makeServiceRow({ service: { state: 'inactive', enabled: undefined } })),
+ mapTrueNASServiceStatus(makeServiceRow({ service: { state: 'STOP', enabled: true } })),
+ ).toBe('stopped');
+ expect(
+ mapTrueNASServiceStatus(
+ makeServiceRow({ service: { state: 'inactive', enabled: undefined } }),
+ ),
).toBe('stopped');
});
@@ -304,7 +306,9 @@ describe('truenasPageModel coverage2', () => {
'paused',
]) {
expect(
- mapTrueNASStorageStatus(makeResource({ id: 's', type: 'pool', status: status as Resource['status'] })),
+ mapTrueNASStorageStatus(
+ makeResource({ id: 's', type: 'pool', status: status as Resource['status'] }),
+ ),
).toBe('attention');
}
});
@@ -319,9 +323,9 @@ describe('truenasPageModel coverage2', () => {
});
it('maps online/running/healthy statuses to healthy', () => {
- expect(mapTrueNASStorageStatus(makeResource({ id: 'a', type: 'pool', status: 'online' }))).toBe(
- 'healthy',
- );
+ expect(
+ mapTrueNASStorageStatus(makeResource({ id: 'a', type: 'pool', status: 'online' })),
+ ).toBe('healthy');
expect(
mapTrueNASStorageStatus(makeResource({ id: 'b', type: 'pool', status: 'running' })),
).toBe('healthy');
@@ -333,9 +337,9 @@ describe('truenasPageModel coverage2', () => {
});
it('returns unknown when no status or zfs/disk signals are present', () => {
- expect(mapTrueNASStorageStatus(makeResource({ id: 'a', type: 'pool', status: 'unknown' }))).toBe(
- 'unknown',
- );
+ expect(
+ mapTrueNASStorageStatus(makeResource({ id: 'a', type: 'pool', status: 'unknown' })),
+ ).toBe('unknown');
});
it('treats healthy zfsPoolState and passed disk health as not attention', () => {
@@ -405,7 +409,12 @@ describe('truenasPageModel coverage2', () => {
status: 'online',
storage: { topology: 'pool', platform: 'truenas' },
});
- const rows = buildTrueNASStorageTopologyRows([healthyPool, unknownPool, offlinePool, attentionPool]);
+ const rows = buildTrueNASStorageTopologyRows([
+ healthyPool,
+ unknownPool,
+ offlinePool,
+ attentionPool,
+ ]);
expect(rows.map((row) => row.id)).toEqual([
'pool:pool-attention',
'pool:pool-offline',
@@ -529,7 +538,9 @@ describe('truenasPageModel coverage2', () => {
type: 'pool',
incidentSeverity: 'warning',
incidentCode: 'truenas_custom',
- incidents: [{ code: ' ', severity: ' ', summary: 'incident summary', source: 'VolumeStatus' }],
+ incidents: [
+ { code: ' ', severity: ' ', summary: 'incident summary', source: 'VolumeStatus' },
+ ],
});
const rows = buildTrueNASIncidentRows([resource]);
expect(rows).toHaveLength(1);
@@ -622,9 +633,7 @@ describe('truenasPageModel coverage2', () => {
const withNative = makeResource({
id: 'a',
type: 'pool',
- incidents: [
- { code: 'truenas_code', severity: 'info', summary: 's', nativeId: 'alert-7' },
- ],
+ incidents: [{ code: 'truenas_code', severity: 'info', summary: 's', nativeId: 'alert-7' }],
});
const row = buildTrueNASIncidentRows([withNative])[0];
expect(row?.id).toBe('a:incident:alert-7:0');
@@ -763,7 +772,14 @@ describe('truenasPageModel coverage2', () => {
const app = baseApp({
truenas: {
app: {
- volumes: [{ source: 'vol-src-token', destination: 'vol-dst-token', mode: 'rw-mode', type: 'bind-vol' }],
+ volumes: [
+ {
+ source: 'vol-src-token',
+ destination: 'vol-dst-token',
+ mode: 'rw-mode',
+ type: 'bind-vol',
+ },
+ ],
},
},
});
@@ -805,9 +821,7 @@ describe('truenasPageModel coverage2', () => {
const app = baseApp({
truenas: {
app: {
- usedPorts: [
- { hostPorts: [{ hostPort: 30456, hostIp: '192.168.1.5' }] },
- ],
+ usedPorts: [{ hostPorts: [{ hostPort: 30456, hostIp: '192.168.1.5' }] }],
},
},
});
@@ -917,7 +931,9 @@ describe('truenasPageModel coverage2', () => {
const rows = buildTrueNASStorageTopologyRows([pool]);
expect(filterTrueNASStorageTopologyRows(rows, 'elevated-risk-token', 'all')).toHaveLength(1);
expect(filterTrueNASStorageTopologyRows(rows, 'risk-summary-token', 'all')).toHaveLength(1);
- expect(filterTrueNASStorageTopologyRows(rows, 'protection-summary-token', 'all')).toHaveLength(1);
+ expect(
+ filterTrueNASStorageTopologyRows(rows, 'protection-summary-token', 'all'),
+ ).toHaveLength(1);
});
it('matches disk devPath/model/serial/wwn/diskType/storageState', () => {
@@ -947,11 +963,15 @@ describe('truenasPageModel coverage2', () => {
id: 'tank',
type: 'pool',
storage: { topology: 'pool', platform: 'truenas' },
- incidents: [{ code: 'incident-code-token', severity: 'warning', summary: 'incident-summary-token' }],
+ incidents: [
+ { code: 'incident-code-token', severity: 'warning', summary: 'incident-summary-token' },
+ ],
});
const rows = buildTrueNASStorageTopologyRows([pool]);
expect(filterTrueNASStorageTopologyRows(rows, 'incident-code-token', 'all')).toHaveLength(1);
- expect(filterTrueNASStorageTopologyRows(rows, 'incident-summary-token', 'all')).toHaveLength(1);
+ expect(filterTrueNASStorageTopologyRows(rows, 'incident-summary-token', 'all')).toHaveLength(
+ 1,
+ );
});
it('matches a row by its kind keyword (pool) even when the resource name does not contain it', () => {
@@ -1298,7 +1318,11 @@ describe('truenasPageModel coverage2', () => {
const vm = makeResource({ id: 'vm', type: 'vm', platformData: impairedSource() });
expect(mapTrueNASVMStatus(vm)).toBe('attention');
- const app = makeResource({ id: 'app', type: 'app-container', platformData: impairedSource() });
+ const app = makeResource({
+ id: 'app',
+ type: 'app-container',
+ platformData: impairedSource(),
+ });
expect(mapTrueNASAppStatus(app)).toBe('attention');
const share = makeResource({
diff --git a/frontend-modern/src/features/vmware/VmwarePageSurface.tsx b/frontend-modern/src/features/vmware/VmwarePageSurface.tsx
index 4d4a64d501..7bf353808e 100644
--- a/frontend-modern/src/features/vmware/VmwarePageSurface.tsx
+++ b/frontend-modern/src/features/vmware/VmwarePageSurface.tsx
@@ -137,11 +137,7 @@ export function VmwarePageSurface() {
return (
<div data-testid="vmware-page" class="space-y-3">
- <PlatformSectionTabs
- tabs={tabs()}
- active={activeTab()}
- ariaLabel="VMware sections"
- />
+ <PlatformSectionTabs tabs={tabs()} active={activeTab()} ariaLabel="VMware sections" />
<Show
when={!loading() || model().resources.length > 0}
diff --git a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
index b8c33d127c..e43107e017 100644
--- a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
@@ -201,12 +201,7 @@ export const VsphereDatastoresTable: Component<{
>
Datastore
</PlatformSortableTableHead>
- <PlatformSortableTableHead
- kind="text"
- sort={sort}
- sortKey="type"
- class="md:w-[9%]"
- >
+ <PlatformSortableTableHead kind="text" sort={sort} sortKey="type" class="md:w-[9%]">
Type
</PlatformSortableTableHead>
<PlatformSortableTableHead
@@ -217,7 +212,11 @@ export const VsphereDatastoresTable: Component<{
>
Capacity
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[14%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[14%]"
+ >
Hosts
</PlatformSortableTableHead>
<PlatformSortableTableHead
@@ -228,7 +227,11 @@ export const VsphereDatastoresTable: Component<{
>
VMs
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden lg:table-cell md:w-[13%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden lg:table-cell md:w-[13%]"
+ >
Consumers
</PlatformSortableTableHead>
<PlatformSortableTableHead
diff --git a/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx b/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx
index 2253d4a4d3..739b99c264 100644
--- a/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereNetworksTable.tsx
@@ -185,7 +185,11 @@ export const VsphereNetworksTable: Component<{
>
Type
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden md:table-cell md:w-[18%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden md:table-cell md:w-[18%]"
+ >
Hosts
</PlatformSortableTableHead>
<PlatformSortableTableHead
@@ -196,7 +200,11 @@ export const VsphereNetworksTable: Component<{
>
VMs
</PlatformSortableTableHead>
- <PlatformSortableTableHead kind="text" sort={sort} class="hidden lg:table-cell md:w-[18%]">
+ <PlatformSortableTableHead
+ kind="text"
+ sort={sort}
+ class="hidden lg:table-cell md:w-[18%]"
+ >
Connected VMs
</PlatformSortableTableHead>
<PlatformSortableTableHead
diff --git a/frontend-modern/src/features/vmware/__tests__/VmwarePageSurface.contract.test.tsx b/frontend-modern/src/features/vmware/__tests__/VmwarePageSurface.contract.test.tsx
index 21f5fd615a..9d37b5577a 100644
--- a/frontend-modern/src/features/vmware/__tests__/VmwarePageSurface.contract.test.tsx
+++ b/frontend-modern/src/features/vmware/__tests__/VmwarePageSurface.contract.test.tsx
@@ -156,9 +156,7 @@ describe('VmwarePageSurface contract', () => {
expect(screen.getByTestId('hosts-table')).toHaveAttribute('data-rows', '1');
const notice = screen.getByTestId('platform-outdated-agent-notice');
expect(notice).toHaveTextContent('app-01 is running an older Pulse agent (v5.1.34).');
- expect(notice).toHaveTextContent(
- 'latest in-guest telemetry and command support on this VM',
- );
+ expect(notice).toHaveTextContent('latest in-guest telemetry and command support on this VM');
expect(screen.getByRole('link', { name: 'Open agent upgrade commands' })).toHaveAttribute(
'href',
'/settings/infrastructure?agentUpdates=1&agents=agent%3Aagent-app-01',
diff --git a/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage.test.ts b/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage.test.ts
index 212986730b..f7573d2c2b 100644
--- a/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage.test.ts
+++ b/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage.test.ts
@@ -36,7 +36,11 @@ describe('vmwarePageModel coverage', () => {
type: 'storage',
name: 'y-ds',
storage: { topology: 'datastore' },
- vmware: { entityType: 'datastore', datastoreAccessible: true, maintenanceMode: 'in_maintenance' },
+ vmware: {
+ entityType: 'datastore',
+ datastoreAccessible: true,
+ maintenanceMode: 'in_maintenance',
+ },
});
const attention = makeResource({
id: 'ds-attention',
@@ -142,11 +146,7 @@ describe('vmwarePageModel coverage', () => {
const { networks } = buildVmwarePageModel([healthy, unknown, attention]);
- expect(networks.map((n) => n.id)).toEqual([
- 'net-attention',
- 'net-unknown',
- 'net-healthy',
- ]);
+ expect(networks.map((n) => n.id)).toEqual(['net-attention', 'net-unknown', 'net-healthy']);
});
it('tie-breaks equal-rank networks by display name', () => {
@@ -197,12 +197,7 @@ describe('vmwarePageModel coverage', () => {
const { vms } = buildVmwarePageModel([byFallback, byRuntime, byParent, both]);
// host-alpha < host-beta < host-zeta < unknown
- expect(vms.map((v) => v.id)).toEqual([
- 'vm-both',
- 'vm-parent',
- 'vm-runtime',
- 'vm-fallback',
- ]);
+ expect(vms.map((v) => v.id)).toEqual(['vm-both', 'vm-parent', 'vm-runtime', 'vm-fallback']);
});
});
@@ -242,13 +237,7 @@ describe('vmwarePageModel coverage', () => {
vmware: { ...host, powerState: 'poweredOn' },
});
- const { vms } = buildVmwarePageModel([
- poweredOn,
- unknown,
- poweredOff,
- suspended,
- attention,
- ]);
+ const { vms } = buildVmwarePageModel([poweredOn, unknown, poweredOff, suspended, attention]);
expect(vms.map((v) => v.id)).toEqual([
'vm-attention',
diff --git a/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage2.test.ts b/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage2.test.ts
index 12be5a666d..d98a268e2d 100644
--- a/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage2.test.ts
+++ b/frontend-modern/src/features/vmware/__tests__/vmwarePageModel.coverage2.test.ts
@@ -363,9 +363,7 @@ describe('hasIncidentSignal (via buildVmwareIncidentRows)', () => {
const res = makeResource({
id: 'res-no-signal',
type: 'agent',
- incidents: [
- { code: '', severity: 'warning', summary: '' },
- ],
+ incidents: [{ code: '', severity: 'warning', summary: '' }],
});
expect(buildVmwareIncidentRows([res])).toEqual([]);
});
@@ -374,9 +372,7 @@ describe('hasIncidentSignal (via buildVmwareIncidentRows)', () => {
const res = makeResource({
id: 'res-code-only',
type: 'agent',
- incidents: [
- { code: 'alarm-x', severity: 'warning', summary: '' },
- ],
+ incidents: [{ code: 'alarm-x', severity: 'warning', summary: '' }],
});
const rows = buildVmwareIncidentRows([res]);
expect(rows).toHaveLength(1);
@@ -387,9 +383,7 @@ describe('hasIncidentSignal (via buildVmwareIncidentRows)', () => {
const res = makeResource({
id: 'res-summary-only',
type: 'agent',
- incidents: [
- { code: '', severity: 'info', summary: 'something happened' },
- ],
+ incidents: [{ code: '', severity: 'info', summary: 'something happened' }],
});
const rows = buildVmwareIncidentRows([res]);
expect(rows).toHaveLength(1);
@@ -572,9 +566,7 @@ describe('buildIncidentRow (via buildVmwareIncidentRows)', () => {
const res = makeResource({
id: 'st-1',
type: 'agent',
- incidents: [
- { code: 'c', severity: 'info', summary: 's', startedAt: '2026-03-01T10:00:00Z' },
- ],
+ incidents: [{ code: 'c', severity: 'info', summary: 's', startedAt: '2026-03-01T10:00:00Z' }],
});
expect(buildVmwareIncidentRows([res])[0].startedAt).toBe('2026-03-01T10:00:00Z');
});
@@ -755,11 +747,7 @@ describe('incidentSeverityRank (via buildVmwareIncidentRows sorting)', () => {
});
const rows = buildVmwareIncidentRows([info, warning, critical]);
- expect(rows.map((r) => r.resourceId)).toEqual([
- 'sort-critical',
- 'sort-warning',
- 'sort-info',
- ]);
+ expect(rows.map((r) => r.resourceId)).toEqual(['sort-critical', 'sort-warning', 'sort-info']);
});
it('tie-breaks same-severity incidents by priority descending', () => {
@@ -1198,9 +1186,7 @@ describe('appendRow / dedup (via buildVmwareActivityRows)', () => {
const res = makeResource({
id: 'rc-res',
type: 'vm',
- recentChanges: [
- makeChange({ id: 'embedded-1', resourceId: 'rc-res', metadata: {} }),
- ],
+ recentChanges: [makeChange({ id: 'embedded-1', resourceId: 'rc-res', metadata: {} })],
});
const rows = buildVmwareActivityRows([res], []);
expect(rows).toHaveLength(1);
@@ -1340,7 +1326,12 @@ describe('vmwareVirtualMachineSearchHaystack (via filterVmwareVirtualMachines)',
it('matches by cluster services (HA/DRS formatted string)', () => {
const vm = makeResource({
...baseVm(),
- vmware: { entityType: 'vm', powerState: 'poweredOn', clusterHaEnabled: true, clusterDrsEnabled: false },
+ vmware: {
+ entityType: 'vm',
+ powerState: 'poweredOn',
+ clusterHaEnabled: true,
+ clusterDrsEnabled: false,
+ },
});
expect(filterVmwareVirtualMachines([vm], 'ha enabled', 'all')).toHaveLength(1);
expect(filterVmwareVirtualMachines([vm], 'drs disabled', 'all')).toHaveLength(1);
@@ -1470,7 +1461,10 @@ describe('filterVmwareActivity (additional branches)', () => {
it('filters to only tasks when status is "tasks"', () => {
const rows = buildTestRows();
- expect(filterVmwareActivity(rows, '', 'tasks').map((r) => r.nativeId)).toEqual(['failed-row', 'task-row']);
+ expect(filterVmwareActivity(rows, '', 'tasks').map((r) => r.nativeId)).toEqual([
+ 'failed-row',
+ 'task-row',
+ ]);
});
it('returns all rows when status is "all" with no search', () => {
diff --git a/frontend-modern/src/hooks/__tests__/createNonSuspendingQuery.test.tsx b/frontend-modern/src/hooks/__tests__/createNonSuspendingQuery.test.tsx
index d33e04a059..3fa8d233e8 100644
--- a/frontend-modern/src/hooks/__tests__/createNonSuspendingQuery.test.tsx
+++ b/frontend-modern/src/hooks/__tests__/createNonSuspendingQuery.test.tsx
@@ -10,10 +10,7 @@ afterEach(() => {
cleanup();
});
-function QueryProbe(props: {
- cacheNamespace: string;
- fetcher: (key: string) => Promise<string>;
-}) {
+function QueryProbe(props: { cacheNamespace: string; fetcher: (key: string) => Promise<string> }) {
const state = createNonSuspendingQuery<string, string>({
source: () => 'stable-key',
cacheKey: (key) => `${props.cacheNamespace}:${key}`,
diff --git a/frontend-modern/src/hooks/__tests__/useColumnVisibility.test.ts b/frontend-modern/src/hooks/__tests__/useColumnVisibility.test.ts
index ab428e9243..18ae6ed4fb 100644
--- a/frontend-modern/src/hooks/__tests__/useColumnVisibility.test.ts
+++ b/frontend-modern/src/hooks/__tests__/useColumnVisibility.test.ts
@@ -69,9 +69,7 @@ describe('useColumnVisibility', () => {
window.localStorage.setItem(storageKey, JSON.stringify(['ip']));
let disposeRoot: (() => void) | undefined;
- let visibility:
- | ReturnType<typeof useColumnVisibility>
- | undefined;
+ let visibility: ReturnType<typeof useColumnVisibility> | undefined;
createRoot((dispose) => {
disposeRoot = dispose;
@@ -82,14 +80,7 @@ describe('useColumnVisibility', () => {
{ id: 'aiContext', label: 'AI Context', toggleable: true, defaultHidden: true },
];
- visibility = useColumnVisibility(
- storageKey,
- columns,
- ['ip'],
- undefined,
- {},
- ['aiContext'],
- );
+ visibility = useColumnVisibility(storageKey, columns, ['ip'], undefined, {}, ['aiContext']);
expect(visibility.hiddenColumns()).toEqual(['ip', 'aiContext']);
expect(visibility.visibleColumns().map((col) => col.id)).toEqual(['name', 'type']);
@@ -114,14 +105,9 @@ describe('useColumnVisibility', () => {
{ id: 'aiContext', label: 'AI Context', toggleable: true, defaultHidden: true },
];
- const remounted = useColumnVisibility(
- storageKey,
- columns,
- ['ip'],
- undefined,
- {},
- ['aiContext'],
- );
+ const remounted = useColumnVisibility(storageKey, columns, ['ip'], undefined, {}, [
+ 'aiContext',
+ ]);
expect(remounted.hiddenColumns()).toEqual(['ip']);
expect(remounted.visibleColumns().map((col) => col.id)).toEqual([
@@ -169,13 +155,10 @@ describe('useColumnVisibility', () => {
{ id: 'outcome', label: 'Outcome' },
];
- const visibility = useColumnVisibility(
- storageKey,
- columns,
- [],
- undefined,
- { subject: 'item', source: 'platform' },
- );
+ const visibility = useColumnVisibility(storageKey, columns, [], undefined, {
+ subject: 'item',
+ source: 'platform',
+ });
expect(visibility.hiddenColumns()).toEqual(['item', 'platform']);
expect(visibility.visibleColumns().map((col) => col.id)).toEqual(['outcome']);
diff --git a/frontend-modern/src/hooks/useColumnVisibility.ts b/frontend-modern/src/hooks/useColumnVisibility.ts
index 25b31cf0c4..8a4d5bc433 100644
--- a/frontend-modern/src/hooks/useColumnVisibility.ts
+++ b/frontend-modern/src/hooks/useColumnVisibility.ts
@@ -73,10 +73,7 @@ const readAppliedDefaultHiddenMigrations = (
}
};
-const persistAppliedDefaultHiddenMigrations = (
- storageKey: string,
- ids: string[],
-): void => {
+const persistAppliedDefaultHiddenMigrations = (storageKey: string, ids: string[]): void => {
if (typeof window === 'undefined') return;
try {
@@ -112,10 +109,10 @@ export function useColumnVisibility(
persistedIdAliases: Record<string, string> = {},
defaultHiddenMigrationIds: string[] = [],
) {
- const defaultHiddenFromColumns = columns
- .filter((c) => c.defaultHidden)
- .map((c) => c.id);
- const effectiveDefaultHidden = Array.from(new Set([...defaultHiddenFromColumns, ...defaultHidden]));
+ const defaultHiddenFromColumns = columns.filter((c) => c.defaultHidden).map((c) => c.id);
+ const effectiveDefaultHidden = Array.from(
+ new Set([...defaultHiddenFromColumns, ...defaultHidden]),
+ );
// Get list of toggleable column IDs
const toggleableIds = columns.filter((c) => c.toggleable).map((c) => c.id);
diff --git a/frontend-modern/src/hooks/useResources.ts b/frontend-modern/src/hooks/useResources.ts
index 6e3bfb7219..4a5cf3bdd5 100644
--- a/frontend-modern/src/hooks/useResources.ts
+++ b/frontend-modern/src/hooks/useResources.ts
@@ -261,10 +261,4 @@ export function useResources(storeOverride?: ResourceStoreLike): UseResourcesRet
// Re-export types and helpers
export type { Resource, ResourceType, PlatformType, ResourceStatus, ResourceFilter };
-export {
- isInfrastructure,
- isWorkload,
- getCpuPercent,
- getMemoryPercent,
- getDiskPercent,
-};
+export { isInfrastructure, isWorkload, getCpuPercent, getMemoryPercent, getDiskPercent };
diff --git a/frontend-modern/src/hooks/useWorkloads.ts b/frontend-modern/src/hooks/useWorkloads.ts
index 225b3787f7..faddbfa7bb 100644
--- a/frontend-modern/src/hooks/useWorkloads.ts
+++ b/frontend-modern/src/hooks/useWorkloads.ts
@@ -487,8 +487,7 @@ const mapResourceToWorkload = (resource: APIResource): WorkloadGuest | null => {
// — there's no analogous "OS version" carve-out). Falling back here
// lights up the OS column for both platforms without changing what
// already-populated agent-driven rows render.
- osName:
- resource.agent?.osName ?? resource.proxmox?.osName ?? resource.vmware?.guestOsFamily,
+ osName: resource.agent?.osName ?? resource.proxmox?.osName ?? resource.vmware?.guestOsFamily,
osVersion: resource.agent?.osVersion ?? resource.proxmox?.osVersion,
agentVersion: resource.agent?.agentVersion,
networkInterfaces: mapNetworkInterfaces(resource.agent?.networkInterfaces),
diff --git a/frontend-modern/src/routing/__tests__/resourceLinks.branchcov0712b.test.ts b/frontend-modern/src/routing/__tests__/resourceLinks.branchcov0712b.test.ts
index 6a6bd7e066..24b72a7620 100644
--- a/frontend-modern/src/routing/__tests__/resourceLinks.branchcov0712b.test.ts
+++ b/frontend-modern/src/routing/__tests__/resourceLinks.branchcov0712b.test.ts
@@ -36,9 +36,7 @@ describe('buildWorkloadsRouteSearch branch coverage', () => {
cluster: 'prod-us-east',
summaryGroup: 'compute',
}),
- ).toBe(
- '?runtime=containerd&namespace=kube-system&cluster=prod-us-east&summaryGroup=compute',
- );
+ ).toBe('?runtime=containerd&namespace=kube-system&cluster=prod-us-east&summaryGroup=compute');
});
it('verifies the omitted query-param keys map to the canonical names', () => {
@@ -114,9 +112,7 @@ describe('buildKubernetesPath branch coverage', () => {
it('strips leading and trailing slashes but preserves inner path segments', () => {
expect(buildKubernetesPath('/workloads/')).toBe(`${KUBERNETES_PATH}/workloads`);
expect(buildKubernetesPath('///workloads///')).toBe(`${KUBERNETES_PATH}/workloads`);
- expect(buildKubernetesPath('/config/networking/')).toBe(
- `${KUBERNETES_PATH}/config/networking`,
- );
+ expect(buildKubernetesPath('/config/networking/')).toBe(`${KUBERNETES_PATH}/config/networking`);
});
it('trims surrounding whitespace before slash-stripping', () => {
@@ -127,9 +123,9 @@ describe('buildKubernetesPath branch coverage', () => {
describe('buildTrueNASPath branch coverage', () => {
it('falls back to the default tab when called with an explicit undefined argument', () => {
- expect(
- buildTrueNASPath(undefined as unknown as Parameters<typeof buildTrueNASPath>[0]),
- ).toBe(`${TRUENAS_PATH}/overview`);
+ expect(buildTrueNASPath(undefined as unknown as Parameters<typeof buildTrueNASPath>[0])).toBe(
+ `${TRUENAS_PATH}/overview`,
+ );
});
it('returns the base path when the tab is empty or whitespace-only', () => {
@@ -273,9 +269,7 @@ describe('buildRecoveryRouteSearch branch coverage', () => {
it('canonicalizes system-container item-type aliases through the switch arms', () => {
expect(buildRecoveryRouteSearch({ itemType: 'lxc' })).toBe('?itemType=system-container');
expect(buildRecoveryRouteSearch({ itemType: 'ct' })).toBe('?itemType=system-container');
- expect(buildRecoveryRouteSearch({ itemType: 'container' })).toBe(
- '?itemType=system-container',
- );
+ expect(buildRecoveryRouteSearch({ itemType: 'container' })).toBe('?itemType=system-container');
expect(buildRecoveryRouteSearch({ itemType: 'oci-container' })).toBe(
'?itemType=system-container',
);
@@ -286,30 +280,20 @@ describe('buildRecoveryRouteSearch branch coverage', () => {
expect(buildRecoveryRouteSearch({ itemType: 'docker-container' })).toBe(
'?itemType=app-container',
);
- expect(buildRecoveryRouteSearch({ itemType: 'app-container' })).toBe(
- '?itemType=app-container',
- );
+ expect(buildRecoveryRouteSearch({ itemType: 'app-container' })).toBe('?itemType=app-container');
});
it('canonicalizes the remaining item-type switch arms (pod, pvc, cluster, dataset, velero, guest)', () => {
expect(buildRecoveryRouteSearch({ itemType: 'k8s-pod' })).toBe('?itemType=pod');
expect(buildRecoveryRouteSearch({ itemType: 'pvc' })).toBe('?itemType=pvc');
- expect(buildRecoveryRouteSearch({ itemType: 'kubernetes-cluster' })).toBe(
- '?itemType=cluster',
- );
- expect(buildRecoveryRouteSearch({ itemType: 'truenas-dataset' })).toBe(
- '?itemType=dataset',
- );
- expect(buildRecoveryRouteSearch({ itemType: 'velero-backup' })).toBe(
- '?itemType=velero-backup',
- );
+ expect(buildRecoveryRouteSearch({ itemType: 'kubernetes-cluster' })).toBe('?itemType=cluster');
+ expect(buildRecoveryRouteSearch({ itemType: 'truenas-dataset' })).toBe('?itemType=dataset');
+ expect(buildRecoveryRouteSearch({ itemType: 'velero-backup' })).toBe('?itemType=velero-backup');
expect(buildRecoveryRouteSearch({ itemType: 'proxmox-guest' })).toBe('?itemType=guest');
});
it('strips the proxmox-/truenas-/k8s- prefixes via the default-arm branches', () => {
- expect(buildRecoveryRouteSearch({ itemType: 'proxmox-storage' })).toBe(
- '?itemType=storage',
- );
+ expect(buildRecoveryRouteSearch({ itemType: 'proxmox-storage' })).toBe('?itemType=storage');
expect(buildRecoveryRouteSearch({ itemType: 'truenas-share' })).toBe('?itemType=share');
expect(buildRecoveryRouteSearch({ itemType: 'k8s-node' })).toBe('?itemType=node');
});
diff --git a/frontend-modern/src/stores/__tests__/sessionCapabilities.test.ts b/frontend-modern/src/stores/__tests__/sessionCapabilities.test.ts
index e1c9a158e7..fbce64da5c 100644
--- a/frontend-modern/src/stores/__tests__/sessionCapabilities.test.ts
+++ b/frontend-modern/src/stores/__tests__/sessionCapabilities.test.ts
@@ -42,7 +42,9 @@ describe('session capabilities store', () => {
});
it('default-fills capabilities when sessionCapabilities is null', () => {
- const next = syncSessionCapabilities({ sessionCapabilities: null } as unknown as Parameters<typeof syncSessionCapabilities>[0]);
+ const next = syncSessionCapabilities({ sessionCapabilities: null } as unknown as Parameters<
+ typeof syncSessionCapabilities
+ >[0]);
expect(next).toEqual({ demoMode: false });
});
diff --git a/frontend-modern/src/stores/__tests__/systemSettings.test.ts b/frontend-modern/src/stores/__tests__/systemSettings.test.ts
index 0278de503d..0cf13b3820 100644
--- a/frontend-modern/src/stores/__tests__/systemSettings.test.ts
+++ b/frontend-modern/src/stores/__tests__/systemSettings.test.ts
@@ -84,7 +84,9 @@ describe('systemSettings store', () => {
expect(privacyDoc).toContain('uses request IP addresses transiently for abuse/rate limiting');
expect(privacyDoc).toContain('Reset ID');
expect(privacyDoc).toContain('Pulse Intelligence Patrol control completed operations loop 30d');
- expect(privacyDoc).toContain('Pulse Intelligence Patrol control paid resolved operations loop 30d');
+ expect(privacyDoc).toContain(
+ 'Pulse Intelligence Patrol control paid resolved operations loop 30d',
+ );
expect(privacyDoc).not.toContain('completed-work proof');
expect(privacyDoc).not.toContain('resolved-work proof');
expect(privacyDoc).not.toContain('governed-operation proof');
@@ -108,7 +110,9 @@ describe('systemSettings store', () => {
for (const copy of [securityDoc, publicSecurityDoc]) {
expect(copy).toContain('Relay Security (Relay and Above)');
- expect(copy).toContain('Relay functionality requires a Relay, Pro, legacy Pro+, or Cloud license');
+ expect(copy).toContain(
+ 'Relay functionality requires a Relay, Pro, legacy Pro+, or Cloud license',
+ );
expect(copy).not.toContain('Relay Security (Pro)');
expect(copy).not.toContain('Relay functionality requires a Pro or Cloud license');
}
@@ -117,8 +121,12 @@ describe('systemSettings store', () => {
it('documents self-hosted AI provider transport and resource-policy redaction in the privacy doc', () => {
const privacyDoc = readFileSync(path.join(repoRoot, 'docs', 'PRIVACY.md'), 'utf8');
- expect(privacyDoc).toContain('AI prompts from self-managed installs do not transit Pulse infrastructure');
- expect(privacyDoc).toContain('governed resource details use the same resource-policy redaction');
+ expect(privacyDoc).toContain(
+ 'AI prompts from self-managed installs do not transit Pulse infrastructure',
+ );
+ expect(privacyDoc).toContain(
+ 'governed resource details use the same resource-policy redaction',
+ );
expect(privacyDoc).toContain('Local providers stay on your network');
});
});
diff --git a/frontend-modern/src/stores/__tests__/updates.test.ts b/frontend-modern/src/stores/__tests__/updates.test.ts
index 18ed575bc3..f0ca29b182 100644
--- a/frontend-modern/src/stores/__tests__/updates.test.ts
+++ b/frontend-modern/src/stores/__tests__/updates.test.ts
@@ -199,7 +199,9 @@ describe('updateStore', () => {
it('clears the marker and toasts the backend error when the rollback is rejected', async () => {
mockRollbackUpdate.mockRejectedValue(
- new Error('no retained backup for this update; it may have been pruned by backup retention'),
+ new Error(
+ 'no retained backup for this update; it may have been pruned by backup retention',
+ ),
);
const updateStore = await loadUpdateStore();
diff --git a/frontend-modern/src/stores/aiIntelligenceSummaryModel.ts b/frontend-modern/src/stores/aiIntelligenceSummaryModel.ts
index bcc2629087..7b5b001597 100644
--- a/frontend-modern/src/stores/aiIntelligenceSummaryModel.ts
+++ b/frontend-modern/src/stores/aiIntelligenceSummaryModel.ts
@@ -1,7 +1,4 @@
-import type {
- IntelligencePolicyPostureSummary,
- IntelligenceSummary,
-} from '@/types/aiIntelligence';
+import type { IntelligencePolicyPostureSummary, IntelligenceSummary } from '@/types/aiIntelligence';
import type {
ResourceRedactionHint,
ResourceRoutingScope,
diff --git a/frontend-modern/src/stores/aiRuntimeState.ts b/frontend-modern/src/stores/aiRuntimeState.ts
index 142e4fc988..d1d36cb4c5 100644
--- a/frontend-modern/src/stores/aiRuntimeState.ts
+++ b/frontend-modern/src/stores/aiRuntimeState.ts
@@ -7,7 +7,9 @@ import { logger } from '@/utils/logger';
const [aiRuntimeSettings, setAIRuntimeSettings] = createSignal<AISettings | null>(null);
const [aiRuntimeSettingsLoading, setAIRuntimeSettingsLoading] = createSignal(false);
const [aiRuntimeSettingsLoaded, setAIRuntimeSettingsLoaded] = createSignal(false);
-const [aiRuntimeSettingsLoadError, setAIRuntimeSettingsLoadError] = createSignal<Error | null>(null);
+const [aiRuntimeSettingsLoadError, setAIRuntimeSettingsLoadError] = createSignal<Error | null>(
+ null,
+);
const [aiRuntimeModels, setAIRuntimeModels] = createSignal<ModelInfo[]>([]);
const [aiRuntimeModelsLoading, setAIRuntimeModelsLoading] = createSignal(false);
diff --git a/frontend-modern/src/stores/sessionCapabilities.ts b/frontend-modern/src/stores/sessionCapabilities.ts
index 9e8acbb16a..3416a557b1 100644
--- a/frontend-modern/src/stores/sessionCapabilities.ts
+++ b/frontend-modern/src/stores/sessionCapabilities.ts
@@ -5,9 +5,8 @@ const DEFAULT_SESSION_CAPABILITIES: SecurityStatusSessionCapabilities = {
demoMode: false,
};
-const [sessionCapabilities, setSessionCapabilities] = createSignal<SecurityStatusSessionCapabilities>(
- { ...DEFAULT_SESSION_CAPABILITIES },
-);
+const [sessionCapabilities, setSessionCapabilities] =
+ createSignal<SecurityStatusSessionCapabilities>({ ...DEFAULT_SESSION_CAPABILITIES });
const [sessionCapabilitiesResolved, setSessionCapabilitiesResolved] = createSignal(false);
function normalizeSessionCapabilities(
diff --git a/frontend-modern/src/types/nodes.ts b/frontend-modern/src/types/nodes.ts
index b8c99fbe67..6ad449da01 100644
--- a/frontend-modern/src/types/nodes.ts
+++ b/frontend-modern/src/types/nodes.ts
@@ -1,11 +1,7 @@
import type { Temperature } from '@/types/api';
export type TemperatureTransport =
- | 'disabled'
- | 'socket-proxy'
- | 'https-proxy'
- | 'ssh'
- | 'ssh-blocked';
+ 'disabled' | 'socket-proxy' | 'https-proxy' | 'ssh' | 'ssh-blocked';
// Node configuration types
diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.ts
index 908385c2cd..c1d56f76b8 100644
--- a/frontend-modern/src/types/resource.ts
+++ b/frontend-modern/src/types/resource.ts
@@ -103,14 +103,7 @@ export type SourceType =
// Kubernetes adapter emits for unhealthy-but-alive rows (cordoned nodes,
// not-ready containers, pending pods, partially available controllers).
export type ResourceStatus =
- | 'online'
- | 'offline'
- | 'running'
- | 'stopped'
- | 'degraded'
- | 'warning'
- | 'paused'
- | 'unknown';
+ 'online' | 'offline' | 'running' | 'stopped' | 'degraded' | 'warning' | 'paused' | 'unknown';
// Metric value with optional limits
export interface ResourceMetric {
@@ -170,13 +163,7 @@ export interface ResourceDiscoveryTarget {
}
export type ResourceDiscoveryReadinessState =
- | 'fresh'
- | 'stale'
- | 'missing'
- | 'running'
- | 'failed'
- | 'unavailable'
- | 'unsupported';
+ 'fresh' | 'stale' | 'missing' | 'running' | 'failed' | 'unavailable' | 'unsupported';
export interface ResourceDiscoveryReadiness {
state: ResourceDiscoveryReadinessState;
@@ -247,11 +234,7 @@ export type ResourceChangeKind =
| 'command_executed'
| 'runbook_executed';
export type ResourceChangeSourceType =
- | 'platform_event'
- | 'pulse_diff'
- | 'heuristic'
- | 'user_action'
- | 'agent_action';
+ 'platform_event' | 'pulse_diff' | 'heuristic' | 'user_action' | 'agent_action';
export type ResourceChangeSourceAdapter =
| 'docker_adapter'
| 'proxmox_adapter'
@@ -261,11 +244,7 @@ export type ResourceChangeSourceAdapter =
| string;
export type ResourceFacetSourceAdapter =
- | 'docker_adapter'
- | 'proxmox_adapter'
- | 'truenas_adapter'
- | 'vmware_adapter'
- | 'agent:ops-helper';
+ 'docker_adapter' | 'proxmox_adapter' | 'truenas_adapter' | 'vmware_adapter' | 'agent:ops-helper';
export interface ResourceFacetCounts {
recentChanges: number;
diff --git a/frontend-modern/src/useAppRuntimeState.ts b/frontend-modern/src/useAppRuntimeState.ts
index 32021dca7b..9302e6f7d2 100644
--- a/frontend-modern/src/useAppRuntimeState.ts
+++ b/frontend-modern/src/useAppRuntimeState.ts
@@ -684,7 +684,8 @@ export const useAppRuntimeState = () => {
}
if (securityData.ssoEnabled && securityData.ssoSessionUsername) {
- const ssoDisplayName = securityData.ssoSessionDisplayName || securityData.ssoSessionUsername;
+ const ssoDisplayName =
+ securityData.ssoSessionDisplayName || securityData.ssoSessionUsername;
logger.info('[App] SSO session detected', { user: ssoDisplayName });
setHasAuth(true);
setProxyAuthInfo({
diff --git a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712.test.ts b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712.test.ts
index c42178ea42..efb7833b93 100644
--- a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712.test.ts
+++ b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712.test.ts
@@ -75,9 +75,7 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => {
// Documents the behaviour: slice(0,1).toUpperCase() + slice(1) preserves the
// rest verbatim, so 'updateContainer' becomes 'UpdateContainer' (camelCase
// tail is kept, not lowercased).
- expect(formatActionCapabilityLabel('docker.updateContainer')).toBe(
- 'Docker UpdateContainer',
- );
+ expect(formatActionCapabilityLabel('docker.updateContainer')).toBe('Docker UpdateContainer');
});
});
@@ -195,9 +193,7 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => {
it('delegates to the state lookup for non-failed states', () => {
// state !== 'failed' -> skips the refusal check entirely.
- expect(
- getActionAuditRecordStatePresentation({ state: 'executing' }),
- ).toStrictEqual({
+ expect(getActionAuditRecordStatePresentation({ state: 'executing' })).toStrictEqual({
label: 'Executing',
className:
'bg-sky-100 text-sky-800 border-sky-200 dark:bg-sky-900 dark:text-sky-200 dark:border-sky-700',
@@ -228,8 +224,7 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => {
getActionAuditResultPresentation({ result: { success: true } })?.detail,
).toBeUndefined();
expect(
- getActionAuditResultPresentation({ result: { success: true, output: ' ' } })
- ?.detail,
+ getActionAuditResultPresentation({ result: { success: true, output: ' ' } })?.detail,
).toBeUndefined();
});
});
@@ -371,9 +366,7 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => {
// guard true (actionResultV2 undefined), but getActionAuditVerification(audit)
// resolves to undefined -> `undefined?.ran === true` is false. Distinct from
// the empty-record case above because `result` is present here.
- expect(
- shouldRenderActionAuditVerification({ result: { success: true } }),
- ).toBe(false);
+ expect(shouldRenderActionAuditVerification({ result: { success: true } })).toBe(false);
});
it('lets the top-level verification precedence force a false render (ran=false shadows a ran=true result verification)', () => {
diff --git a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712c.test.ts b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712c.test.ts
index e414569baf..33517227de 100644
--- a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712c.test.ts
+++ b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov0712c.test.ts
@@ -184,7 +184,8 @@ describe('getActionAuditVerificationOutcomePresentation — actionResultV2 verif
);
expect(presentation).toStrictEqual({
label: 'Confirmation lacks an evidence source',
- detail: 'The record says confirmed but provides no evidence source; do not treat it as independently verified.',
+ detail:
+ 'The record says confirmed but provides no evidence source; do not treat it as independently verified.',
evidenceSummary: 'No additional verification summary. Source: No evidence source.',
className:
'border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300',
@@ -263,7 +264,8 @@ describe('getActionAuditVerificationOutcomePresentation — actionResultV2 verif
});
expect(presentation).toStrictEqual({
label: 'Legacy check passed (source unclassified)',
- detail: 'This older record does not identify an evidence source. Do not treat it as independent confirmation.',
+ detail:
+ 'This older record does not identify an evidence source. Do not treat it as independent confirmation.',
evidenceSummary: 'legacy readback',
className:
'border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300',
diff --git a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts
index 8b0d2e6c57..e17e6c0366 100644
--- a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts
@@ -75,9 +75,7 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => {
// Documents the behaviour: slice(0,1).toUpperCase() + slice(1) preserves the
// rest verbatim, so 'updateContainer' becomes 'UpdateContainer' (camelCase
// tail is kept, not lowercased).
- expect(formatActionCapabilityLabel('docker.updateContainer')).toBe(
- 'Docker UpdateContainer',
- );
+ expect(formatActionCapabilityLabel('docker.updateContainer')).toBe('Docker UpdateContainer');
});
});
@@ -195,9 +193,7 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => {
it('delegates to the state lookup for non-failed states', () => {
// state !== 'failed' -> skips the refusal check entirely.
- expect(
- getActionAuditRecordStatePresentation({ state: 'executing' }),
- ).toStrictEqual({
+ expect(getActionAuditRecordStatePresentation({ state: 'executing' })).toStrictEqual({
label: 'Executing',
className:
'bg-sky-100 text-sky-800 border-sky-200 dark:bg-sky-900 dark:text-sky-200 dark:border-sky-700',
@@ -228,8 +224,7 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => {
getActionAuditResultPresentation({ result: { success: true } })?.detail,
).toBeUndefined();
expect(
- getActionAuditResultPresentation({ result: { success: true, output: ' ' } })
- ?.detail,
+ getActionAuditResultPresentation({ result: { success: true, output: ' ' } })?.detail,
).toBeUndefined();
});
});
diff --git a/frontend-modern/src/utils/__tests__/agentContextPresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/agentContextPresentation.branchcov2.test.ts
index 1a25cbe0f4..23fab90865 100644
--- a/frontend-modern/src/utils/__tests__/agentContextPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/agentContextPresentation.branchcov2.test.ts
@@ -27,7 +27,9 @@ const baseContext = (overrides: Partial<AgentResourceContext> = {}): AgentResour
...overrides,
});
-const baseSection = (overrides: Partial<AgentResourceContextSection> = {}): AgentResourceContextSection => ({
+const baseSection = (
+ overrides: Partial<AgentResourceContextSection> = {},
+): AgentResourceContextSection => ({
id: 'runtime',
title: 'Runtime',
source: '',
@@ -40,9 +42,7 @@ const baseSection = (overrides: Partial<AgentResourceContextSection> = {}): Agen
describe('agentContextPresentation — branch coverage (branchcov2)', () => {
describe('formatAgentResourceContextForClipboard — header branches', () => {
it('falls back to canonicalId when resourceName is empty (|| right operand)', () => {
- const text = formatAgentResourceContextForClipboard(
- baseContext({ resourceName: '' }),
- );
+ const text = formatAgentResourceContextForClipboard(baseContext({ resourceName: '' }));
// resourceName '' is falsy -> `context.resourceName || context.canonicalId`
// resolves to the canonical id.
expect(text.startsWith('# Pulse resource context: host:node-1\n')).toBe(true);
@@ -66,9 +66,7 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
});
it('emits the Technology line when context.technology is set (if-true arm)', () => {
- const text = formatAgentResourceContextForClipboard(
- baseContext({ technology: 'docker' }),
- );
+ const text = formatAgentResourceContextForClipboard(baseContext({ technology: 'docker' }));
expect(text).toContain('Technology: docker');
});
});
@@ -101,7 +99,9 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
'',
'Context facts below are bounded, read-only Pulse context. Redacted values were withheld by policy.',
'',
- ].join('\n').trim() + '\n',
+ ]
+ .join('\n')
+ .trim() + '\n',
);
});
@@ -157,9 +157,7 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
});
it('returns empty string for an empty timestamp (falsy arm)', () => {
- const text = formatAgentResourceContextForClipboard(
- baseContext({ generatedAt: '' }),
- );
+ const text = formatAgentResourceContextForClipboard(baseContext({ generatedAt: '' }));
expect(text).toContain('Generated: \n');
});
@@ -276,7 +274,12 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
const text = formatAgentResourceContextForClipboard(
baseContext({
contextSections: [
- baseSection({ title: 'Bare', source: '', trustTier: '', facts: [{ label: 'L', value: 'V' }] }),
+ baseSection({
+ title: 'Bare',
+ source: '',
+ trustTier: '',
+ facts: [{ label: 'L', value: 'V' }],
+ }),
],
}),
);
@@ -288,7 +291,12 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
const text = formatAgentResourceContextForClipboard(
baseContext({
contextSections: [
- baseSection({ title: 'S', source: 'unified', trustTier: '', facts: [{ label: 'L', value: 'V' }] }),
+ baseSection({
+ title: 'S',
+ source: 'unified',
+ trustTier: '',
+ facts: [{ label: 'L', value: 'V' }],
+ }),
],
}),
);
@@ -299,7 +307,12 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
const text = formatAgentResourceContextForClipboard(
baseContext({
contextSections: [
- baseSection({ title: 'S', source: '', trustTier: 'runtime-observed', facts: [{ label: 'L', value: 'V' }] }),
+ baseSection({
+ title: 'S',
+ source: '',
+ trustTier: 'runtime-observed',
+ facts: [{ label: 'L', value: 'V' }],
+ }),
],
}),
);
@@ -400,7 +413,13 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
const text = formatAgentResourceContextForClipboard(
baseContext({
contextSections: [
- baseSection({ id: 'skip-me', title: 'Skipped', source: 's', trustTier: 't', redactions: undefined }),
+ baseSection({
+ id: 'skip-me',
+ title: 'Skipped',
+ source: 's',
+ trustTier: 't',
+ redactions: undefined,
+ }),
baseSection({
id: 'keep-me',
title: 'Kept',
@@ -420,7 +439,13 @@ describe('agentContextPresentation — branch coverage (branchcov2)', () => {
const text = formatAgentResourceContextForClipboard(
baseContext({
contextSections: [
- baseSection({ id: 'skip-me', title: 'Skipped', source: 's', trustTier: 't', redactions: [] }),
+ baseSection({
+ id: 'skip-me',
+ title: 'Skipped',
+ source: 's',
+ trustTier: 't',
+ redactions: [],
+ }),
],
}),
);
diff --git a/frontend-modern/src/utils/__tests__/agentInstallCommand.test.ts b/frontend-modern/src/utils/__tests__/agentInstallCommand.test.ts
index 6eeeaf4980..fb860d554c 100644
--- a/frontend-modern/src/utils/__tests__/agentInstallCommand.test.ts
+++ b/frontend-modern/src/utils/__tests__/agentInstallCommand.test.ts
@@ -140,14 +140,14 @@ describe('agentInstallCommand', () => {
expect(command).toContain('$env:PULSE_NON_INTERACTIVE="true"');
expect(command).toContain('$env:PULSE_INSECURE_SKIP_VERIFY="true"');
expect(command).toContain('$env:PULSE_CACERT="C:\\Pulse\\custom-ca.cer"');
- expect(command).toContain('Invoke-WebRequest -Uri $pulseScriptUrl -UseBasicParsing -OutFile $pulseInstallScript');
expect(command).toContain(
- '& $pulsePowerShell -NoProfile -ExecutionPolicy Bypass -File $pulseInstallScript -Url',
+ 'Invoke-WebRequest -Uri $pulseScriptUrl -UseBasicParsing -OutFile $pulseInstallScript',
);
- expect(command).toContain('if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }');
expect(command).toContain(
- 'Remove-Item Env:PULSE_PREFLIGHT_ONLY -ErrorAction SilentlyContinue',
+ '& $pulsePowerShell -NoProfile -ExecutionPolicy Bypass -File $pulseInstallScript -Url',
);
+ expect(command).toContain('if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }');
+ expect(command).toContain('Remove-Item Env:PULSE_PREFLIGHT_ONLY -ErrorAction SilentlyContinue');
expect(command).not.toContain('-PreflightOnly $true');
expect(command).not.toContain('-NonInteractive $true');
expect(command).not.toContain('-Insecure $true');
diff --git a/frontend-modern/src/utils/__tests__/agentProfileSuggestionPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/agentProfileSuggestionPresentation.branchcov0712b.test.ts
index 64e52b4c6a..d9a79dc31f 100644
--- a/frontend-modern/src/utils/__tests__/agentProfileSuggestionPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/agentProfileSuggestionPresentation.branchcov0712b.test.ts
@@ -38,9 +38,7 @@ describe('getAgentProfileSuggestionRiskHints (branch coverage)', () => {
it('pushes the docker-update-checks hint for the disable_docker_update_checks===true arm', () => {
expect(
getAgentProfileSuggestionRiskHints({ disable_docker_update_checks: true }),
- ).toStrictEqual([
- 'Docker update checks are disabled. Update visibility will be limited.',
- ]);
+ ).toStrictEqual(['Docker update checks are disabled. Update visibility will be limited.']);
});
it('pushes the host-monitoring hint for the enable_host===false arm', () => {
diff --git a/frontend-modern/src/utils/__tests__/agentVersion.test.ts b/frontend-modern/src/utils/__tests__/agentVersion.test.ts
index aa21ff37c1..4950283722 100644
--- a/frontend-modern/src/utils/__tests__/agentVersion.test.ts
+++ b/frontend-modern/src/utils/__tests__/agentVersion.test.ts
@@ -23,12 +23,32 @@ describe('agentVersion', () => {
['uppercase V prefix', 'V1.2.3', { major: 1, minor: 2, patch: 3, prerelease: [] }],
['whitespace padded', ' 1.2.3 ', { major: 1, minor: 2, patch: 3, prerelease: [] }],
['with prerelease', '1.2.3-rc.5', { major: 1, minor: 2, patch: 3, prerelease: ['rc', '5'] }],
- ['with prerelease + build', '1.2.3-rc.5+git.1', { major: 1, minor: 2, patch: 3, prerelease: ['rc', '5'] }],
- ['build metadata only', '1.2.3+git.151.gabcdef', { major: 1, minor: 2, patch: 3, prerelease: [] }],
- ['v + prerelease + build', 'v1.2.3-rc.5+build.2', { major: 1, minor: 2, patch: 3, prerelease: ['rc', '5'] }],
+ [
+ 'with prerelease + build',
+ '1.2.3-rc.5+git.1',
+ { major: 1, minor: 2, patch: 3, prerelease: ['rc', '5'] },
+ ],
+ [
+ 'build metadata only',
+ '1.2.3+git.151.gabcdef',
+ { major: 1, minor: 2, patch: 3, prerelease: [] },
+ ],
+ [
+ 'v + prerelease + build',
+ 'v1.2.3-rc.5+build.2',
+ { major: 1, minor: 2, patch: 3, prerelease: ['rc', '5'] },
+ ],
['leading zeros', '01.02.03', { major: 1, minor: 2, patch: 3, prerelease: [] }],
- ['extra dotted segments (first 3 used)', '1.2.3.4.5', { major: 1, minor: 2, patch: 3, prerelease: [] }],
- ['trailing dash with empty prerelease', '1.2.3-', { major: 1, minor: 2, patch: 3, prerelease: [] }],
+ [
+ 'extra dotted segments (first 3 used)',
+ '1.2.3.4.5',
+ { major: 1, minor: 2, patch: 3, prerelease: [] },
+ ],
+ [
+ 'trailing dash with empty prerelease',
+ '1.2.3-',
+ { major: 1, minor: 2, patch: 3, prerelease: [] },
+ ],
])('parses %s', (_label, input, expected) => {
expect(parseAgentVersion(input)).toEqual(expected);
});
@@ -96,7 +116,7 @@ describe('agentVersion', () => {
it('compares real-world agent version ranges in ascending order', () => {
const sorted = ['6.0.0-rc.5', '6.0.0', '6.1.0', '6.1.1'].sort(
- (x, y) => (compareAgentVersions(x, y) ?? 0),
+ (x, y) => compareAgentVersions(x, y) ?? 0,
);
expect(sorted).toEqual(['6.0.0-rc.5', '6.0.0', '6.1.0', '6.1.1']);
});
diff --git a/frontend-modern/src/utils/__tests__/aiControlLevelPresentation.test.ts b/frontend-modern/src/utils/__tests__/aiControlLevelPresentation.test.ts
index 598981863b..38a4468a7f 100644
--- a/frontend-modern/src/utils/__tests__/aiControlLevelPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/aiControlLevelPresentation.test.ts
@@ -23,9 +23,7 @@ describe('aiControlLevelPresentation', () => {
expect(getAIControlLevelBadgeClass('controlled')).toContain('bg-amber-100');
expect(getAIControlLevelBadgeClass('autonomous')).toContain('bg-red-100');
expect(getAIControlLevelDescription('read_only')).toContain('Assistant can query and explain');
- expect(getAIControlLevelDescription('controlled')).toContain(
- 'asks before chat-only actions',
- );
+ expect(getAIControlLevelDescription('controlled')).toContain('asks before chat-only actions');
expect(getAIControlLevelDescription('autonomous')).toContain('eligible chat-only actions');
expect(getAIControlLevelDescription('autonomous')).toContain(
'Infrastructure work stays with Patrol mode',
diff --git a/frontend-modern/src/utils/__tests__/aiCostPresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/aiCostPresentation.branchcov2.test.ts
index d6349d81f0..ff325bb3ba 100644
--- a/frontend-modern/src/utils/__tests__/aiCostPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/aiCostPresentation.branchcov2.test.ts
@@ -217,9 +217,7 @@ describe('readableTargetType — branch coverage (via getAICostTargetPresentatio
describe('trim + lowercase normalization before the map lookup', () => {
it('normalizes whitespace and casing so " PATROL_RUN " still maps to "Patrol runs"', () => {
- expect(
- getAICostTargetPresentation(input({ target_type: ' PATROL_RUN ' })),
- ).toEqual({
+ expect(getAICostTargetPresentation(input({ target_type: ' PATROL_RUN ' }))).toEqual({
label: 'Patrol runs',
rawLabel: 'PATROL_RUN',
});
@@ -235,9 +233,7 @@ describe('readableTargetType — branch coverage (via getAICostTargetPresentatio
});
it('humanizes an unmapped mixed snake/kebab type', () => {
- expect(
- getAICostTargetPresentation(input({ target_type: 'vm-snapshot_task' })),
- ).toEqual({
+ expect(getAICostTargetPresentation(input({ target_type: 'vm-snapshot_task' }))).toEqual({
label: 'Vm Snapshot Task',
rawLabel: 'vm-snapshot_task',
});
@@ -253,18 +249,14 @@ describe('readableTargetType — branch coverage (via getAICostTargetPresentatio
});
it('falls back to "Usage" when target_type is null', () => {
- expect(
- getAICostTargetPresentation(input({ target_type: null })),
- ).toEqual({
+ expect(getAICostTargetPresentation(input({ target_type: null }))).toEqual({
label: 'Usage',
rawLabel: 'usage',
});
});
it('falls back to "Usage" when target_type is whitespace-only', () => {
- expect(
- getAICostTargetPresentation(input({ target_type: ' ' })),
- ).toEqual({
+ expect(getAICostTargetPresentation(input({ target_type: ' ' }))).toEqual({
label: 'Usage',
rawLabel: 'usage',
});
@@ -327,9 +319,7 @@ describe('getAICostTargetPresentation — branch coverage', () => {
});
it('never emits a `detail` field on the resource path', () => {
- const result = getAICostTargetPresentation(
- input({ target_type: 'vm', target_id: 'web-1' }),
- );
+ const result = getAICostTargetPresentation(input({ target_type: 'vm', target_id: 'web-1' }));
expect(result).not.toHaveProperty('detail');
});
});
@@ -379,9 +369,7 @@ describe('getAICostTargetPresentation — branch coverage', () => {
it('trims a padded target_id before shaping rawLabel and detail', () => {
expect(
- getAICostTargetPresentation(
- input({ target_type: 'patrol_run', target_id: ' nightly ' }),
- ),
+ getAICostTargetPresentation(input({ target_type: 'patrol_run', target_id: ' nightly ' })),
).toEqual({
label: 'Patrol runs',
detail: 'nightly',
diff --git a/frontend-modern/src/utils/__tests__/aiFindingPresentation.branchcov0717.test.ts b/frontend-modern/src/utils/__tests__/aiFindingPresentation.branchcov0717.test.ts
index 167c42bd58..816c2fb548 100644
--- a/frontend-modern/src/utils/__tests__/aiFindingPresentation.branchcov0717.test.ts
+++ b/frontend-modern/src/utils/__tests__/aiFindingPresentation.branchcov0717.test.ts
@@ -285,9 +285,7 @@ describe('aiFindingPresentation branch coverage (supplemental)', () => {
};
it.each(Object.entries(expected))('maps %s to its badge class', (_outcome, classes) => {
// Cast back through the union type; runtime resolves via Record lookup.
- expect(
- getInvestigationOutcomeBadgeClasses(_outcome as InvestigationOutcome),
- ).toBe(classes);
+ expect(getInvestigationOutcomeBadgeClasses(_outcome as InvestigationOutcome)).toBe(classes);
});
it('falls back to the default badge for an unrecognized outcome', () => {
@@ -641,7 +639,9 @@ describe('aiFindingPresentation branch coverage (supplemental)', () => {
'pending_updates=2 inventory=host-1 checked_at=2026-07-17T10:00:00Z received_at=2026-07-17T10:00:05Z reboot_required=true',
});
expect(out).toContain('2 operating system updates were pending');
- expect(out).toContain('reboot required: Yes. No reboot is authorized by this finding or action');
+ expect(out).toContain(
+ 'reboot required: Yes. No reboot is authorized by this finding or action',
+ );
expect(out).not.toContain('Pulse could not safely present');
});
@@ -680,7 +680,10 @@ describe('aiFindingPresentation branch coverage (supplemental)', () => {
it('passes trimmed evidence through verbatim when the key is not a bounded format', () => {
expect(
- getFindingEvidencePresentation({ key: 'something-else', evidence: ' raw evidence body ' }),
+ getFindingEvidencePresentation({
+ key: 'something-else',
+ evidence: ' raw evidence body ',
+ }),
).toBe('raw evidence body');
});
@@ -781,12 +784,9 @@ describe('aiFindingPresentation branch coverage (supplemental)', () => {
};
it('needs attention when fix is queued with no live approval and no action record', () => {
- expect(
- doesFindingNeedAttention(
- { ...queuedBase } as unknown as AttentionFinding,
- [],
- ),
- ).toBe(true);
+ expect(doesFindingNeedAttention({ ...queuedBase } as unknown as AttentionFinding, [])).toBe(
+ true,
+ );
});
it('needs attention when the record exists but carries no action (?. non-short-circuit arm)', () => {
@@ -1043,8 +1043,20 @@ describe('aiFindingPresentation branch coverage (supplemental)', () => {
it('keeps disjoint resources as separate single-finding groups', () => {
const groups = buildPatrolFindingDisplayGroups([
- displayFinding({ id: 'f1', resourceId: 'r1', resourceName: 'A', resourceType: 'vm', title: 't1' }),
- displayFinding({ id: 'f2', resourceId: 'r2', resourceName: 'B', resourceType: 'vm', title: 't2' }),
+ displayFinding({
+ id: 'f1',
+ resourceId: 'r1',
+ resourceName: 'A',
+ resourceType: 'vm',
+ title: 't1',
+ }),
+ displayFinding({
+ id: 'f2',
+ resourceId: 'r2',
+ resourceName: 'B',
+ resourceType: 'vm',
+ title: 't2',
+ }),
]);
expect(groups).toHaveLength(2);
expect(groups.map((g) => g.kind)).toStrictEqual(['finding', 'finding']);
diff --git a/frontend-modern/src/utils/__tests__/aiFindingPresentation.coverage.test.ts b/frontend-modern/src/utils/__tests__/aiFindingPresentation.coverage.test.ts
index 195851d3ba..a34d19c885 100644
--- a/frontend-modern/src/utils/__tests__/aiFindingPresentation.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/aiFindingPresentation.coverage.test.ts
@@ -71,8 +71,9 @@ describe('hasFindingInvestigationHandoffPointer', () => {
};
it('is true when an investigation outcome is recorded', () => {
- expect(hasFindingInvestigationHandoffPointer({ ...base, investigationOutcome: 'fix_failed' }))
- .toBe(true);
+ expect(
+ hasFindingInvestigationHandoffPointer({ ...base, investigationOutcome: 'fix_failed' }),
+ ).toBe(true);
});
it('is true when a session id is present even without an outcome', () => {
@@ -83,7 +84,10 @@ describe('hasFindingInvestigationHandoffPointer', () => {
it('is true when only a last-investigated timestamp is present', () => {
expect(
- hasFindingInvestigationHandoffPointer({ ...base, lastInvestigatedAt: '2026-07-01T00:00:00Z' }),
+ hasFindingInvestigationHandoffPointer({
+ ...base,
+ lastInvestigatedAt: '2026-07-01T00:00:00Z',
+ }),
).toBe(true);
});
@@ -152,17 +156,18 @@ describe('doesFindingNeedAttention (ATTENTION_OUTCOMES set membership)', () => {
'cannot_fix',
] as const;
- it.each(attentionOutcomes)('flags an active finding with outcome %s as needing attention', (
- outcome,
- ) => {
- expect(
- doesFindingNeedAttention({
- id: 'f1',
- status: 'active',
- investigationOutcome: outcome,
- }),
- ).toBe(true);
- });
+ it.each(attentionOutcomes)(
+ 'flags an active finding with outcome %s as needing attention',
+ (outcome) => {
+ expect(
+ doesFindingNeedAttention({
+ id: 'f1',
+ status: 'active',
+ investigationOutcome: outcome,
+ }),
+ ).toBe(true);
+ },
+ );
it('does not flag a non-attention outcome that is not awaiting approval', () => {
// fix_executed is positive progress, not in the attention set.
@@ -230,10 +235,9 @@ describe('doesFindingNeedAttention (ATTENTION_OUTCOMES set membership)', () => {
expiresAt: new Date(now + 60_000).toISOString(),
};
expect(
- doesFindingNeedAttention(
- { id: 'f7', status: 'active', investigationOutcome: 'fix_queued' },
- [approval],
- ),
+ doesFindingNeedAttention({ id: 'f7', status: 'active', investigationOutcome: 'fix_queued' }, [
+ approval,
+ ]),
).toBe(false);
});
});
diff --git a/frontend-modern/src/utils/__tests__/aiFindingPresentation.test.ts b/frontend-modern/src/utils/__tests__/aiFindingPresentation.test.ts
index ad19b22d52..52aac2e1ff 100644
--- a/frontend-modern/src/utils/__tests__/aiFindingPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/aiFindingPresentation.test.ts
@@ -9,7 +9,13 @@ import {
describe('getFindingEvidencePresentation', () => {
it('presents bounded update evidence without package inventory or fingerprints', () => {
- const evidence = getFindingEvidencePresentation(makeFinding({ key: 'apt-host-updates', evidence: 'pending_updates=6 inventory=sha256:secret checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z reboot_required=true' }));
+ const evidence = getFindingEvidencePresentation(
+ makeFinding({
+ key: 'apt-host-updates',
+ evidence:
+ 'pending_updates=6 inventory=sha256:secret checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z reboot_required=true',
+ }),
+ );
expect(evidence).toContain('6 operating system updates were pending');
expect(evidence).toContain('Pulse received that observation');
expect(evidence).toContain('reboot required: Yes');
@@ -19,7 +25,13 @@ describe('getFindingEvidencePresentation', () => {
});
it('presents cleanup pressure without exposing the raw fingerprint', () => {
- const evidence = getFindingEvidencePresentation(makeFinding({ key: 'apt-package-cache-pressure', evidence: 'reclaimable_bytes=104857600 filesystem_usage=91.5 fingerprint=sha256:secret checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z' }));
+ const evidence = getFindingEvidencePresentation(
+ makeFinding({
+ key: 'apt-package-cache-pressure',
+ evidence:
+ 'reclaimable_bytes=104857600 filesystem_usage=91.5 fingerprint=sha256:secret checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z',
+ }),
+ );
expect(evidence).toContain('100 MB of downloaded package data');
expect(evidence).toContain('91.5% full');
expect(evidence).not.toContain('fingerprint');
@@ -27,19 +39,53 @@ describe('getFindingEvidencePresentation', () => {
});
it('fails closed instead of partially interpreting malformed APT evidence', () => {
- expect(getFindingEvidencePresentation(makeFinding({ key: 'apt-host-updates', evidence: 'pending_updates=6 inventory=leaked' }))).toContain('could not safely present');
+ expect(
+ getFindingEvidencePresentation(
+ makeFinding({ key: 'apt-host-updates', evidence: 'pending_updates=6 inventory=leaked' }),
+ ),
+ ).toContain('could not safely present');
});
it.each([
- ['unsafe update count', 'apt-host-updates', 'pending_updates=999999999999999999999 inventory=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z reboot_required=false'],
- ['invalid update timestamp', 'apt-host-updates', 'pending_updates=6 inventory=sha256:x checked_at=not-a-time received_at=2026-07-12T10:05:00Z reboot_required=false'],
- ['dotted usage', 'apt-package-cache-pressure', 'reclaimable_bytes=100 filesystem_usage=9.1.5 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z'],
- ['NaN usage', 'apt-package-cache-pressure', 'reclaimable_bytes=100 filesystem_usage=NaN fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z'],
- ['usage above 100', 'apt-package-cache-pressure', 'reclaimable_bytes=100 filesystem_usage=100.1 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z'],
- ['unsafe reclaimable bytes', 'apt-package-cache-pressure', 'reclaimable_bytes=999999999999999999999 filesystem_usage=91.5 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z'],
- ['invalid cleanup timestamp', 'apt-package-cache-pressure', 'reclaimable_bytes=100 filesystem_usage=91.5 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=not-a-time'],
+ [
+ 'unsafe update count',
+ 'apt-host-updates',
+ 'pending_updates=999999999999999999999 inventory=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z reboot_required=false',
+ ],
+ [
+ 'invalid update timestamp',
+ 'apt-host-updates',
+ 'pending_updates=6 inventory=sha256:x checked_at=not-a-time received_at=2026-07-12T10:05:00Z reboot_required=false',
+ ],
+ [
+ 'dotted usage',
+ 'apt-package-cache-pressure',
+ 'reclaimable_bytes=100 filesystem_usage=9.1.5 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z',
+ ],
+ [
+ 'NaN usage',
+ 'apt-package-cache-pressure',
+ 'reclaimable_bytes=100 filesystem_usage=NaN fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z',
+ ],
+ [
+ 'usage above 100',
+ 'apt-package-cache-pressure',
+ 'reclaimable_bytes=100 filesystem_usage=100.1 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z',
+ ],
+ [
+ 'unsafe reclaimable bytes',
+ 'apt-package-cache-pressure',
+ 'reclaimable_bytes=999999999999999999999 filesystem_usage=91.5 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=2026-07-12T10:05:00Z',
+ ],
+ [
+ 'invalid cleanup timestamp',
+ 'apt-package-cache-pressure',
+ 'reclaimable_bytes=100 filesystem_usage=91.5 fingerprint=sha256:x checked_at=2026-07-12T10:00:00Z received_at=not-a-time',
+ ],
] as const)('uses the bounded fallback for %s', (_name, key, evidence) => {
- expect(getFindingEvidencePresentation(makeFinding({ key, evidence }))).toContain('could not safely present');
+ expect(getFindingEvidencePresentation(makeFinding({ key, evidence }))).toContain(
+ 'could not safely present',
+ );
});
});
diff --git a/frontend-modern/src/utils/__tests__/aiProviderPresentation.test.ts b/frontend-modern/src/utils/__tests__/aiProviderPresentation.test.ts
index 8396af0e7b..741329ad0f 100644
--- a/frontend-modern/src/utils/__tests__/aiProviderPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/aiProviderPresentation.test.ts
@@ -26,9 +26,7 @@ describe('aiProviderPresentation', () => {
it('detects providers from explicit prefixes and model naming heuristics', () => {
expect(getProviderFromModelId('openai:gpt-4o')).toBe('openai');
- expect(getProviderFromModelId('codex-subscription:gpt-5.6-luna')).toBe(
- 'codex-subscription',
- );
+ expect(getProviderFromModelId('codex-subscription:gpt-5.6-luna')).toBe('codex-subscription');
expect(getProviderFromModelId('claude-subscription:opus')).toBe('claude-subscription');
expect(getProviderFromModelId('anthropic/claude-sonnet-4.5')).toBe('openrouter');
expect(getProviderFromModelId('claude-3-5-sonnet')).toBe('anthropic');
@@ -78,9 +76,7 @@ describe('aiProviderPresentation', () => {
}),
).toBe('DeepSeek: DeepSeek V4 Pro');
- expect(formatAIModelRouteLabel('deepseek:deepseek-v4-pro')).toBe(
- 'DeepSeek: DeepSeek V4 Pro',
- );
+ expect(formatAIModelRouteLabel('deepseek:deepseek-v4-pro')).toBe('DeepSeek: DeepSeek V4 Pro');
});
it('does not duplicate an existing OpenRouter route label', () => {
diff --git a/frontend-modern/src/utils/__tests__/aiSettingsPresentation.branchcov0718.test.ts b/frontend-modern/src/utils/__tests__/aiSettingsPresentation.branchcov0718.test.ts
index 2d94502cbd..5b3a175fc6 100644
--- a/frontend-modern/src/utils/__tests__/aiSettingsPresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/utils/__tests__/aiSettingsPresentation.branchcov0718.test.ts
@@ -163,15 +163,11 @@ describe('getAISessionSummarizeErrorMessage — branch coverage', () => {
describe('getAISettingsSaveErrorMessage — branch coverage', () => {
it('falls back to the default fallback when message is null', () => {
- expect(getAISettingsSaveErrorMessage(null)).toBe(
- 'Unable to save Provider & Models settings.',
- );
+ expect(getAISettingsSaveErrorMessage(null)).toBe('Unable to save Provider & Models settings.');
});
it('falls back to the default fallback when message is the empty string', () => {
- expect(getAISettingsSaveErrorMessage('')).toBe(
- 'Unable to save Provider & Models settings.',
- );
+ expect(getAISettingsSaveErrorMessage('')).toBe('Unable to save Provider & Models settings.');
});
it('falls back to the default fallback when message is whitespace-only', () => {
@@ -215,9 +211,7 @@ describe('getAICredentialsClearErrorMessage — branch coverage', () => {
});
it('returns the trimmed detail for a padded non-empty message', () => {
- expect(getAICredentialsClearErrorMessage(' permission denied ')).toBe(
- 'permission denied',
- );
+ expect(getAICredentialsClearErrorMessage(' permission denied ')).toBe('permission denied');
});
});
diff --git a/frontend-modern/src/utils/__tests__/alertConfigPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/alertConfigPresentation.branchcov0712b.test.ts
index 5a98ca2c67..1da39a97b7 100644
--- a/frontend-modern/src/utils/__tests__/alertConfigPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertConfigPresentation.branchcov0712b.test.ts
@@ -66,9 +66,7 @@ describe('alertConfigPresentation — branch coverage (branchcov2)', () => {
expect(getAlertConfigSummaryGrouping(1, true, true)).toContain(
'1 minute windows by node and workload',
);
- expect(getAlertConfigSummaryGrouping(120, false, false)).toContain(
- '120 minute windows',
- );
+ expect(getAlertConfigSummaryGrouping(120, false, false)).toContain('120 minute windows');
});
});
@@ -76,34 +74,22 @@ describe('alertConfigPresentation — branch coverage (branchcov2)', () => {
it('uses the singular "level" form when exactly one level is configured', () => {
// The only input that takes the `levelCount === 1 ? ''` truthy arm
// (sibling test only covers the plural arm via levelCount=2).
- expect(getAlertConfigSummaryEscalation(1)).toBe(
- '• 1 escalation level configured',
- );
+ expect(getAlertConfigSummaryEscalation(1)).toBe('• 1 escalation level configured');
});
it('uses the plural "levels" form for counts other than 1', () => {
// Drives the ternary's falsy arm across representative boundaries:
// zero, two, and a larger count.
- expect(getAlertConfigSummaryEscalation(0)).toBe(
- '• 0 escalation levels configured',
- );
- expect(getAlertConfigSummaryEscalation(2)).toBe(
- '• 2 escalation levels configured',
- );
- expect(getAlertConfigSummaryEscalation(5)).toBe(
- '• 5 escalation levels configured',
- );
+ expect(getAlertConfigSummaryEscalation(0)).toBe('• 0 escalation levels configured');
+ expect(getAlertConfigSummaryEscalation(2)).toBe('• 2 escalation levels configured');
+ expect(getAlertConfigSummaryEscalation(5)).toBe('• 5 escalation levels configured');
});
it('interpolates the count verbatim into the prefix bullet', () => {
// Confirms the template literal wiring: bullet, count, then the fixed
// trailing copy. Guards against accidental prefix changes.
- expect(getAlertConfigSummaryEscalation(3)).toBe(
- '• 3 escalation levels configured',
- );
- expect(getAlertConfigSummaryEscalation(1)).toMatch(
- /^• 1 escalation level configured$/,
- );
+ expect(getAlertConfigSummaryEscalation(3)).toBe('• 3 escalation levels configured');
+ expect(getAlertConfigSummaryEscalation(1)).toMatch(/^• 1 escalation level configured$/);
});
});
});
diff --git a/frontend-modern/src/utils/__tests__/alertConfigPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertConfigPresentation.test.ts
index edc4538a01..5628f16e37 100644
--- a/frontend-modern/src/utils/__tests__/alertConfigPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertConfigPresentation.test.ts
@@ -79,9 +79,7 @@ describe('alertConfigPresentation', () => {
'Restore quiet hours, cooldown, grouping, and escalation settings to their defaults',
);
expect(ALERT_CONFIG_SCHEDULING_TITLE).toBe('Alert scheduling');
- expect(ALERT_CONFIG_SCHEDULING_DESCRIPTION).toBe(
- 'Configure when and how alerts are delivered',
- );
+ expect(ALERT_CONFIG_SCHEDULING_DESCRIPTION).toBe('Configure when and how alerts are delivered');
expect(ALERT_CONFIG_QUIET_HOURS_TITLE).toBe('Quiet hours');
expect(ALERT_CONFIG_QUIET_HOURS_DESCRIPTION).toBe(
'Pause non-critical alerts during specific times.',
@@ -90,9 +88,7 @@ describe('alertConfigPresentation', () => {
expect(ALERT_CONFIG_QUIET_HOURS_END_TIME_LABEL).toBe('End time');
expect(ALERT_CONFIG_QUIET_HOURS_TIMEZONE_LABEL).toBe('Timezone');
expect(ALERT_CONFIG_COOLDOWN_TITLE).toBe('Alert cooldown');
- expect(ALERT_CONFIG_COOLDOWN_DESCRIPTION).toBe(
- 'Limit alert frequency to prevent spam.',
- );
+ expect(ALERT_CONFIG_COOLDOWN_DESCRIPTION).toBe('Limit alert frequency to prevent spam.');
expect(ALERT_CONFIG_COOLDOWN_PERIOD_LABEL).toBe('Cooldown period');
expect(ALERT_CONFIG_COOLDOWN_PERIOD_SUFFIX).toBe('minutes');
expect(ALERT_CONFIG_COOLDOWN_PERIOD_HELP).toBe(
@@ -142,9 +138,7 @@ describe('alertConfigPresentation', () => {
expect(ALERT_CONFIG_ESCALATION_NOTIFY_WEBHOOKS).toBe('Webhooks');
expect(ALERT_CONFIG_ESCALATION_NOTIFY_ALL).toBe('All channels');
expect(ALERT_CONFIG_SUMMARY_TITLE).toBe('Configuration summary');
- expect(ALERT_CONFIG_SUMMARY_DESCRIPTION).toBe(
- 'Preview of the active schedule settings.',
- );
+ expect(ALERT_CONFIG_SUMMARY_DESCRIPTION).toBe('Preview of the active schedule settings.');
expect(ALERT_CONFIG_SUMMARY_ALL_DISABLED).toBe(
'• All notification controls are disabled - alerts will be sent immediately',
);
@@ -188,15 +182,11 @@ describe('alertConfigPresentation', () => {
expect(getAlertConfigRecoveryHelp()).toBe(
'Sends on the same channels as live alerts to confirm when a condition clears.',
);
- expect(getAlertConfigEscalationHelp()).toBe(
- 'Define escalation levels for unresolved alerts:',
- );
+ expect(getAlertConfigEscalationHelp()).toBe('Define escalation levels for unresolved alerts:');
expect(getAlertConfigEscalationNotifyLabel('email')).toBe('Email');
expect(getAlertConfigEscalationNotifyLabel('webhook')).toBe('Webhooks');
expect(getAlertConfigEscalationNotifyLabel('all')).toBe('All channels');
- expect(getAlertConfigSummaryRecoveryEnabled()).toBe(
- ALERT_CONFIG_SUMMARY_RECOVERY,
- );
+ expect(getAlertConfigSummaryRecoveryEnabled()).toBe(ALERT_CONFIG_SUMMARY_RECOVERY);
expect(getAlertConfigSummaryEscalation(2)).toBe('• 2 escalation levels configured');
expect(getAlertConfigSummaryAllDisabled()).toBe(
'• All notification controls are disabled - alerts will be sent immediately',
diff --git a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.branchcov0718.test.ts b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.branchcov0718.test.ts
index b412821bde..2472c4256e 100644
--- a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.branchcov0718.test.ts
@@ -199,9 +199,7 @@ describe('alertDestinationsPresentation.branchcov0718', () => {
it('exposes the apprise TLS vocabulary', () => {
expect(ALERT_DESTINATIONS_APPRISE_TLS_LABEL).toBe('TLS verification');
- expect(ALERT_DESTINATIONS_APPRISE_TLS_CHECKBOX_LABEL).toBe(
- 'Allow self-signed certificates',
- );
+ expect(ALERT_DESTINATIONS_APPRISE_TLS_CHECKBOX_LABEL).toBe('Allow self-signed certificates');
expect(ALERT_DESTINATIONS_APPRISE_TLS_HELP).toBe(
'Enable only when the Apprise API uses a self-signed certificate.',
);
diff --git a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
index 1e1df3a8a8..54b66044f7 100644
--- a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
@@ -92,26 +92,14 @@ describe('alertDestinationsPresentation', () => {
expect(getAlertDestinationsAppriseValidationError('missingServerUrl')).toBe(
ALERT_DESTINATIONS_APPRISE_MISSING_SERVER_URL_ERROR,
);
- expect(ALERT_DESTINATIONS_EMAIL_TEST_SUCCESS).toBe(
- 'Test email sent. Check your inbox.',
- );
+ expect(ALERT_DESTINATIONS_EMAIL_TEST_SUCCESS).toBe('Test email sent. Check your inbox.');
expect(ALERT_DESTINATIONS_EMAIL_TEST_FAILURE).toBe('Unable to send the test email.');
- expect(getAlertDestinationsEmailTestSuccess()).toBe(
- 'Test email sent. Check your inbox.',
- );
+ expect(getAlertDestinationsEmailTestSuccess()).toBe('Test email sent. Check your inbox.');
expect(getAlertDestinationsEmailTestFailure()).toBe('Unable to send the test email.');
- expect(ALERT_DESTINATIONS_APPRISE_TEST_SUCCESS).toBe(
- 'Test Apprise notification sent.',
- );
- expect(ALERT_DESTINATIONS_APPRISE_TEST_FAILURE).toBe(
- 'Unable to send the test notification.',
- );
- expect(getAlertDestinationsAppriseTestSuccess()).toBe(
- 'Test Apprise notification sent.',
- );
- expect(getAlertDestinationsAppriseTestFailure()).toBe(
- 'Unable to send the test notification.',
- );
+ expect(ALERT_DESTINATIONS_APPRISE_TEST_SUCCESS).toBe('Test Apprise notification sent.');
+ expect(ALERT_DESTINATIONS_APPRISE_TEST_FAILURE).toBe('Unable to send the test notification.');
+ expect(getAlertDestinationsAppriseTestSuccess()).toBe('Test Apprise notification sent.');
+ expect(getAlertDestinationsAppriseTestFailure()).toBe('Unable to send the test notification.');
});
it('returns canonical mobile push destination copy', () => {
diff --git a/frontend-modern/src/utils/__tests__/alertEmailPresentation.branchcov0718.test.ts b/frontend-modern/src/utils/__tests__/alertEmailPresentation.branchcov0718.test.ts
index e6925d68b2..ef5f5692cc 100644
--- a/frontend-modern/src/utils/__tests__/alertEmailPresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertEmailPresentation.branchcov0718.test.ts
@@ -164,15 +164,11 @@ describe('alertEmailPresentation — branch coverage (batch 0718)', () => {
describe('getAlertEmailAdvancedToggleLabel — exact constant wiring', () => {
it('returns the canonical HIDE constant for true', () => {
- expect(getAlertEmailAdvancedToggleLabel(true)).toBe(
- ALERT_EMAIL_HIDE_ADVANCED_OPTIONS_LABEL,
- );
+ expect(getAlertEmailAdvancedToggleLabel(true)).toBe(ALERT_EMAIL_HIDE_ADVANCED_OPTIONS_LABEL);
});
it('returns the canonical SHOW constant for false', () => {
- expect(getAlertEmailAdvancedToggleLabel(false)).toBe(
- ALERT_EMAIL_SHOW_ADVANCED_OPTIONS_LABEL,
- );
+ expect(getAlertEmailAdvancedToggleLabel(false)).toBe(ALERT_EMAIL_SHOW_ADVANCED_OPTIONS_LABEL);
});
});
diff --git a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0712b.test.ts
index ff38e14e95..093420ab23 100644
--- a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0712b.test.ts
@@ -129,7 +129,9 @@ describe('getAlertResourceIncidentLoadFailure — branch coverage', () => {
describe('getAlertResourceIncidentNoteSaveFailure — branch coverage', () => {
it('returns the canonical note-save-failure string and matches the exported constant', () => {
expect(getAlertResourceIncidentNoteSaveFailure()).toBe('Failed to save incident note');
- expect(getAlertResourceIncidentNoteSaveFailure()).toBe(ALERT_RESOURCE_INCIDENT_NOTE_SAVE_FAILURE);
+ expect(getAlertResourceIncidentNoteSaveFailure()).toBe(
+ ALERT_RESOURCE_INCIDENT_NOTE_SAVE_FAILURE,
+ );
});
});
diff --git a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0717.test.ts b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0717.test.ts
index 59179f89e0..b62a59db73 100644
--- a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0717.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.branchcov0717.test.ts
@@ -111,8 +111,7 @@ describe('getAlertIncidentStatusPresentation — switch branch coverage', () =>
it('hits the "open" case', () => {
expect(getAlertIncidentStatusPresentation('open')).toStrictEqual({
label: 'open',
- className:
- 'px-2 py-0.5 rounded bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-300',
+ className: 'px-2 py-0.5 rounded bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-300',
});
});
@@ -348,7 +347,8 @@ describe('event-filter class helpers — variant + selected branch coverage', ()
});
it('getAlertIncidentEventFilterChipClass returns the selected (blue) chip regardless of variant', () => {
- const selected = 'px-2 py-0.5 rounded border text-[10px] transition-colors border-blue-300 bg-blue-100 text-blue-700 dark:border-blue-800 dark:bg-blue-900 dark:text-blue-300';
+ const selected =
+ 'px-2 py-0.5 rounded border text-[10px] transition-colors border-blue-300 bg-blue-100 text-blue-700 dark:border-blue-800 dark:bg-blue-900 dark:text-blue-300';
// selected short-circuits before the variant check, so both variants are equal.
expect(getAlertIncidentEventFilterChipClass(true, 'compact')).toBe(selected);
expect(getAlertIncidentEventFilterChipClass(true, 'panel')).toBe(selected);
@@ -419,9 +419,9 @@ describe('getAlertResourceIncidentTruncatedEventsLabel — branch coverage', ()
});
it('returns the bare form when totalCount is a non-number type (typeof false arm)', () => {
- expect(
- getAlertResourceIncidentTruncatedEventsLabel(5, 'many' as unknown as number),
- ).toBe('Showing last 5 events');
+ expect(getAlertResourceIncidentTruncatedEventsLabel(5, 'many' as unknown as number)).toBe(
+ 'Showing last 5 events',
+ );
});
it('returns "Showing N events" when totalCount is a number <= count (singular at 1)', () => {
@@ -444,8 +444,6 @@ describe('getAlertResourceIncidentTruncatedEventsLabel — branch coverage', ()
it('returns "Showing last count of totalCount events" when totalCount > count', () => {
// totalCount <= count false arm.
- expect(getAlertResourceIncidentTruncatedEventsLabel(5, 12)).toBe(
- 'Showing last 5 of 12 events',
- );
+ expect(getAlertResourceIncidentTruncatedEventsLabel(5, 12)).toBe('Showing last 5 of 12 events');
});
});
diff --git a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.ts
index 033dffec06..c4e5b10661 100644
--- a/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertIncidentPresentation.test.ts
@@ -63,8 +63,7 @@ describe('alertIncidentPresentation', () => {
expect(getAlertIncidentStatusPresentation('open', false)).toEqual({
label: 'open',
- className:
- 'px-2 py-0.5 rounded bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-300',
+ className: 'px-2 py-0.5 rounded bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-300',
});
expect(getAlertIncidentStatusPresentation('resolved', false)).toEqual({
@@ -191,9 +190,7 @@ describe('alertIncidentPresentation', () => {
});
it('returns canonical resource incident card presentation classes', () => {
- expect(getAlertResourceIncidentCardClass()).toBe(
- 'rounded border border-border bg-surface p-3',
- );
+ expect(getAlertResourceIncidentCardClass()).toBe('rounded border border-border bg-surface p-3');
expect(getAlertResourceIncidentSummaryRowClass()).toBe(
'mt-2 flex flex-wrap items-center justify-between gap-2 text-xs text-muted',
);
diff --git a/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.branchcov0718.test.ts b/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.branchcov0718.test.ts
index 3ee70af4b8..25ee1096fc 100644
--- a/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.branchcov0718.test.ts
@@ -58,9 +58,7 @@ describe('alertResourceTablePresentation.branchcov0718', () => {
});
it('lowercases a multi-word title phrase', () => {
- expect(getAlertResourceTableNoResultsState('Alert Rules')).toBe(
- 'No alert rules found',
- );
+ expect(getAlertResourceTableNoResultsState('Alert Rules')).toBe('No alert rules found');
});
it('passes an already-lowercase title through unchanged', () => {
@@ -94,9 +92,7 @@ describe('alertResourceTablePresentation.branchcov0718', () => {
const bogus = 'info' as unknown as AlertResourceTableOfflineState;
const presentation = getAlertResourceTableOfflineStatePresentation(bogus);
expect(presentation.label).toBe('Crit');
- expect(presentation.title).toBe(
- 'Offline alerts will raise critical-level notifications.',
- );
+ expect(presentation.title).toBe('Offline alerts will raise critical-level notifications.');
});
});
@@ -124,9 +120,7 @@ describe('alertResourceTablePresentation.branchcov0718', () => {
// helpers. Pin the underlying constants directly so a rename is caught
// even if the helper return values stay stable.
it('exposes the enable/disable metric-input title constants', () => {
- expect(ALERT_RESOURCE_TABLE_ENABLE_METRIC_TITLE).toBe(
- 'Click to enable this metric',
- );
+ expect(ALERT_RESOURCE_TABLE_ENABLE_METRIC_TITLE).toBe('Click to enable this metric');
expect(ALERT_RESOURCE_TABLE_DISABLE_METRIC_TITLE).toBe(
'Set to -1 to disable alerts for this metric',
);
diff --git a/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.test.ts b/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.test.ts
index bfe7f098c5..9c351e557e 100644
--- a/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertResourceTablePresentation.test.ts
@@ -50,9 +50,7 @@ describe('alertResourceTablePresentation', () => {
'Add a note about this override (optional)',
);
expect(ALERT_RESOURCE_TABLE_EDIT_NOTE_PLACEHOLDER).toBe('Add a note...');
- expect(ALERT_RESOURCE_TABLE_RESET_FACTORY_DEFAULTS_LABEL).toBe(
- 'Reset to factory defaults',
- );
+ expect(ALERT_RESOURCE_TABLE_RESET_FACTORY_DEFAULTS_LABEL).toBe('Reset to factory defaults');
expect(ALERT_RESOURCE_TABLE_REVERT_TO_DEFAULTS_LABEL).toBe('Revert to defaults');
expect(ALERT_RESOURCE_TABLE_ALERT_DELAY_LABEL).toBe('Alert Delay (s)');
expect(ALERT_RESOURCE_TABLE_OFFLINE_STATE_OFF_LABEL).toBe('Off');
@@ -74,9 +72,7 @@ describe('alertResourceTablePresentation', () => {
'Add a note about this override (optional)',
);
expect(getAlertResourceTableEditNotePlaceholder()).toBe('Add a note...');
- expect(getAlertResourceTableResetFactoryDefaultsLabel()).toBe(
- 'Reset to factory defaults',
- );
+ expect(getAlertResourceTableResetFactoryDefaultsLabel()).toBe('Reset to factory defaults');
expect(getAlertResourceTableRevertToDefaultsLabel()).toBe('Revert to defaults');
expect(getAlertResourceTableAlertDelayLabel()).toBe('Alert Delay (s)');
expect(getAlertResourceTableOfflineStateOrder()).toEqual(['off', 'warning', 'critical']);
@@ -97,9 +93,7 @@ describe('alertResourceTablePresentation', () => {
'bg-red-50 text-red-700 hover:bg-red-100 dark:bg-red-900 dark:text-red-200 dark:hover:bg-red-800',
title: 'Offline alerts will raise critical-level notifications.',
});
- expect(getAlertResourceTableMetricInputTitle(true)).toBe(
- 'Click to enable this metric',
- );
+ expect(getAlertResourceTableMetricInputTitle(true)).toBe('Click to enable this metric');
expect(getAlertResourceTableMetricInputTitle(false)).toBe(
'Set to -1 to disable alerts for this metric',
);
diff --git a/frontend-modern/src/utils/__tests__/alertThresholdsPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertThresholdsPresentation.test.ts
index c667bd7848..4b7cbc7471 100644
--- a/frontend-modern/src/utils/__tests__/alertThresholdsPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertThresholdsPresentation.test.ts
@@ -63,20 +63,28 @@ describe('alertThresholdsPresentation', () => {
'No virtualization hosts match the current filters.',
);
expect(PBS_THRESHOLDS_FILTER_EMPTY_STATE).toBe('No PBS servers match the current filters.');
- expect(GUEST_THRESHOLDS_FILTER_EMPTY_STATE).toBe('No VMs or containers match the current filters.');
+ expect(GUEST_THRESHOLDS_FILTER_EMPTY_STATE).toBe(
+ 'No VMs or containers match the current filters.',
+ );
expect(GUEST_FILTERING_EMPTY_STATE).toBe('Configure VM and container filtering rules.');
expect(BACKUP_THRESHOLDS_EMPTY_STATE).toBe('Configure recovery alert thresholds.');
expect(SNAPSHOT_THRESHOLDS_EMPTY_STATE).toBe('Configure snapshot age thresholds.');
expect(STORAGE_THRESHOLDS_EMPTY_STATE).toBe('No storage devices found.');
- expect(STORAGE_THRESHOLDS_FILTER_EMPTY_STATE).toBe('No storage devices match the current filters.');
+ expect(STORAGE_THRESHOLDS_FILTER_EMPTY_STATE).toBe(
+ 'No storage devices match the current filters.',
+ );
expect(PMG_THRESHOLDS_EMPTY_STATE).toBe(
'No mail gateways configured yet. Add a Proxmox Mail Gateway connection in Settings → Infrastructure to manage thresholds.',
);
expect(PMG_THRESHOLDS_FILTER_EMPTY_STATE).toBe('No mail gateways match the current filters.');
expect(AGENT_THRESHOLDS_FILTER_EMPTY_STATE).toBe('No machines match the current filters.');
- expect(AGENT_DISKS_EMPTY_STATE).toContain('Machines with mounted filesystems will appear here.');
+ expect(AGENT_DISKS_EMPTY_STATE).toContain(
+ 'Machines with mounted filesystems will appear here.',
+ );
expect(AGENT_DISKS_FILTER_EMPTY_STATE).toBe('No machine disks match the current filters.');
- expect(CONTAINER_RUNTIMES_FILTER_EMPTY_STATE).toBe('No container runtimes match the current filters.');
+ expect(CONTAINER_RUNTIMES_FILTER_EMPTY_STATE).toBe(
+ 'No container runtimes match the current filters.',
+ );
expect(CONTAINERS_FILTER_EMPTY_STATE).toBe('No containers match the current filters.');
});
diff --git a/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0712b.test.ts
index 9a82de824a..c9bb39f770 100644
--- a/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0712b.test.ts
@@ -256,9 +256,7 @@ describe('alertWebhookPresentation (branch coverage 2)', () => {
it('returns the delete failure message for any non-matching action (default arm)', () => {
expect(
getAlertWebhookMutationFailure(
- 'totally-bogus' as unknown as Parameters<
- typeof getAlertWebhookMutationFailure
- >[0],
+ 'totally-bogus' as unknown as Parameters<typeof getAlertWebhookMutationFailure>[0],
),
).toBe('Failed to delete webhook');
});
diff --git a/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0717.test.ts b/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0717.test.ts
index afddf0f4d6..27af182df7 100644
--- a/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0717.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertWebhookPresentation.branchcov0717.test.ts
@@ -34,9 +34,7 @@ describe('alertWebhookPresentation branch coverage (supplemental 0717)', () => {
describe('getAlertWebhookNamePlaceholder', () => {
it('echoes a provided template name (|| left operand)', () => {
- expect(getAlertWebhookNamePlaceholder('Discord Incidents')).toBe(
- 'Discord Incidents',
- );
+ expect(getAlertWebhookNamePlaceholder('Discord Incidents')).toBe('Discord Incidents');
});
it('falls back to the default placeholder when the name is undefined (|| right operand)', () => {
@@ -50,21 +48,17 @@ describe('alertWebhookPresentation branch coverage (supplemental 0717)', () => {
describe('getAlertWebhookUrlPlaceholder', () => {
it('echoes a provided url pattern (|| left operand)', () => {
- expect(
- getAlertWebhookUrlPlaceholder('https://discord.com/api/webhooks/123'),
- ).toBe('https://discord.com/api/webhooks/123');
+ expect(getAlertWebhookUrlPlaceholder('https://discord.com/api/webhooks/123')).toBe(
+ 'https://discord.com/api/webhooks/123',
+ );
});
it('falls back to the default URL placeholder when undefined (|| right operand)', () => {
- expect(getAlertWebhookUrlPlaceholder(undefined)).toBe(
- 'https://example.com/webhook',
- );
+ expect(getAlertWebhookUrlPlaceholder(undefined)).toBe('https://example.com/webhook');
});
it('falls back to the default URL placeholder when the pattern is empty (falsy || arm)', () => {
- expect(getAlertWebhookUrlPlaceholder('')).toBe(
- 'https://example.com/webhook',
- );
+ expect(getAlertWebhookUrlPlaceholder('')).toBe('https://example.com/webhook');
});
});
@@ -134,29 +128,21 @@ describe('alertWebhookPresentation branch coverage (supplemental 0717)', () => {
describe('getAlertWebhookMutationSuccess', () => {
it('maps the "add" action to the add-success message', () => {
- expect(getAlertWebhookMutationSuccess('add')).toBe(
- 'Webhook added successfully',
- );
+ expect(getAlertWebhookMutationSuccess('add')).toBe('Webhook added successfully');
});
it('maps the "update" action to the update-success message', () => {
- expect(getAlertWebhookMutationSuccess('update')).toBe(
- 'Webhook updated successfully',
- );
+ expect(getAlertWebhookMutationSuccess('update')).toBe('Webhook updated successfully');
});
it('maps the "delete" action to the delete-success message', () => {
- expect(getAlertWebhookMutationSuccess('delete')).toBe(
- 'Webhook deleted successfully',
- );
+ expect(getAlertWebhookMutationSuccess('delete')).toBe('Webhook deleted successfully');
});
it('routes any unrecognised action through the default arm to the delete-success message', () => {
- expect(
- getAlertWebhookMutationSuccess(
- 'nuke' as unknown as 'add' | 'update' | 'delete',
- ),
- ).toBe('Webhook deleted successfully');
+ expect(getAlertWebhookMutationSuccess('nuke' as unknown as 'add' | 'update' | 'delete')).toBe(
+ 'Webhook deleted successfully',
+ );
});
});
@@ -275,11 +261,7 @@ describe('alertWebhookPresentation branch coverage (supplemental 0717)', () => {
priority: '1',
});
// Presets first, then the filtered extras (priority is not a preset key).
- expect(inputs.map((i) => i.key)).toStrictEqual([
- 'token',
- 'user',
- 'priority',
- ]);
+ expect(inputs.map((i) => i.key)).toStrictEqual(['token', 'user', 'priority']);
const priority = inputs.find((i) => i.key === 'priority');
expect(priority).toStrictEqual({ key: 'priority', value: '1' });
});
diff --git a/frontend-modern/src/utils/__tests__/alerts.coverage.test.ts b/frontend-modern/src/utils/__tests__/alerts.coverage.test.ts
index e436d666cd..bd35e3885c 100644
--- a/frontend-modern/src/utils/__tests__/alerts.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/alerts.coverage.test.ts
@@ -42,14 +42,12 @@ describe('isStateAlertType', () => {
expect(isStateAlertType('')).toBe(false);
});
- it.each([
- 'Powered-Off',
- 'UNREACHABLE',
- 'Offline',
- 'Host-Offline',
- ])('is case-sensitive: %s is not a state alert type', (alertType) => {
- expect(isStateAlertType(alertType)).toBe(false);
- });
+ it.each(['Powered-Off', 'UNREACHABLE', 'Offline', 'Host-Offline'])(
+ 'is case-sensitive: %s is not a state alert type',
+ (alertType) => {
+ expect(isStateAlertType(alertType)).toBe(false);
+ },
+ );
it.each([' powered-off', 'powered-off ', 'unreachable\n', '\toffline'])(
'does not match state types with surrounding whitespace: %j',
diff --git a/frontend-modern/src/utils/__tests__/apiTokenPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/apiTokenPresentation.branchcov0712b.test.ts
index 6d9e5fa7b2..ef3469a1e6 100644
--- a/frontend-modern/src/utils/__tests__/apiTokenPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/apiTokenPresentation.branchcov0712b.test.ts
@@ -44,11 +44,12 @@ describe('apiTokenPresentation — branch coverage (branchcov2)', () => {
it('returns the trimmed message when it starts with "Cannot grant scope" (trim + startsWith true arm)', () => {
// Drives `typedError.message.trim()` and the `startsWith('Cannot grant scope')`
// true arm: leading/trailing whitespace is stripped before the message is echoed.
- const error = Object.assign(
- new Error(' Cannot grant scope "ai:execute": denied '),
- { status: 403 },
+ const error = Object.assign(new Error(' Cannot grant scope "ai:execute": denied '), {
+ status: 403,
+ });
+ expect(getAPITokenGenerateErrorMessage(error)).toBe(
+ 'Cannot grant scope "ai:execute": denied',
);
- expect(getAPITokenGenerateErrorMessage(error)).toBe('Cannot grant scope "ai:execute": denied');
});
it('falls through to the default for a 403 message that matches neither sentinel', () => {
@@ -117,9 +118,7 @@ describe('apiTokenPresentation — branch coverage (branchcov2)', () => {
count: 1,
items: [{ label: 'Edge Node' }],
};
- expect(getAPITokenDockerPodmanUsageTitle(entry)).toBe(
- 'Docker / Podman runtimes: Edge Node',
- );
+ expect(getAPITokenDockerPodmanUsageTitle(entry)).toBe('Docker / Podman runtimes: Edge Node');
});
it('drops falsy labels and joins the remaining truthy ones with ", "', () => {
diff --git a/frontend-modern/src/utils/__tests__/approvalState.test.ts b/frontend-modern/src/utils/__tests__/approvalState.test.ts
index ed4775ddc4..7897078f50 100644
--- a/frontend-modern/src/utils/__tests__/approvalState.test.ts
+++ b/frontend-modern/src/utils/__tests__/approvalState.test.ts
@@ -17,15 +17,15 @@ describe('approvalState', () => {
});
it('keeps only pending approvals with a future parseable expiry live', () => {
- expect(isLivePendingApproval({ status: 'pending', expiresAt: '2026-05-07T10:05:00Z' }, now)).toBe(
- true,
- );
- expect(isLivePendingApproval({ status: 'pending', expiresAt: '2026-05-07T09:59:00Z' }, now)).toBe(
- false,
- );
- expect(isLivePendingApproval({ status: 'approved', expiresAt: '2026-05-07T10:05:00Z' }, now)).toBe(
- false,
- );
+ expect(
+ isLivePendingApproval({ status: 'pending', expiresAt: '2026-05-07T10:05:00Z' }, now),
+ ).toBe(true);
+ expect(
+ isLivePendingApproval({ status: 'pending', expiresAt: '2026-05-07T09:59:00Z' }, now),
+ ).toBe(false);
+ expect(
+ isLivePendingApproval({ status: 'approved', expiresAt: '2026-05-07T10:05:00Z' }, now),
+ ).toBe(false);
});
it('fails closed when a pending approval expiry is malformed or missing', () => {
diff --git a/frontend-modern/src/utils/__tests__/auditLogPresentation.branchcov0713.test.ts b/frontend-modern/src/utils/__tests__/auditLogPresentation.branchcov0713.test.ts
index 83824973d9..2281525760 100644
--- a/frontend-modern/src/utils/__tests__/auditLogPresentation.branchcov0713.test.ts
+++ b/frontend-modern/src/utils/__tests__/auditLogPresentation.branchcov0713.test.ts
@@ -42,28 +42,20 @@ describe('getAuditEventTypeBadgeClass (branch coverage)', () => {
});
it('routes an unrecognised event type through the default arm', () => {
- expect(getAuditEventTypeBadgeClass('something_new')).toBe(
- 'bg-surface-alt text-base-content',
- );
+ expect(getAuditEventTypeBadgeClass('something_new')).toBe('bg-surface-alt text-base-content');
});
it('coerces undefined to an empty trimmed string and lands on the default arm', () => {
- expect(getAuditEventTypeBadgeClass(undefined)).toBe(
- 'bg-surface-alt text-base-content',
- );
+ expect(getAuditEventTypeBadgeClass(undefined)).toBe('bg-surface-alt text-base-content');
});
it('honours the nullish-coalesce fallback for an explicit null argument', () => {
// `(null ?? '').trim()` -> '' -> default case.
- expect(getAuditEventTypeBadgeClass(null)).toBe(
- 'bg-surface-alt text-base-content',
- );
+ expect(getAuditEventTypeBadgeClass(null)).toBe('bg-surface-alt text-base-content');
});
it('treats whitespace-only input as empty after trimming', () => {
- expect(getAuditEventTypeBadgeClass(' ')).toBe(
- 'bg-surface-alt text-base-content',
- );
+ expect(getAuditEventTypeBadgeClass(' ')).toBe('bg-surface-alt text-base-content');
});
it('keeps the three coloured badges distinct from the default surface badge', () => {
@@ -157,7 +149,9 @@ describe('getAuditLogFetchErrorMessage (branch coverage)', () => {
it('maps a matching message to the internal-error copy even without a 500 status', () => {
// Regex operand of the || is true while status operand is absent.
expect(
- getAuditLogFetchErrorMessage({ message: 'failed to fetch audit events: internal server error' }),
+ getAuditLogFetchErrorMessage({
+ message: 'failed to fetch audit events: internal server error',
+ }),
).toBe(
'Audit events could not be loaded because the server returned an internal error. Check the server logs, then refresh the audit log.',
);
diff --git a/frontend-modern/src/utils/__tests__/auditWebhookPresentation.branchcov0718.test.ts b/frontend-modern/src/utils/__tests__/auditWebhookPresentation.branchcov0718.test.ts
index c24385ac00..e1d8dc14d2 100644
--- a/frontend-modern/src/utils/__tests__/auditWebhookPresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/utils/__tests__/auditWebhookPresentation.branchcov0718.test.ts
@@ -96,9 +96,7 @@ describe('auditWebhookPresentation — branch coverage (batch 0718)', () => {
it('returns commercial copy for explicit paidRuntimeRequired: false with showCommercialCopy omitted (undefined !== false)', () => {
// Documents that omitting showCommercialCopy is equivalent to
// showCommercialCopy: true — the `!== false` default-on behaviour.
- expect(
- getAuditWebhookFeatureGateCopy({ paidRuntimeRequired: false }),
- ).toEqual({
+ expect(getAuditWebhookFeatureGateCopy({ paidRuntimeRequired: false })).toEqual({
title: 'Audit Webhooks',
body: 'Audit webhook delivery is available on paid self-hosted and hosted plans.',
});
diff --git a/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov0719.test.ts b/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov0719.test.ts
index 4394555b32..90a9a2a4f1 100644
--- a/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov0719.test.ts
+++ b/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov0719.test.ts
@@ -129,7 +129,10 @@ describe('getAvailabilityProbeEndpointLabel — branch coverage (primary target)
it('returns the bare address when port is the wrong type (string)', () => {
expect(
- getAvailabilityProbeEndpointLabel({ address: 'example.com', port: 'abc' as unknown as number }),
+ getAvailabilityProbeEndpointLabel({
+ address: 'example.com',
+ port: 'abc' as unknown as number,
+ }),
).toBe('example.com');
});
diff --git a/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov2.test.ts
index d37b202aa5..272b203bd1 100644
--- a/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/availabilityProbePresentation.branchcov2.test.ts
@@ -49,9 +49,7 @@ describe('normalizeAvailabilityProtocol — branch coverage (via getAvailability
});
it('coerces a null protocol to an empty (unknown) protocol', () => {
- expect(
- getAvailabilityProbeMethodLabel({ protocol: null as unknown as string }),
- ).toBe('Probe');
+ expect(getAvailabilityProbeMethodLabel({ protocol: null as unknown as string })).toBe('Probe');
});
it('trims and lowercases a cased/whitespace-padded protocol before matching', () => {
@@ -136,15 +134,11 @@ describe('getAvailabilityProbeTargetLabel — branch coverage', () => {
});
it('returns the trimmed path for http with a path', () => {
- expect(getAvailabilityProbeTargetLabel({ protocol: 'http', path: '/status' })).toBe(
- '/status',
- );
+ expect(getAvailabilityProbeTargetLabel({ protocol: 'http', path: '/status' })).toBe('/status');
});
it('returns the trimmed path for https with a path', () => {
- expect(getAvailabilityProbeTargetLabel({ protocol: 'https', path: '/ready' })).toBe(
- '/ready',
- );
+ expect(getAvailabilityProbeTargetLabel({ protocol: 'https', path: '/ready' })).toBe('/ready');
});
it('returns null for http with no path', () => {
diff --git a/frontend-modern/src/utils/__tests__/confidencePresentation.branchcov0713.test.ts b/frontend-modern/src/utils/__tests__/confidencePresentation.branchcov0713.test.ts
index 801fd1371a..71df3e230d 100644
--- a/frontend-modern/src/utils/__tests__/confidencePresentation.branchcov0713.test.ts
+++ b/frontend-modern/src/utils/__tests__/confidencePresentation.branchcov0713.test.ts
@@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest';
-import {
- formatConfidenceLabel,
- formatConfidencePercentage,
-} from '@/utils/confidencePresentation';
+import { formatConfidenceLabel, formatConfidencePercentage } from '@/utils/confidencePresentation';
describe('confidencePresentation — branch coverage (branchcov0713)', () => {
describe('formatConfidencePercentage — Number.isFinite guard arm', () => {
diff --git a/frontend-modern/src/utils/__tests__/confidencePresentation.test.ts b/frontend-modern/src/utils/__tests__/confidencePresentation.test.ts
index d830c18331..d4fdf61759 100644
--- a/frontend-modern/src/utils/__tests__/confidencePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/confidencePresentation.test.ts
@@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest';
-import {
- formatConfidenceLabel,
- formatConfidencePercentage,
-} from '@/utils/confidencePresentation';
+import { formatConfidenceLabel, formatConfidencePercentage } from '@/utils/confidencePresentation';
describe('confidencePresentation', () => {
it('formats shared confidence percentages', () => {
diff --git a/frontend-modern/src/utils/__tests__/connectionErrorPresentation.test.ts b/frontend-modern/src/utils/__tests__/connectionErrorPresentation.test.ts
index 79c682d3c3..54dd56ea45 100644
--- a/frontend-modern/src/utils/__tests__/connectionErrorPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/connectionErrorPresentation.test.ts
@@ -45,9 +45,7 @@ describe('humanizeConnectionError', () => {
});
it('classifies HTTP 401 as authentication failed', () => {
- const result = humanizeConnectionError(
- 'Get "https://pve/api2/json/version": 401 Unauthorized',
- );
+ const result = humanizeConnectionError('Get "https://pve/api2/json/version": 401 Unauthorized');
expect(result?.headline).toBe('Authentication failed');
});
diff --git a/frontend-modern/src/utils/__tests__/diagnosticsPresentation.test.ts b/frontend-modern/src/utils/__tests__/diagnosticsPresentation.test.ts
index f066a0e208..c76b182474 100644
--- a/frontend-modern/src/utils/__tests__/diagnosticsPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/diagnosticsPresentation.test.ts
@@ -28,8 +28,6 @@ describe('diagnosticsPresentation', () => {
description: 'Run diagnostics to test connections and inspect system status.',
actionLabel: 'Run Diagnostics',
});
- expect(DIAGNOSTICS_EMPTY_PBS_MESSAGE).toBe(
- 'No Proxmox Backup Server instances configured.',
- );
+ expect(DIAGNOSTICS_EMPTY_PBS_MESSAGE).toBe('No Proxmox Backup Server instances configured.');
});
});
diff --git a/frontend-modern/src/utils/__tests__/discoveryPresentation.branchcov.test.ts b/frontend-modern/src/utils/__tests__/discoveryPresentation.branchcov.test.ts
index 581c030415..eff28da5e9 100644
--- a/frontend-modern/src/utils/__tests__/discoveryPresentation.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/discoveryPresentation.branchcov.test.ts
@@ -75,7 +75,9 @@ describe('getDiscoveryURLSuggestionSourceLabel (branch coverage)', () => {
});
it('trims surrounding whitespace before matching a known case', () => {
- expect(getDiscoveryURLSuggestionSourceLabel(' web_port_inference ')).toBe('Detected web port');
+ expect(getDiscoveryURLSuggestionSourceLabel(' web_port_inference ')).toBe(
+ 'Detected web port',
+ );
expect(getDiscoveryURLSuggestionSourceLabel('\tservice_default_match\n')).toBe(
'Known service default',
);
@@ -89,7 +91,9 @@ describe('getDiscoverySuggestedURLReason (branch coverage)', () => {
});
it('uses the source label for both text and title when only a code is present', () => {
- expect(getDiscoverySuggestedURLReason({ suggested_url_source_code: 'web_port_inference' })).toEqual({
+ expect(
+ getDiscoverySuggestedURLReason({ suggested_url_source_code: 'web_port_inference' }),
+ ).toEqual({
text: 'Detected web port',
title: 'Detected web port',
});
@@ -162,25 +166,35 @@ describe('hasMeaningfulDiscoveryContext (branch coverage)', () => {
it('is truthy when any port is present', () => {
expect(
hasMeaningfulDiscoveryContext(
- makeDiscovery({ ports: [{ port: 5432, protocol: 'tcp', process: 'postgres', address: '0.0.0.0' }] }),
+ makeDiscovery({
+ ports: [{ port: 5432, protocol: 'tcp', process: 'postgres', address: '0.0.0.0' }],
+ }),
),
).toBe(true);
});
it('is truthy when only config_paths are present', () => {
- expect(hasMeaningfulDiscoveryContext(makeDiscovery({ config_paths: ['/etc/nginx/nginx.conf'] }))).toBe(true);
+ expect(
+ hasMeaningfulDiscoveryContext(makeDiscovery({ config_paths: ['/etc/nginx/nginx.conf'] })),
+ ).toBe(true);
});
it('is truthy when only data_paths are present', () => {
- expect(hasMeaningfulDiscoveryContext(makeDiscovery({ data_paths: ['/var/lib/postgres'] }))).toBe(true);
+ expect(
+ hasMeaningfulDiscoveryContext(makeDiscovery({ data_paths: ['/var/lib/postgres'] })),
+ ).toBe(true);
});
it('is truthy when only log_paths are present', () => {
- expect(hasMeaningfulDiscoveryContext(makeDiscovery({ log_paths: ['/var/log/nginx'] }))).toBe(true);
+ expect(hasMeaningfulDiscoveryContext(makeDiscovery({ log_paths: ['/var/log/nginx'] }))).toBe(
+ true,
+ );
});
it('is truthy when only a suggested_url is present', () => {
- expect(hasMeaningfulDiscoveryContext(makeDiscovery({ suggested_url: 'https://example.local' }))).toBe(true);
+ expect(
+ hasMeaningfulDiscoveryContext(makeDiscovery({ suggested_url: 'https://example.local' })),
+ ).toBe(true);
});
it('is truthy when only a suggested_availability_probe is present', () => {
@@ -212,7 +226,9 @@ describe('isMeaningfulDiscoveryFact (via hasMeaningfulDiscoveryContext, branch c
expect(hasMeaningfulDiscoveryContext(factOnly(makeFact({ value: '' })))).toBe(false);
// ...and the hyphen/underscore form of "n a", which normalises into the stoplist.
expect(hasMeaningfulDiscoveryContext(factOnly(makeFact({ value: 'N-A' })))).toBe(false);
- expect(hasMeaningfulDiscoveryContext(factOnly(makeFact({ value: 'system_container' })))).toBe(false);
+ expect(hasMeaningfulDiscoveryContext(factOnly(makeFact({ value: 'system_container' })))).toBe(
+ false,
+ );
});
it('treats a slash-bearing token like "n/a" as meaningful (slashes are not normalised away)', () => {
@@ -259,7 +275,9 @@ describe('isMeaningfulDiscoveryFact (via hasMeaningfulDiscoveryContext, branch c
it('rejects values containing "does not exist"', () => {
expect(
- hasMeaningfulDiscoveryContext(factOnly(makeFact({ key: 'cfg', value: 'file does not exist' }))),
+ hasMeaningfulDiscoveryContext(
+ factOnly(makeFact({ key: 'cfg', value: 'file does not exist' })),
+ ),
).toBe(false);
});
@@ -378,7 +396,9 @@ describe('getDiscoveryIdentifiedSummary (branch coverage)', () => {
);
expect(trimmed?.cliAccess).toBe('docker exec -it web /bin/sh');
- const blank = getDiscoveryIdentifiedSummary(makeDiscovery({ service_name: 'X', cli_access: ' ' }));
+ const blank = getDiscoveryIdentifiedSummary(
+ makeDiscovery({ service_name: 'X', cli_access: ' ' }),
+ );
expect(blank?.cliAccess).toBeUndefined();
});
@@ -396,7 +416,9 @@ describe('getDiscoveryIdentifiedSummary (branch coverage)', () => {
);
expect(present?.suggestedUrlDiagnostic).toBe('no host candidate');
- const empty = getDiscoveryIdentifiedSummary(makeDiscovery({ service_name: 'X', suggested_url_diagnostic: '' }));
+ const empty = getDiscoveryIdentifiedSummary(
+ makeDiscovery({ service_name: 'X', suggested_url_diagnostic: '' }),
+ );
expect(empty?.suggestedUrlDiagnostic).toBeUndefined();
});
diff --git a/frontend-modern/src/utils/__tests__/emptyStatePresentation.coverage.test.ts b/frontend-modern/src/utils/__tests__/emptyStatePresentation.coverage.test.ts
index acc29b6551..7a5c931202 100644
--- a/frontend-modern/src/utils/__tests__/emptyStatePresentation.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/emptyStatePresentation.coverage.test.ts
@@ -1,8 +1,5 @@
import { describe, expect, it } from 'vitest';
-import {
- getEmptyStatePresentation,
- type EmptyStateTone,
-} from '@/utils/emptyStatePresentation';
+import { getEmptyStatePresentation, type EmptyStateTone } from '@/utils/emptyStatePresentation';
// NOTE: The existing `emptyStatePresentation.test.ts` only covers the `danger`
// and `default` tones. This file adds coverage for the remaining tones, the
@@ -50,16 +47,12 @@ describe('getEmptyStatePresentation — full tone coverage', () => {
['null', null],
['undefined', undefined],
])('returns undefined for %s', (_label, invalid) => {
- const result = getEmptyStatePresentation(
- invalid as unknown as EmptyStateTone,
- );
+ const result = getEmptyStatePresentation(invalid as unknown as EmptyStateTone);
expect(result).toBeUndefined();
});
it('does not fall back to default classes for an unknown tone', () => {
- const fallback = getEmptyStatePresentation(
- 'nonexistent' as unknown as EmptyStateTone,
- );
+ const fallback = getEmptyStatePresentation('nonexistent' as unknown as EmptyStateTone);
const def = getEmptyStatePresentation('default');
// Explicitly documents the absence of a default-fallback branch.
expect(fallback).not.toEqual(def);
diff --git a/frontend-modern/src/utils/__tests__/format.coverage.test.ts b/frontend-modern/src/utils/__tests__/format.coverage.test.ts
index 7022563237..c96512214a 100644
--- a/frontend-modern/src/utils/__tests__/format.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/format.coverage.test.ts
@@ -254,9 +254,7 @@ describe('normalizeDiskArray - edge cases', () => {
});
it('filters any mountpoint under the /System/Volumes/ prefix', () => {
- expect(
- normalizeDiskArray([{ mountpoint: '/System/Volumes/VM', total: 100 }]),
- ).toBeUndefined();
+ expect(normalizeDiskArray([{ mountpoint: '/System/Volumes/VM', total: 100 }])).toBeUndefined();
});
it('keeps disks whose mountpoint is undefined or empty', () => {
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index b4b797b02e..0652866347 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -3700,9 +3700,7 @@ describe('frontend resource type boundaries', () => {
'export function getPatrolFindingsEmptyState',
);
expect(patrolEmptyStatePresentationSource).toContain('historicalRegressionCount?: number');
- expect(patrolEmptyStatePresentationSource).toContain(
- 'HISTORICAL_REGRESSION_EMPTY_STATE_BODY',
- );
+ expect(patrolEmptyStatePresentationSource).toContain('HISTORICAL_REGRESSION_EMPTY_STATE_BODY');
expect(patrolRunPresentationSource).toContain('export function getRunHistoryLoadingState');
expect(patrolRunPresentationSource).toContain('export function getToolCallsLoadingState');
expect(patrolRunPresentationSource).toContain('export function getToolCallsUnavailableState');
diff --git a/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.branchcov2.test.ts
index efd33e4338..0ed85f48db 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureOnboardingPresentation.branchcov2.test.ts
@@ -190,22 +190,25 @@ describe('infrastructureOnboardingPresentation — branch coverage (branchcov2)'
it('pulls platform-specific manifest canonicalProjections for every supported API platform', () => {
// Each platform exercises a distinct manifestEntry.canonicalProjections,
// confirming the manifest side of the ?? is data-driven per type.
- expect(getInfrastructureOnboardingProductPresentation('truenas').canonicalProjections)
- .toStrictEqual([
- 'agent',
- 'vm',
- 'app-container',
- 'network-share',
- 'storage',
- 'physical-disk',
- ]);
- expect(getInfrastructureOnboardingProductPresentation('pve').canonicalProjections)
- .toStrictEqual(['agent', 'vm', 'system-container', 'storage', 'ceph', 'physical-disk']);
- expect(getInfrastructureOnboardingProductPresentation('pbs').canonicalProjections)
- .toStrictEqual(['pbs', 'storage']);
- expect(getInfrastructureOnboardingProductPresentation('pmg').canonicalProjections).toStrictEqual(
- ['pmg'],
- );
+ expect(
+ getInfrastructureOnboardingProductPresentation('truenas').canonicalProjections,
+ ).toStrictEqual([
+ 'agent',
+ 'vm',
+ 'app-container',
+ 'network-share',
+ 'storage',
+ 'physical-disk',
+ ]);
+ expect(
+ getInfrastructureOnboardingProductPresentation('pve').canonicalProjections,
+ ).toStrictEqual(['agent', 'vm', 'system-container', 'storage', 'ceph', 'physical-disk']);
+ expect(
+ getInfrastructureOnboardingProductPresentation('pbs').canonicalProjections,
+ ).toStrictEqual(['pbs', 'storage']);
+ expect(
+ getInfrastructureOnboardingProductPresentation('pmg').canonicalProjections,
+ ).toStrictEqual(['pmg']);
});
it('reads the manifest supportFloor for supported API platforms', () => {
diff --git a/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts b/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts
index 3f342b2403..3aa3820a1a 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts
@@ -44,12 +44,8 @@ describe('infrastructureSettingsPresentation', () => {
'Enter at least one valid subnet in CIDR format',
);
expect(getDiscoveryScanStartErrorMessage()).toBe('Unable to start the discovery scan.');
- expect(getDiscoverySettingUpdateErrorMessage()).toBe(
- 'Unable to update the discovery setting.',
- );
- expect(getDiscoverySubnetUpdateErrorMessage()).toBe(
- 'Unable to update the discovery subnet.',
- );
+ expect(getDiscoverySettingUpdateErrorMessage()).toBe('Unable to update the discovery setting.');
+ expect(getDiscoverySubnetUpdateErrorMessage()).toBe('Unable to update the discovery subnet.');
});
it('returns canonical infrastructure node management error copy', () => {
diff --git a/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov.test.ts b/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov.test.ts
index 51b598cffc..7334c62937 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov.test.ts
@@ -1,9 +1,5 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
-import type {
- ChartStats,
- InfrastructureChartsResponse,
- TimeRange,
-} from '@/api/charts';
+import type { ChartStats, InfrastructureChartsResponse, TimeRange } from '@/api/charts';
import { setOrgID } from '@/utils/apiClient';
import {
__resetInfrastructureSummaryFetchesForTests,
@@ -31,11 +27,8 @@ vi.mock('@/api/charts', async () => {
const DEFAULT_METRICS_KEY = 'cpu,memory,disk,diskread,diskwrite,netin,netout';
-const cacheKeyForRange = (
- range: TimeRange,
- orgScope = 'default',
- metrics = DEFAULT_METRICS_KEY,
-) => `pulse.infrastructureSummaryCharts.${encodeURIComponent(orgScope)}::${range}::${metrics}`;
+const cacheKeyForRange = (range: TimeRange, orgScope = 'default', metrics = DEFAULT_METRICS_KEY) =>
+ `pulse.infrastructureSummaryCharts.${encodeURIComponent(orgScope)}::${range}::${metrics}`;
interface MetricPoint {
timestamp: number;
@@ -209,10 +202,7 @@ describe('readInfrastructureSummaryCache invalidation', () => {
});
it('returns null oldestDataTimestamp when the stored value is not a finite number', () => {
- storePayload(
- '1h',
- buildPayload({ oldestDataTimestamp: 'not-a-number', charts: undefined }),
- );
+ storePayload('1h', buildPayload({ oldestDataTimestamp: 'not-a-number', charts: undefined }));
const cached = readInfrastructureSummaryCache('1h');
expect(cached).not.toBeNull();
expect(cached?.oldestDataTimestamp).toBeNull();
@@ -220,10 +210,7 @@ describe('readInfrastructureSummaryCache invalidation', () => {
it('returns the numeric oldestDataTimestamp on the happy path', () => {
const ts = now() - 5_000;
- storePayload(
- '1h',
- buildPayload({ oldestDataTimestamp: ts, charts: undefined }),
- );
+ storePayload('1h', buildPayload({ oldestDataTimestamp: ts, charts: undefined }));
expect(readInfrastructureSummaryCache('1h')?.oldestDataTimestamp).toBe(ts);
});
@@ -240,11 +227,9 @@ describe('persistInfrastructureSummaryCache write-failure path', () => {
});
it('swallows a localStorage.setItem failure without throwing', () => {
- const spy = vi
- .spyOn(Storage.prototype, 'setItem')
- .mockImplementation(() => {
- throw new Error('QuotaExceededError');
- });
+ const spy = vi.spyOn(Storage.prototype, 'setItem').mockImplementation(() => {
+ throw new Error('QuotaExceededError');
+ });
try {
expect(() =>
persistInfrastructureSummaryCache(
@@ -292,19 +277,13 @@ describe('toCachedChartData / trimPoints coverage via persist', () => {
// result shorter than max, so the final `result.length > max ? slice : result`
// ternary takes its `result` arm rather than re-slicing.
const series = makeSeries(361, now() - 361 * 30_000);
- persistInfrastructureSummaryCache(
- '1h',
- new Map([['node-1', { cpu: series }]]),
- null,
- );
+ persistInfrastructureSummaryCache('1h', new Map([['node-1', { cpu: series }]]), null);
const cached = readInfrastructureSummaryCache('1h')?.map.get('node-1');
expect(cached?.cpu).toBeDefined();
// Stride of 2 over 361 points keeps the newest point and yields 181 samples.
const cachedCpu = cached?.cpu ?? [];
expect(cachedCpu.length).toBe(181);
- expect(cachedCpu[cachedCpu.length - 1]?.timestamp).toBe(
- series[series.length - 1]?.timestamp,
- );
+ expect(cachedCpu[cachedCpu.length - 1]?.timestamp).toBe(series[series.length - 1]?.timestamp);
});
});
diff --git a/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov0717.test.ts b/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov0717.test.ts
index 521fc0c345..f0c710e8d8 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov0717.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.branchcov0717.test.ts
@@ -36,11 +36,8 @@ vi.mock('@/api/charts', async () => {
const DEFAULT_METRICS_KEY = 'cpu,memory,disk,diskread,diskwrite,netin,netout';
-const cacheKeyForRange = (
- range: TimeRange,
- orgScope = 'default',
- metrics = DEFAULT_METRICS_KEY,
-) => `pulse.infrastructureSummaryCharts.${encodeURIComponent(orgScope)}::${range}::${metrics}`;
+const cacheKeyForRange = (range: TimeRange, orgScope = 'default', metrics = DEFAULT_METRICS_KEY) =>
+ `pulse.infrastructureSummaryCharts.${encodeURIComponent(orgScope)}::${range}::${metrics}`;
interface MetricPoint {
timestamp: number;
@@ -282,10 +279,7 @@ describe('readInfrastructureSummaryCache — series coercion coverage', () => {
it('treats a null charts field as the emptyentries branch', () => {
// null && ... -> false -> [] arm. Distinct from undefined (also falsy) and
// from the non-object truthy case above.
- storePayload(
- '1h',
- buildPayload({ charts: null as unknown as undefined }),
- );
+ storePayload('1h', buildPayload({ charts: null as unknown as undefined }));
const cached = readInfrastructureSummaryCache('1h');
expect(cached).not.toBeNull();
expect(cached?.map.size).toBe(0);
@@ -309,7 +303,15 @@ describe('readInfrastructureSummaryCache — hit / miss / expiry / empty boundar
cachedAt,
oldestDataTimestamp,
charts: {
- 'node-1': { cpu: makeSeries(2), memory: [], disk: [], diskread: [], diskwrite: [], netin: [], netout: [] },
+ 'node-1': {
+ cpu: makeSeries(2),
+ memory: [],
+ disk: [],
+ diskread: [],
+ diskwrite: [],
+ netin: [],
+ netout: [],
+ },
},
}),
);
@@ -333,10 +335,7 @@ describe('readInfrastructureSummaryCache — hit / miss / expiry / empty boundar
try {
const maxAge = 60_000;
const cachedAt = now() - maxAge;
- storePayload(
- '1h',
- buildPayload({ cachedAt, charts: undefined }),
- );
+ storePayload('1h', buildPayload({ cachedAt, charts: undefined }));
expect(readInfrastructureSummaryCache('1h', maxAge)).not.toBeNull();
} finally {
vi.useRealTimers();
@@ -406,11 +405,7 @@ describe('persistInfrastructureSummaryCache — write-boundary coverage', () =>
// The sibling test always supplies cpu, so the `?? []` right operand for
// cpu stays uncovered. Persist a ChartData without cpu and verify the
// cached entry round-trips with cpu === [].
- persistInfrastructureSummaryCache(
- '1h',
- new Map([['node-1', { memory: makeSeries(2) }]]),
- null,
- );
+ persistInfrastructureSummaryCache('1h', new Map([['node-1', { memory: makeSeries(2) }]]), null);
const series = readInfrastructureSummaryCache('1h')?.map.get('node-1');
expect(series?.cpu).toEqual([]);
expect(series?.memory?.length).toBe(2);
@@ -519,7 +514,7 @@ describe('infraSummaryPerfNow — Date.now() fallback arm', () => {
// back to Date.now(). The fetch path calls perfNow at start and end, so a
// successful round-trip with performance masked proves the fallback works.
mockGetCharts.mockResolvedValueOnce(
- makeInfraResponse({ nodeData: { 'n': { cpu: makeSeries(1) } } }),
+ makeInfraResponse({ nodeData: { n: { cpu: makeSeries(1) } } }),
);
const result = await withGlobalUndefined('performance', () =>
fetchInfrastructureSummaryAndCache('1h'),
@@ -588,11 +583,9 @@ describe('org_switched cache invalidation handler — uncovered getter + branche
it('does not throw when the localStorage iteration itself throws (catch arm)', () => {
// Covers the try/catch around the invalidation loop: if localStorage.length
// throws, the handler must swallow it and return silently.
- const lengthSpy = vi
- .spyOn(Storage.prototype, 'length', 'get')
- .mockImplementation(() => {
- throw new Error('storage poisoned');
- });
+ const lengthSpy = vi.spyOn(Storage.prototype, 'length', 'get').mockImplementation(() => {
+ throw new Error('storage poisoned');
+ });
try {
expect(() => eventBus.emit('org_switched', 'broken-org')).not.toThrow();
} finally {
@@ -641,7 +634,7 @@ describe('infraSummaryPerfLog — perf-enabled branches via module reload', () =
mod.__resetInfrastructureSummaryFetchesForTests();
mockGetCharts.mockReset();
mockGetCharts.mockResolvedValueOnce(
- makeInfraResponse({ nodeData: { 'n': { cpu: makeSeries(1) } } }),
+ makeInfraResponse({ nodeData: { n: { cpu: makeSeries(1) } } }),
);
await mod.fetchInfrastructureSummaryAndCache('1h', { caller: 'perf-enabled' });
@@ -698,11 +691,9 @@ describe('readInfrastructureSummaryCache — read failure path', () => {
it('swallows a localStorage.getItem failure and returns null (catch arm)', () => {
// Covers the outer try/catch in readInfrastructureSummaryCache: a throw out
// of getItem must be swallowed and surface as a null result.
- const getItemSpy = vi
- .spyOn(Storage.prototype, 'getItem')
- .mockImplementation(() => {
- throw new Error('getItem exploded');
- });
+ const getItemSpy = vi.spyOn(Storage.prototype, 'getItem').mockImplementation(() => {
+ throw new Error('getItem exploded');
+ });
try {
expect(readInfrastructureSummaryCache('1h')).toBeNull();
} finally {
@@ -724,11 +715,7 @@ describe('persistInfrastructureSummaryCache — JSON.stringify failure path', ()
const cyclic = { cpu: [] as MetricPoint[] } as unknown as ChartData;
(cyclic as { self: unknown }).self = cyclic;
expect(() =>
- persistInfrastructureSummaryCache(
- '1h',
- new Map([['node-1', cyclic]]),
- null,
- ),
+ persistInfrastructureSummaryCache('1h', new Map([['node-1', cyclic]]), null),
).not.toThrow();
});
});
diff --git a/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.test.ts b/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.test.ts
index 1cb17d7b2f..70dc906997 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureSummaryCache.test.ts
@@ -116,7 +116,9 @@ describe('infrastructureSummaryCache fetch dedupe', () => {
expect(mockGetCharts).toHaveBeenNthCalledWith(2, '1h', undefined, {
metrics: ['cpu', 'memory', 'disk', 'diskread', 'diskwrite', 'netin', 'netout'],
});
- expect(readInfrastructureSummaryCache('1h', undefined, undefined, ['cpu', 'memory'])).not.toBeNull();
+ expect(
+ readInfrastructureSummaryCache('1h', undefined, undefined, ['cpu', 'memory']),
+ ).not.toBeNull();
expect(readInfrastructureSummaryCache('1h')).not.toBeNull();
});
diff --git a/frontend-modern/src/utils/__tests__/k8sNamespacePresentation.branchcov0718.test.ts b/frontend-modern/src/utils/__tests__/k8sNamespacePresentation.branchcov0718.test.ts
index 84492a1568..e968c6cbbc 100644
--- a/frontend-modern/src/utils/__tests__/k8sNamespacePresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/utils/__tests__/k8sNamespacePresentation.branchcov0718.test.ts
@@ -37,9 +37,7 @@ describe('k8sNamespacePresentation.branchcov0718 — residual uncovered exports'
describe('exported label / copy constants (direct assertion)', () => {
it('exposes the canonical drawer title and description', () => {
expect(K8S_NAMESPACES_DRAWER_TITLE).toBe('Namespaces');
- expect(K8S_NAMESPACES_DRAWER_DESCRIPTION).toBe(
- 'Scope Pods and Deployments by namespace',
- );
+ expect(K8S_NAMESPACES_DRAWER_DESCRIPTION).toBe('Scope Pods and Deployments by namespace');
});
it('exposes the canonical search placeholder', () => {
diff --git a/frontend-modern/src/utils/__tests__/licensePresentation.coverage.test.ts b/frontend-modern/src/utils/__tests__/licensePresentation.coverage.test.ts
index 0f2b146a2a..a9621a768f 100644
--- a/frontend-modern/src/utils/__tests__/licensePresentation.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/licensePresentation.coverage.test.ts
@@ -192,37 +192,23 @@ describe('requiresPulseProRuntime - branch coverage', () => {
});
it('returns false for tiers outside the Pro runtime set', () => {
- expect(
- requiresPulseProRuntime({ tier: 'relay', subscription_state: 'active' }),
- ).toBe(false);
- expect(
- requiresPulseProRuntime({ tier: 'free', subscription_state: 'active' }),
- ).toBe(false);
+ expect(requiresPulseProRuntime({ tier: 'relay', subscription_state: 'active' })).toBe(false);
+ expect(requiresPulseProRuntime({ tier: 'free', subscription_state: 'active' })).toBe(false);
});
it('returns false for a Pro-tier with non-paid subscription state', () => {
- expect(
- requiresPulseProRuntime({ tier: 'pro', subscription_state: 'expired' }),
- ).toBe(false);
+ expect(requiresPulseProRuntime({ tier: 'pro', subscription_state: 'expired' })).toBe(false);
});
it('returns true for active, grace, and trial Pro-tier entitlements', () => {
- expect(
- requiresPulseProRuntime({ tier: 'pro', subscription_state: 'active' }),
- ).toBe(true);
- expect(
- requiresPulseProRuntime({ tier: 'pro', subscription_state: 'grace' }),
- ).toBe(true);
- expect(
- requiresPulseProRuntime({ tier: 'pro', subscription_state: 'trial' }),
- ).toBe(true);
+ expect(requiresPulseProRuntime({ tier: 'pro', subscription_state: 'active' })).toBe(true);
+ expect(requiresPulseProRuntime({ tier: 'pro', subscription_state: 'grace' })).toBe(true);
+ expect(requiresPulseProRuntime({ tier: 'pro', subscription_state: 'trial' })).toBe(true);
});
it('returns true for every tier in the Pro-runtime-required set', () => {
for (const tier of ['pro', 'pro_annual', 'pro_plus', 'lifetime', 'enterprise']) {
- expect(
- requiresPulseProRuntime({ tier, subscription_state: 'active' }),
- ).toBe(true);
+ expect(requiresPulseProRuntime({ tier, subscription_state: 'active' })).toBe(true);
}
});
});
@@ -242,9 +228,7 @@ describe('getGrandfatheredPriceContinuityNotice - edge cases', () => {
});
it('returns null for a grandfathered plan with a null subscription state', () => {
- expect(
- getGrandfatheredPriceContinuityNotice('v5_pro_monthly_grandfathered', null),
- ).toBeNull();
+ expect(getGrandfatheredPriceContinuityNotice('v5_pro_monthly_grandfathered', null)).toBeNull();
expect(
getGrandfatheredPriceContinuityNotice('v5_pro_annual_grandfathered', undefined),
).toBeNull();
@@ -263,9 +247,7 @@ describe('getGrandfatheredPriceContinuityNotice - edge cases', () => {
describe('getCommercialMigrationActionText - all switch branches', () => {
it('returns retry guidance for retry_activation', () => {
- expect(getCommercialMigrationActionText('retry_activation')).toBe(
- 'Retry from this instance.',
- );
+ expect(getCommercialMigrationActionText('retry_activation')).toBe('Retry from this instance.');
});
it('returns current-key guidance for use_v6_activation_key', () => {
@@ -402,9 +384,7 @@ describe('getBillingAdminTrialStatus - branch coverage', () => {
});
it('returns No trial for a non-trial state with no trial timestamps', () => {
- expect(
- getBillingAdminTrialStatus({ subscription_state: 'active' } as never),
- ).toBe('No trial');
+ expect(getBillingAdminTrialStatus({ subscription_state: 'active' } as never)).toBe('No trial');
});
it('formats a trial state with only trial_ends_at', () => {
@@ -581,7 +561,10 @@ describe('getSelfHostedCurrentPlanPresentation - is_lifetime branch', () => {
upgrade_reasons: [],
runtime: { build: 'pro', label: 'Pulse Pro runtime' },
},
- displayableCapabilities: ['Pulse Relay (Remote Access)', 'Patrol Applies Safe Fixes and Verifies the Result'],
+ displayableCapabilities: [
+ 'Pulse Relay (Remote Access)',
+ 'Patrol Applies Safe Fixes and Verifies the Result',
+ ],
});
expect(result.supplementalBadges).toContain('Grandfathered lifetime');
expect(result.supplementalSummary).toContain(
@@ -602,7 +585,10 @@ describe('getSelfHostedCurrentPlanPresentation - grace + grandfathered branch',
upgrade_reasons: [],
runtime: { build: 'pro', label: 'Pulse Pro runtime' },
},
- displayableCapabilities: ['Pulse Relay (Remote Access)', 'Patrol Applies Safe Fixes and Verifies the Result'],
+ displayableCapabilities: [
+ 'Pulse Relay (Remote Access)',
+ 'Patrol Applies Safe Fixes and Verifies the Result',
+ ],
});
expect(result.supplementalBadges).toContain('Grandfathered price');
});
@@ -655,7 +641,10 @@ describe('getSelfHostedCurrentPlanPresentation - getPatrolControlAction branches
upgrade_reasons: [],
runtime: { build: 'pro', label: 'Pulse Pro runtime' },
},
- displayableCapabilities: ['Pulse Relay (Remote Access)', 'Patrol Applies Safe Fixes and Verifies the Result'],
+ displayableCapabilities: [
+ 'Pulse Relay (Remote Access)',
+ 'Patrol Applies Safe Fixes and Verifies the Result',
+ ],
patrolOperatorStatus: {
patrolControlOperationsLoopStarterCount: 1,
patrolControlCompletedOperationsLoopCount: 1,
@@ -811,7 +800,10 @@ describe('getSelfHostedActivationSuccessPresentation - purchase + runtime mismat
upgrade_reasons: [],
runtime: { build: 'community', label: 'Pulse Community runtime' },
},
- displayableCapabilities: ['Pulse Relay (Remote Access)', 'Patrol Applies Safe Fixes and Verifies the Result'],
+ displayableCapabilities: [
+ 'Pulse Relay (Remote Access)',
+ 'Patrol Applies Safe Fixes and Verifies the Result',
+ ],
source: 'purchase',
});
expect(result).not.toBeNull();
diff --git a/frontend-modern/src/utils/__tests__/localStorage.branchcov2130.test.ts b/frontend-modern/src/utils/__tests__/localStorage.branchcov2130.test.ts
index e7d19e8d04..d465aba9a8 100644
--- a/frontend-modern/src/utils/__tests__/localStorage.branchcov2130.test.ts
+++ b/frontend-modern/src/utils/__tests__/localStorage.branchcov2130.test.ts
@@ -71,9 +71,7 @@ function makeSignal<T>(factory: () => AnySignal<T>): {
}
function dispatchCustomSync(key: string, value: string | null) {
- window.dispatchEvent(
- new CustomEvent(SYNC_EVENT, { detail: { key, value } }),
- );
+ window.dispatchEvent(new CustomEvent(SYNC_EVENT, { detail: { key, value } }));
}
// jsdom's StorageEvent constructor rejects non-jsdom Storage instances for
@@ -111,16 +109,13 @@ describe('localStorage signal factories — parse/stringify branch coverage', ()
[String(Number.MAX_SAFE_INTEGER), Number.MAX_SAFE_INTEGER],
];
- it.each(finiteParseCases)(
- 'runs parse(stored) on first read: %j -> %s',
- (stored, expected) => {
- localStorage.setItem('num-init', stored);
+ it.each(finiteParseCases)('runs parse(stored) on first read: %j -> %s', (stored, expected) => {
+ localStorage.setItem('num-init', stored);
- const sig = makeSignal(() => createLocalStorageNumberSignal('num-init', 7));
+ const sig = makeSignal(() => createLocalStorageNumberSignal('num-init', 7));
- expect(sig.value()).toBe(expected);
- },
- );
+ expect(sig.value()).toBe(expected);
+ });
it.each([['abc'], ['Infinity'], ['-Infinity'], ['NaN'], ['-0x10']])(
'runs parse(stored) and falls back to the default when %j is not finite',
@@ -222,16 +217,13 @@ describe('localStorage signal factories — parse/stringify branch coverage', ()
['anything', false],
];
- it.each(boolParseCases)(
- 'runs parse(stored) on first read: %j -> %s',
- (stored, expected) => {
- localStorage.setItem('bool-init', stored);
+ it.each(boolParseCases)('runs parse(stored) on first read: %j -> %s', (stored, expected) => {
+ localStorage.setItem('bool-init', stored);
- const sig = makeSignal(() => createLocalStorageBooleanSignal('bool-init', false));
+ const sig = makeSignal(() => createLocalStorageBooleanSignal('bool-init', false));
- expect(sig.value()).toBe(expected);
- },
- );
+ expect(sig.value()).toBe(expected);
+ });
});
// ---------------------------------------------------------------- L46 -----
diff --git a/frontend-modern/src/utils/__tests__/localStorage.test.ts b/frontend-modern/src/utils/__tests__/localStorage.test.ts
index 5ccab2460e..c723c93708 100644
--- a/frontend-modern/src/utils/__tests__/localStorage.test.ts
+++ b/frontend-modern/src/utils/__tests__/localStorage.test.ts
@@ -44,9 +44,7 @@ function makeSignal<T>(factory: () => AnySignal<T>): {
}
function dispatchCustomSync(key: string, value: string | null) {
- window.dispatchEvent(
- new CustomEvent(SYNC_EVENT, { detail: { key, value } }),
- );
+ window.dispatchEvent(new CustomEvent(SYNC_EVENT, { detail: { key, value } }));
}
// jsdom's StorageEvent constructor rejects non-jsdom Storage instances for
@@ -283,17 +281,16 @@ describe('localStorage signals', () => {
expect(sig.value()).toBe(expected);
});
- it.each([
- ['abc'],
- ['Infinity'],
- ['NaN'],
- ])('falls back to the default when stored %j is not finite', (stored) => {
- localStorage.setItem('num-key', stored);
+ it.each([['abc'], ['Infinity'], ['NaN']])(
+ 'falls back to the default when stored %j is not finite',
+ (stored) => {
+ localStorage.setItem('num-key', stored);
- const sig = makeSignal(() => createLocalStorageNumberSignal('num-key', 7));
+ const sig = makeSignal(() => createLocalStorageNumberSignal('num-key', 7));
- expect(sig.value()).toBe(7);
- });
+ expect(sig.value()).toBe(7);
+ },
+ );
it('heals an invalid stored value by writing the default back to storage', async () => {
localStorage.setItem('num-key', 'abc');
diff --git a/frontend-modern/src/utils/__tests__/logger.test.ts b/frontend-modern/src/utils/__tests__/logger.test.ts
index c13aa0d2f5..3364536667 100644
--- a/frontend-modern/src/utils/__tests__/logger.test.ts
+++ b/frontend-modern/src/utils/__tests__/logger.test.ts
@@ -145,26 +145,19 @@ describe('logger', () => {
['just info', false],
];
- it.each(infoKeywordCases)(
- 'info in production logs for %j? %s',
- (message, shouldLog) => {
- logger.info(message);
+ it.each(infoKeywordCases)('info in production logs for %j? %s', (message, shouldLog) => {
+ logger.info(message);
- if (shouldLog) {
- expect(logSpy).toHaveBeenCalledWith('%s', `[INFO] ${message}`, '');
- } else {
- expect(logSpy).not.toHaveBeenCalled();
- }
- },
- );
+ if (shouldLog) {
+ expect(logSpy).toHaveBeenCalledWith('%s', `[INFO] ${message}`, '');
+ } else {
+ expect(logSpy).not.toHaveBeenCalled();
+ }
+ });
// The keyword check uses String.includes, which is case-sensitive. Capitalized
// variants of the trigger words are therefore NOT surfaced in production.
- const capitalizedKeywordCases: Array<[string]> = [
- ['Established'],
- ['Failed'],
- ['Error'],
- ];
+ const capitalizedKeywordCases: Array<[string]> = [['Established'], ['Failed'], ['Error']];
it.each(capitalizedKeywordCases)(
'info in production does NOT log for capitalized keyword %j (case-sensitive match, suspected bug)',
diff --git a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.branchcov.test.ts b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.branchcov.test.ts
index 808d48ceae..9d08f4c53f 100644
--- a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.branchcov.test.ts
@@ -123,7 +123,10 @@ describe('buildMonitoredSystemImpactPreviewUnavailableState (branch coverage)',
it('returns null when the error code does not match', () => {
expect(buildMonitoredSystemImpactPreviewUnavailableState({ code: 'other_error' })).toBeNull();
expect(
- buildMonitoredSystemImpactPreviewUnavailableState({ code: null, reason: 'supplemental_inventory_unsettled' }),
+ buildMonitoredSystemImpactPreviewUnavailableState({
+ code: null,
+ reason: 'supplemental_inventory_unsettled',
+ }),
).toBeNull();
});
@@ -241,7 +244,9 @@ describe('formatMonitoredSystemImpactPreviewSummary (branch coverage)', () => {
it('falls back to current when projected_count is absent (delta 0)', () => {
expect(
- formatMonitoredSystemImpactPreviewSummary({ current_count: 4 } as MonitoredSystemImpactPreviewSummaryInput),
+ formatMonitoredSystemImpactPreviewSummary({
+ current_count: 4,
+ } as MonitoredSystemImpactPreviewSummaryInput),
).toBe(
'Pulse currently counts 4 monitored systems. Saving this change would keep the count at 4 monitored systems.',
);
@@ -272,7 +277,11 @@ describe('formatMonitoredSystemSurfaceAttribution (branch coverage)', () => {
formatMonitoredSystemSurfaceAttribution({ name: '', type: 'host', source: 'vmware' }),
).toBe('Unnamed source (Host via VMware)');
expect(
- formatMonitoredSystemSurfaceAttribution({ name: ' ', type: 'docker-host', source: 'docker' }),
+ formatMonitoredSystemSurfaceAttribution({
+ name: ' ',
+ type: 'docker-host',
+ source: 'docker',
+ }),
).toBe('Unnamed source (Docker Host via Docker)');
});
@@ -288,9 +297,9 @@ describe('formatMonitoredSystemSurfaceAttribution (branch coverage)', () => {
it('falls back to "Unnamed source" when the name property is missing', () => {
expect(
- formatMonitoredSystemSurfaceAttribution(
- { type: 'host', source: 'vmware' } as Parameters<typeof formatMonitoredSystemSurfaceAttribution>[0],
- ),
+ formatMonitoredSystemSurfaceAttribution({ type: 'host', source: 'vmware' } as Parameters<
+ typeof formatMonitoredSystemSurfaceAttribution
+ >[0]),
).toBe('Unnamed source (Host via VMware)');
});
});
diff --git a/frontend-modern/src/utils/__tests__/organizationSettingsPresentation.branchcov0717.test.ts b/frontend-modern/src/utils/__tests__/organizationSettingsPresentation.branchcov0717.test.ts
index 4da4746e18..f3f1426652 100644
--- a/frontend-modern/src/utils/__tests__/organizationSettingsPresentation.branchcov0717.test.ts
+++ b/frontend-modern/src/utils/__tests__/organizationSettingsPresentation.branchcov0717.test.ts
@@ -150,9 +150,7 @@ describe('organizationSettingsPresentation branch coverage (supplemental)', () =
describe('getOrganizationIncomingShareDeclineErrorMessage', () => {
it('returns the provided message on the truthy arm of `message ||`', () => {
- expect(getOrganizationIncomingShareDeclineErrorMessage('still in use')).toBe(
- 'still in use',
- );
+ expect(getOrganizationIncomingShareDeclineErrorMessage('still in use')).toBe('still in use');
});
it('treats an empty-string message as falsy and falls back', () => {
diff --git a/frontend-modern/src/utils/__tests__/patrolCapacityForecastPresentation.branchcov0712.test.ts b/frontend-modern/src/utils/__tests__/patrolCapacityForecastPresentation.branchcov0712.test.ts
index c192987c0a..1dd8c6caf0 100644
--- a/frontend-modern/src/utils/__tests__/patrolCapacityForecastPresentation.branchcov0712.test.ts
+++ b/frontend-modern/src/utils/__tests__/patrolCapacityForecastPresentation.branchcov0712.test.ts
@@ -83,7 +83,7 @@ describe('formatRate (exercised via presentCapacityForecast)', () => {
expect(out!.detail).toBe('6 days to full at +0.50%/day');
});
- it("uses no sign and one decimal for a rate <= -1 (negative fill projection)", () => {
+ it('uses no sign and one decimal for a rate <= -1 (negative fill projection)', () => {
const out = presentCapacityForecast({
current_pct: 50,
daily_change: -2,
@@ -95,15 +95,11 @@ describe('formatRate (exercised via presentCapacityForecast)', () => {
describe('presentCapacityForecast', () => {
it('returns null for malformed falsy non-null inputs (defensive !fc guard)', () => {
- expect(
- presentCapacityForecast(0 as unknown as CapacityForecast),
- ).toBeNull();
- expect(
- presentCapacityForecast('' as unknown as CapacityForecast),
- ).toBeNull();
+ expect(presentCapacityForecast(0 as unknown as CapacityForecast)).toBeNull();
+ expect(presentCapacityForecast('' as unknown as CapacityForecast)).toBeNull();
});
- it("defaults daily_change to 0 via ?? when it is null", () => {
+ it('defaults daily_change to 0 via ?? when it is null', () => {
const out = presentCapacityForecast({
current_pct: 80,
days_to_full: 5,
@@ -113,7 +109,7 @@ describe('presentCapacityForecast', () => {
expect(out!.tone).toBe('critical');
});
- it("defaults daily_change to 0 via ?? when it is undefined", () => {
+ it('defaults daily_change to 0 via ?? when it is undefined', () => {
const out = presentCapacityForecast({
current_pct: 80,
days_to_full: 5,
diff --git a/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.ts b/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.ts
index 4ca28f8c33..7bd78e337b 100644
--- a/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/patrolEmptyStatePresentation.test.ts
@@ -89,7 +89,7 @@ describe('patrolEmptyStatePresentation', () => {
status: 'error',
error_count: 1,
resources_checked: 72,
- } as unknown as PatrolRunRecord,
+ } as unknown as PatrolRunRecord,
],
}),
).toEqual({
diff --git a/frontend-modern/src/utils/__tests__/patrolFormat.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/patrolFormat.branchcov0712b.test.ts
index d47e25656c..b37c6cd80a 100644
--- a/frontend-modern/src/utils/__tests__/patrolFormat.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/patrolFormat.branchcov0712b.test.ts
@@ -63,9 +63,7 @@ describe('patrolFormat branch coverage (supplemental)', () => {
});
it('matches "provider not ready"', () => {
- expect(formatPatrolRuntimeFailureDetail('Provider not ready')).toBe(
- 'Provider not ready',
- );
+ expect(formatPatrolRuntimeFailureDetail('Provider not ready')).toBe('Provider not ready');
});
it('matches "selected model unavailable"', () => {
@@ -75,9 +73,9 @@ describe('patrolFormat branch coverage (supplemental)', () => {
});
it('matches "selected model context window too small"', () => {
- expect(
- formatPatrolRuntimeFailureDetail('Selected model context window too small'),
- ).toBe('Selected model context window too small');
+ expect(formatPatrolRuntimeFailureDetail('Selected model context window too small')).toBe(
+ 'Selected model context window too small',
+ );
});
});
@@ -90,17 +88,15 @@ describe('patrolFormat branch coverage (supplemental)', () => {
});
it('matches the "tools are not supported" phrase', () => {
- expect(formatPatrolRuntimeFailureDetail('tools are not supported here')).toBe(
- expected,
- );
+ expect(formatPatrolRuntimeFailureDetail('tools are not supported here')).toBe(expected);
});
it('matches the compound "no endpoints found" + "tool" condition (both halves required)', () => {
// Only "no endpoints found" without "tool" must NOT hit this arm —
// exercised separately below to prove the conjunction.
- expect(
- formatPatrolRuntimeFailureDetail('no endpoints found for the requested tool'),
- ).toBe(expected);
+ expect(formatPatrolRuntimeFailureDetail('no endpoints found for the requested tool')).toBe(
+ expected,
+ );
});
it('does NOT classify when "no endpoints found" appears without "tool" (conjunction false arm)', () => {
@@ -117,9 +113,7 @@ describe('patrolFormat branch coverage (supplemental)', () => {
'Provider reported insufficient credits or token budget for the requested Patrol analysis.';
it('matches "insufficient balance"', () => {
- expect(formatPatrolRuntimeFailureDetail('insufficient balance on account')).toBe(
- expected,
- );
+ expect(formatPatrolRuntimeFailureDetail('insufficient balance on account')).toBe(expected);
});
it('matches "payment required"', () => {
@@ -135,9 +129,7 @@ describe('patrolFormat branch coverage (supplemental)', () => {
});
it('matches "max_tokens"', () => {
- expect(formatPatrolRuntimeFailureDetail('max_tokens exceeded budget')).toBe(
- expected,
- );
+ expect(formatPatrolRuntimeFailureDetail('max_tokens exceeded budget')).toBe(expected);
});
});
@@ -188,21 +180,15 @@ describe('patrolFormat branch coverage (supplemental)', () => {
'Provider connection failed. Check provider reachability before retrying Patrol.';
it('matches "failed to connect"', () => {
- expect(formatPatrolRuntimeFailureDetail('failed to connect to upstream')).toBe(
- expected,
- );
+ expect(formatPatrolRuntimeFailureDetail('failed to connect to upstream')).toBe(expected);
});
it('matches "connection refused"', () => {
- expect(formatPatrolRuntimeFailureDetail('connection refused by host')).toBe(
- expected,
- );
+ expect(formatPatrolRuntimeFailureDetail('connection refused by host')).toBe(expected);
});
it('matches "no such host"', () => {
- expect(formatPatrolRuntimeFailureDetail('no such host: api.example')).toBe(
- expected,
- );
+ expect(formatPatrolRuntimeFailureDetail('no such host: api.example')).toBe(expected);
});
it('matches "i/o timeout"', () => {
@@ -214,15 +200,12 @@ describe('patrolFormat branch coverage (supplemental)', () => {
});
it('matches "returned status 5" (5xx prefix arm)', () => {
- expect(formatPatrolRuntimeFailureDetail('provider returned status 503')).toBe(
- expected,
- );
+ expect(formatPatrolRuntimeFailureDetail('provider returned status 503')).toBe(expected);
});
});
describe('provider-analysis classification arms', () => {
- const expected =
- 'Provider analysis failed. Check Provider & Models before retrying Patrol.';
+ const expected = 'Provider analysis failed. Check Provider & Models before retrying Patrol.';
it('matches the exact "agentic patrol failed" sentinel', () => {
expect(formatPatrolRuntimeFailureDetail('agentic patrol failed')).toBe(expected);
@@ -238,9 +221,7 @@ describe('patrolFormat branch coverage (supplemental)', () => {
it('matches the "agentic patrol failed: provider error" prefix', () => {
expect(
- formatPatrolRuntimeFailureDetail(
- 'agentic patrol failed: provider error something else',
- ),
+ formatPatrolRuntimeFailureDetail('agentic patrol failed: provider error something else'),
).toBe(expected);
});
});
@@ -304,9 +285,9 @@ describe('patrolFormat branch coverage (supplemental)', () => {
});
it('returns just the summary when detail is absent (summary || detail, detail empty)', () => {
- expect(
- formatPatrolRuntimeFailureSummary({ errorSummary: 'provider rate limited' }),
- ).toBe('provider rate limited');
+ expect(formatPatrolRuntimeFailureSummary({ errorSummary: 'provider rate limited' })).toBe(
+ 'provider rate limited',
+ );
});
it('returns just the detail when summary is absent (summary || detail, summary empty)', () => {
diff --git a/frontend-modern/src/utils/__tests__/patrolPagePresentation.test.ts b/frontend-modern/src/utils/__tests__/patrolPagePresentation.test.ts
index 3056cf8dc7..47aca76ac3 100644
--- a/frontend-modern/src/utils/__tests__/patrolPagePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/patrolPagePresentation.test.ts
@@ -52,8 +52,7 @@ describe('patrolPagePresentation', () => {
'Ask first: Patrol investigates and prepares fixes, but every change waits for approval.',
});
expect(getPatrolPageHeaderMeta({ autonomyLevel: 'assisted' })).toMatchObject({
- description:
- 'Safe auto-fix: Patrol may run low- or medium-risk fixes allowed by policy.',
+ description: 'Safe auto-fix: Patrol may run low- or medium-risk fixes allowed by policy.',
});
expect(getPatrolPageHeaderMeta({ autonomyLevel: 'full' })).toMatchObject({
description:
diff --git a/frontend-modern/src/utils/__tests__/patrolRunPresentation.branchcov.test.ts b/frontend-modern/src/utils/__tests__/patrolRunPresentation.branchcov.test.ts
index c12cc2ff4f..5f18d435c3 100644
--- a/frontend-modern/src/utils/__tests__/patrolRunPresentation.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/patrolRunPresentation.branchcov.test.ts
@@ -45,9 +45,7 @@ const makeRun = (overrides: Partial<PatrolRunRecord> = {}): PatrolRunRecord => (
...overrides,
});
-const makeTriggerStatus = (
- overrides: Partial<PatrolTriggerStatus> = {},
-): PatrolTriggerStatus => ({
+const makeTriggerStatus = (overrides: Partial<PatrolTriggerStatus> = {}): PatrolTriggerStatus => ({
running: false,
pending_triggers: 0,
current_interval_ms: 300_000,
@@ -496,19 +494,17 @@ describe('getPatrolTriggerStatusSummary (branch coverage)', () => {
it('returns undefined when triggers are blocked but manual run is explicitly available', () => {
expect(
- getPatrolTriggerStatusSummary(
- makeTriggerStatus({ event_triggers_blocked: true }),
- { manualRunAvailable: true },
- ),
+ getPatrolTriggerStatusSummary(makeTriggerStatus({ event_triggers_blocked: true }), {
+ manualRunAvailable: true,
+ }),
).toBeUndefined();
});
it('returns undefined when blocked, manual unavailable, but no blocked reason given', () => {
expect(
- getPatrolTriggerStatusSummary(
- makeTriggerStatus({ event_triggers_blocked: true }),
- { manualRunAvailable: false },
- ),
+ getPatrolTriggerStatusSummary(makeTriggerStatus({ event_triggers_blocked: true }), {
+ manualRunAvailable: false,
+ }),
).toBeUndefined();
});
@@ -546,13 +542,10 @@ describe('getPatrolTriggerStatusSummary (branch coverage)', () => {
it('returns the in-progress summary when manual is blocked by an already-running reason', () => {
expect(
- getPatrolTriggerStatusSummary(
- makeTriggerStatus({ event_triggers_blocked: true }),
- {
- manualRunAvailable: false,
- manualRunBlockedReason: 'Patrol run is in progress',
- },
- ),
+ getPatrolTriggerStatusSummary(makeTriggerStatus({ event_triggers_blocked: true }), {
+ manualRunAvailable: false,
+ manualRunBlockedReason: 'Patrol run is in progress',
+ }),
).toBe(
'A Patrol run is already in progress. New automatic and manual runs are paused until it finishes.',
);
diff --git a/frontend-modern/src/utils/__tests__/patrolRuntimePresentation.coverage.test.ts b/frontend-modern/src/utils/__tests__/patrolRuntimePresentation.coverage.test.ts
index 94498a8e79..635bdc9b12 100644
--- a/frontend-modern/src/utils/__tests__/patrolRuntimePresentation.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/patrolRuntimePresentation.coverage.test.ts
@@ -42,9 +42,7 @@ describe('normalizePatrolRuntimeBlockedReason', () => {
});
it('passes through an unrelated reason unchanged but trimmed', () => {
- expect(normalizePatrolRuntimeBlockedReason(' provider offline ')).toBe(
- 'provider offline',
- );
+ expect(normalizePatrolRuntimeBlockedReason(' provider offline ')).toBe('provider offline');
});
it('does not rewrite when the trigger word is a substring without word boundaries', () => {
@@ -57,8 +55,7 @@ describe('getPatrolRuntimePresentation', () => {
expect(getPatrolRuntimePresentation('blocked')).toMatchObject({
label: 'Patrol paused',
title: 'Patrol paused',
- description:
- 'Patrol cannot check infrastructure until the blocking condition is cleared.',
+ description: 'Patrol cannot check infrastructure until the blocking condition is cleared.',
tone: 'warning',
});
});
@@ -106,8 +103,7 @@ describe('getPatrolRuntimePresentation', () => {
expect(getPatrolRuntimePresentation('unavailable')).toMatchObject({
label: 'Patrol unavailable',
title: 'Patrol unavailable',
- description:
- 'Patrol is not ready yet. Check Provider & Models and runtime availability.',
+ description: 'Patrol is not ready yet. Check Provider & Models and runtime availability.',
tone: 'error',
});
});
@@ -131,9 +127,7 @@ describe('getPatrolRuntimePresentation', () => {
});
it('falls back to the "active" presentation for an unknown state value', () => {
- expect(
- getPatrolRuntimePresentation('idle' as unknown as PatrolRuntimeState),
- ).toMatchObject({
+ expect(getPatrolRuntimePresentation('idle' as unknown as PatrolRuntimeState)).toMatchObject({
label: 'Patrol enabled',
title: 'Patrol enabled',
description: 'Patrol is ready to check your infrastructure.',
diff --git a/frontend-modern/src/utils/__tests__/patrolSummaryPresentation.coverage.test.ts b/frontend-modern/src/utils/__tests__/patrolSummaryPresentation.coverage.test.ts
index 54786c88bd..6c94b299b7 100644
--- a/frontend-modern/src/utils/__tests__/patrolSummaryPresentation.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/patrolSummaryPresentation.coverage.test.ts
@@ -33,9 +33,7 @@ function makeFinding(overrides: Partial<AssessmentFinding> = {}): AssessmentFind
};
}
-function makeRuntimeFinding(
- overrides: Partial<AssessmentFinding> = {},
-): AssessmentFinding {
+function makeRuntimeFinding(overrides: Partial<AssessmentFinding> = {}): AssessmentFinding {
return makeFinding({
resourceId: 'ai-service',
resourceName: 'Pulse Patrol Service',
@@ -75,9 +73,7 @@ function makeRun(overrides: Partial<PatrolRunRecord> = {}): PatrolRunRecord {
};
}
-function makeHealth(
- overrides: Partial<IntelligenceHealthScore> = {},
-): IntelligenceHealthScore {
+function makeHealth(overrides: Partial<IntelligenceHealthScore> = {}): IntelligenceHealthScore {
return {
score: 90,
grade: 'A',
@@ -127,8 +123,7 @@ describe('getPatrolAssessmentShellPresentation', () => {
headerClass: 'bg-red-50/70 dark:bg-red-950/30',
badgeVariant: 'danger',
iconClass: 'text-red-600 dark:text-red-300',
- iconContainerClass:
- 'border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950/40',
+ iconContainerClass: 'border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950/40',
});
});
@@ -137,8 +132,7 @@ describe('getPatrolAssessmentShellPresentation', () => {
headerClass: 'bg-blue-50/70 dark:bg-blue-950/30',
badgeVariant: 'info',
iconClass: 'text-blue-600 dark:text-blue-300',
- iconContainerClass:
- 'border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-950/40',
+ iconContainerClass: 'border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-950/40',
});
});
@@ -307,8 +301,7 @@ describe('getPatrolAssessmentPresentation — runtime state', () => {
it('maps the blocked state to the paused runtime presentation', () => {
expect(getPatrolAssessmentPresentation({ runtimeState: 'blocked' })).toEqual({
title: 'Patrol paused',
- description:
- 'Patrol cannot check infrastructure until the blocking condition is cleared.',
+ description: 'Patrol cannot check infrastructure until the blocking condition is cleared.',
eyebrow: 'Patrol paused',
compactLabel: 'Patrol paused',
tone: 'warning',
@@ -328,8 +321,7 @@ describe('getPatrolAssessmentPresentation — runtime state', () => {
it('maps the unavailable state to the unavailable runtime presentation', () => {
expect(getPatrolAssessmentPresentation({ runtimeState: 'unavailable' })).toEqual({
title: 'Patrol unavailable',
- description:
- 'Patrol is not ready yet. Check Provider & Models and runtime availability.',
+ description: 'Patrol is not ready yet. Check Provider & Models and runtime availability.',
eyebrow: 'Patrol unavailable',
compactLabel: 'Patrol unavailable',
tone: 'error',
@@ -585,9 +577,7 @@ describe('getFindingAssessmentDescription — single runtime issue', () => {
expect(
getPatrolAssessmentPresentation({
warningFindings: 1,
- activeFindings: [
- makeRuntimeFinding({ title: 'Some custom runtime error' }),
- ],
+ activeFindings: [makeRuntimeFinding({ title: 'Some custom runtime error' })],
}).description,
).toContain('Some custom runtime error');
});
@@ -690,21 +680,18 @@ describe('predictionReadsAsCoverageGap (via getPatrolAssessmentPresentation)', (
['current full issue list'],
['current health may be incomplete'],
['summary may be incomplete'],
- ])(
- 'suppresses the coverage-gap prediction "%s" after a verified full run',
- (prediction) => {
- const description = getPatrolAssessmentPresentation({
- overallHealth: makeHealth({
- score: 80,
- grade: 'B',
- factors: [coverageFactor()],
- prediction,
- }),
- runs: [successfulFullRun()],
- }).description;
- expect(description).toBe('Patrol still needs attention.');
- },
- );
+ ])('suppresses the coverage-gap prediction "%s" after a verified full run', (prediction) => {
+ const description = getPatrolAssessmentPresentation({
+ overallHealth: makeHealth({
+ score: 80,
+ grade: 'B',
+ factors: [coverageFactor()],
+ prediction,
+ }),
+ runs: [successfulFullRun()],
+ }).description;
+ expect(description).toBe('Patrol still needs attention.');
+ });
});
// ===========================================================================
@@ -788,8 +775,7 @@ describe('getPatrolVerificationPresentation — runtime state', () => {
it('maps the blocked state to the paused runtime presentation', () => {
expect(getPatrolVerificationPresentation({ runtimeState: 'blocked' })).toEqual({
title: 'Patrol paused',
- description:
- 'Patrol cannot check infrastructure until the blocking condition is cleared.',
+ description: 'Patrol cannot check infrastructure until the blocking condition is cleared.',
compactLabel: 'Patrol paused',
tone: 'warning',
});
@@ -807,8 +793,7 @@ describe('getPatrolVerificationPresentation — runtime state', () => {
it('maps the unavailable state to the unavailable runtime presentation', () => {
expect(getPatrolVerificationPresentation({ runtimeState: 'unavailable' })).toEqual({
title: 'Patrol unavailable',
- description:
- 'Patrol is not ready yet. Check Provider & Models and runtime availability.',
+ description: 'Patrol is not ready yet. Check Provider & Models and runtime availability.',
compactLabel: 'Patrol unavailable',
tone: 'error',
});
@@ -830,8 +815,7 @@ describe('getPatrolVerificationPresentation — full run with errors (hasRunErro
}),
).toEqual({
title: 'Patrol check needs review',
- description:
- 'The most recent Patrol check covered 10 resources but ended with 2 errors.',
+ description: 'The most recent Patrol check covered 10 resources but ended with 2 errors.',
compactLabel: 'Check needs review',
tone: 'warning',
lastFullRunAt: '2026-07-10T09:05:00Z',
@@ -1090,18 +1074,14 @@ describe('getPatrolRecencyPresentation — timestamp fallback logic', () => {
});
it('returns last activity when only lastActivityAt is provided', () => {
- expect(
- getPatrolRecencyPresentation({ lastActivityAt: '2026-07-10T09:00:00Z' }),
- ).toEqual({
+ expect(getPatrolRecencyPresentation({ lastActivityAt: '2026-07-10T09:00:00Z' })).toEqual({
label: 'Last activity',
timestamp: '2026-07-10T09:00:00Z',
});
});
it('returns last check when only lastPatrolAt is provided', () => {
- expect(
- getPatrolRecencyPresentation({ lastPatrolAt: '2026-07-10T09:57:00Z' }),
- ).toEqual({
+ expect(getPatrolRecencyPresentation({ lastPatrolAt: '2026-07-10T09:57:00Z' })).toEqual({
label: 'Last check',
timestamp: '2026-07-10T09:57:00Z',
});
@@ -1210,17 +1190,13 @@ describe('normalizeRunType (via run-type classification)', () => {
it('treats undefined type as a full run', () => {
const run = makeRun({ resources_checked: 5, error_count: 0 });
delete (run as Partial<PatrolRunRecord>).type;
- expect(
- getPatrolVerificationPresentation({ runs: [run] }).title,
- ).toBe('Recently checked');
+ expect(getPatrolVerificationPresentation({ runs: [run] }).title).toBe('Recently checked');
});
it('treats "PATROL" (uppercase) as a full run', () => {
expect(
getPatrolVerificationPresentation({
- runs: [
- makeRun({ type: 'PATROL', resources_checked: 5, error_count: 0 }),
- ],
+ runs: [makeRun({ type: 'PATROL', resources_checked: 5, error_count: 0 })],
}).title,
).toBe('Recently checked');
});
@@ -1228,9 +1204,7 @@ describe('normalizeRunType (via run-type classification)', () => {
it('treats " Full " (whitespace, mixed case) as a full run', () => {
expect(
getPatrolVerificationPresentation({
- runs: [
- makeRun({ type: ' Full ', resources_checked: 5, error_count: 0 }),
- ],
+ runs: [makeRun({ type: ' Full ', resources_checked: 5, error_count: 0 })],
}).title,
).toBe('Recently checked');
});
@@ -1238,9 +1212,7 @@ describe('normalizeRunType (via run-type classification)', () => {
it('classifies "SCOPED" (uppercase) as a scoped run', () => {
expect(
getPatrolVerificationPresentation({
- runs: [
- makeRun({ type: 'SCOPED', resources_checked: 1, error_count: 0 }),
- ],
+ runs: [makeRun({ type: 'SCOPED', resources_checked: 1, error_count: 0 })],
}).description,
).toContain('targeted checks');
});
@@ -1248,9 +1220,7 @@ describe('normalizeRunType (via run-type classification)', () => {
it('classifies "verification" as a verification run', () => {
expect(
getPatrolVerificationPresentation({
- runs: [
- makeRun({ type: 'verification', resources_checked: 1, error_count: 0 }),
- ],
+ runs: [makeRun({ type: 'verification', resources_checked: 1, error_count: 0 })],
}).description,
).toContain('follow-up checks');
});
diff --git a/frontend-modern/src/utils/__tests__/platformSupportManifest.test.ts b/frontend-modern/src/utils/__tests__/platformSupportManifest.test.ts
index e4f565be5c..37d9dcdb13 100644
--- a/frontend-modern/src/utils/__tests__/platformSupportManifest.test.ts
+++ b/frontend-modern/src/utils/__tests__/platformSupportManifest.test.ts
@@ -338,11 +338,13 @@ describe('platformSupportManifest', () => {
expect(sourcePlatformSupportsOnboardingPath('agent', 'install-workspace')).toBe(true);
expect(sourcePlatformSupportsOnboardingPath('docker', 'install-workspace')).toBe(true);
expect(sourcePlatformSupportsOnboardingPath('kubernetes', 'install-workspace')).toBe(true);
- expect(sourcePlatformSupportsOnboardingPath('proxmox-pve', 'platform-connections')).toBe(true);
+ expect(sourcePlatformSupportsOnboardingPath('proxmox-pve', 'platform-connections')).toBe(
+ true,
+ );
expect(sourcePlatformSupportsOnboardingPath('truenas', 'platform-connections')).toBe(true);
- expect(
- sourcePlatformSupportsOnboardingPath('vmware-vsphere', 'platform-connections'),
- ).toBe(true);
+ expect(sourcePlatformSupportsOnboardingPath('vmware-vsphere', 'platform-connections')).toBe(
+ true,
+ );
});
it('returns false when the platform declares a different onboarding path', () => {
@@ -357,7 +359,9 @@ describe('platformSupportManifest', () => {
expect(sourcePlatformSupportsOnboardingPath('k8s', 'install-workspace')).toBe(true);
expect(sourcePlatformSupportsOnboardingPath('vmware', 'platform-connections')).toBe(true);
expect(sourcePlatformSupportsOnboardingPath('AGENT', 'install-workspace')).toBe(true);
- expect(sourcePlatformSupportsOnboardingPath('Proxmox-PVE', 'platform-connections')).toBe(true);
+ expect(sourcePlatformSupportsOnboardingPath('Proxmox-PVE', 'platform-connections')).toBe(
+ true,
+ );
});
it('returns false for presentation-only platforms, unknown input, and empty input', () => {
diff --git a/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.ts
index 843d34745e..be806cdf39 100644
--- a/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/pricingHandoff.branchcov0712b.test.ts
@@ -128,7 +128,9 @@ describe('pricingHandoff (branch coverage)', () => {
expect(getInProductPricingDestination('long_term_metrics')).toBe(
SELF_HOSTED_PRO_BILLING_PLAN_HREF,
);
- expect(getInProductPricingDestination('agent_profiles')).toBe(SELF_HOSTED_PRO_BILLING_PLAN_HREF);
+ expect(getInProductPricingDestination('agent_profiles')).toBe(
+ SELF_HOSTED_PRO_BILLING_PLAN_HREF,
+ );
expect(getInProductPricingDestination('self_hosted_plan')).toBe(
SELF_HOSTED_PRO_BILLING_PLAN_SELECTION_HREF,
);
@@ -233,7 +235,9 @@ describe('pricingHandoff (branch coverage)', () => {
SELF_HOSTED_PRO_BILLING_PLAN_ROUTE,
`?purchase=${SELF_HOSTED_PRO_BILLING_PURCHASE_ACTIVATED}`,
),
- ).toBe(`${SELF_HOSTED_PRO_BILLING_PLAN_HREF}?purchase=${SELF_HOSTED_PRO_BILLING_PURCHASE_ACTIVATED}`);
+ ).toBe(
+ `${SELF_HOSTED_PRO_BILLING_PLAN_HREF}?purchase=${SELF_HOSTED_PRO_BILLING_PURCHASE_ACTIVATED}`,
+ );
});
it('defaults the bare canonical billing root to the plan href', () => {
diff --git a/frontend-modern/src/utils/__tests__/quickstartCopyContract.test.ts b/frontend-modern/src/utils/__tests__/quickstartCopyContract.test.ts
index bd03526c44..2f392c81d7 100644
--- a/frontend-modern/src/utils/__tests__/quickstartCopyContract.test.ts
+++ b/frontend-modern/src/utils/__tests__/quickstartCopyContract.test.ts
@@ -4,7 +4,8 @@ import { fileURLToPath } from 'node:url';
import { describe, expect, it } from 'vitest';
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../../../../');
-const readRepoFile = (relativePath: string) => readFileSync(resolve(repoRoot, relativePath), 'utf-8');
+const readRepoFile = (relativePath: string) =>
+ readFileSync(resolve(repoRoot, relativePath), 'utf-8');
describe('quickstart copy contract', () => {
it('keeps self-hosted public docs free of hosted quickstart claims', () => {
@@ -62,7 +63,9 @@ describe('quickstart copy contract', () => {
const ai = readRepoFile('docs/AI.md');
expect(ai).toContain('the configured LLM owns diagnosis');
- expect(ai).toContain('Pulse supplies context, capabilities, safety gates, approval state, and audit trails');
+ expect(ai).toContain(
+ 'Pulse supplies context, capabilities, safety gates, approval state, and audit trails',
+ );
expect(ai).toContain('Pulse does not convert them into Pulse-authored findings');
expect(ai).not.toContain("learns what's normal");
diff --git a/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts b/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts
index 6b136c92d2..35835220d6 100644
--- a/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/rbacPresentation.test.ts
@@ -28,12 +28,12 @@ describe('rbacPresentation', () => {
title: 'Custom Roles',
body: expect.not.stringContaining('Pro'),
});
- expect(
- getRBACFeatureGateCopy('user-assignments', { showCommercialCopy: false }),
- ).toMatchObject({
- title: 'Centralized Access Control',
- body: expect.not.stringContaining('Pro'),
- });
+ expect(getRBACFeatureGateCopy('user-assignments', { showCommercialCopy: false })).toMatchObject(
+ {
+ title: 'Centralized Access Control',
+ body: expect.not.stringContaining('Pro'),
+ },
+ );
});
it('returns canonical user assignments empty state copy', () => {
diff --git a/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov.test.ts b/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov.test.ts
index 018e053e05..2d68c18ab2 100644
--- a/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov.test.ts
@@ -151,9 +151,9 @@ describe('recoveryItemTypePresentation branch coverage', () => {
expect(getRecoveryPointItemTypeKey(undefined)).toBe('');
expect(getRecoveryPointItemTypeKey({})).toBe('');
// Explicitly-null nested refs still resolve to ''.
- expect(
- getRecoveryPointItemTypeKey({ display: null, itemRef: null, subjectRef: null }),
- ).toBe('');
+ expect(getRecoveryPointItemTypeKey({ display: null, itemRef: null, subjectRef: null })).toBe(
+ '',
+ );
});
});
@@ -182,9 +182,7 @@ describe('recoveryItemTypePresentation branch coverage', () => {
it('returns the table badge classes for known keys', () => {
const podTone = 'bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-300';
- expect(getRecoveryItemTypeBadgeClass('pod')).toBe(
- `${TABLE_BADGE_BASE_CLASSES} ${podTone}`,
- );
+ expect(getRecoveryItemTypeBadgeClass('pod')).toBe(`${TABLE_BADGE_BASE_CLASSES} ${podTone}`);
expect(getRecoveryItemTypeBadgeClass('pvc')).toBe(
`${TABLE_BADGE_BASE_CLASSES} ${DEFAULT_BADGE_TONE_CLASSES}`,
);
diff --git a/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov0712b.test.ts
index 3554a228fe..96742a0d1f 100644
--- a/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.branchcov0712b.test.ts
@@ -9,8 +9,9 @@ import { getRecoveryItemTypePresentation } from '@/utils/recoveryItemTypePresent
// cannot reference outer consts (it is hoisted), so the sentinel literal is
// duplicated below in FORCE_NULL_KEY.
vi.mock('@/utils/resourceTypePresentation', async () => {
- const actual =
- await vi.importActual<typeof import('@/utils/resourceTypePresentation')>('@/utils/resourceTypePresentation');
+ const actual = await vi.importActual<typeof import('@/utils/resourceTypePresentation')>(
+ '@/utils/resourceTypePresentation',
+ );
return {
...actual,
getResourceTypePresentation: (
@@ -37,8 +38,7 @@ const DEFAULT_TABLE_BADGE_CLASSES = `${TABLE_BADGE_BASE_CLASSES} ${DEFAULT_BADGE
// Workload tones mirrored from workloadTypePresentation's PRESENTATION_MAP; the
// vm / system-container / app-container arms thread these through verbatim.
const VM_TONE = 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300';
-const SYSTEM_CONTAINER_TONE =
- 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300';
+const SYSTEM_CONTAINER_TONE = 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300';
const APP_CONTAINER_TONE = 'bg-sky-100 text-sky-700 dark:bg-sky-900 dark:text-sky-300';
describe('getRecoveryItemTypePresentation — branch coverage (branchcov2)', () => {
diff --git a/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.test.ts b/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.test.ts
index 11d45ac143..3080236c17 100644
--- a/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryItemTypePresentation.test.ts
@@ -55,7 +55,9 @@ describe('recoveryItemTypePresentation', () => {
it('falls back cleanly for unknown item types', () => {
expect(getRecoveryItemTypeLabel('custom-thing')).toBe('Custom Thing');
- expect(getRecoveryItemTypeBadgeClass('custom-thing')).toContain('bg-surface-alt text-base-content');
+ expect(getRecoveryItemTypeBadgeClass('custom-thing')).toContain(
+ 'bg-surface-alt text-base-content',
+ );
expect(getRecoveryItemTypeBadgeClass('custom-thing')).toContain('inline-flex items-center');
expect(getRecoveryItemTypeBadgeClass('custom-thing')).toContain('px-1 py-0.5');
});
diff --git a/frontend-modern/src/utils/__tests__/recoveryPlatformModel.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/recoveryPlatformModel.branchcov2.test.ts
index 7479590468..86a47450b0 100644
--- a/frontend-modern/src/utils/__tests__/recoveryPlatformModel.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryPlatformModel.branchcov2.test.ts
@@ -74,9 +74,10 @@ describe('recoveryPlatformModel.branchcov2', () => {
});
it('trims and filters blank entries from the resolved values', () => {
- expect(
- getRecoveryRollupPlatforms({ platforms: [' a ', '', ' ', 'b'] }),
- ).toEqual(['a', 'b']);
+ expect(getRecoveryRollupPlatforms({ platforms: [' a ', '', ' ', 'b'] })).toEqual([
+ 'a',
+ 'b',
+ ]);
// All entries normalize to empty -> filter(Boolean) yields [].
expect(getRecoveryRollupPlatforms({ platforms: [' ', ''] })).toEqual([]);
});
@@ -263,7 +264,7 @@ describe('recoveryPlatformModel.branchcov2', () => {
meta: null,
} as unknown as Parameters<typeof normalizeRecoveryRollupsResponse>[0]),
).toStrictEqual({ data: [], meta: defaults });
- });
+ });
});
describe('normalizeRecoveryPointsResponse', () => {
diff --git a/frontend-modern/src/utils/__tests__/recoveryPlatformModel.test.ts b/frontend-modern/src/utils/__tests__/recoveryPlatformModel.test.ts
index 258837bffa..f1f81374aa 100644
--- a/frontend-modern/src/utils/__tests__/recoveryPlatformModel.test.ts
+++ b/frontend-modern/src/utils/__tests__/recoveryPlatformModel.test.ts
@@ -124,15 +124,15 @@ describe('recoveryPlatformModel', () => {
}),
).toEqual({
data: [
- {
- id: 'point-1',
- platform: 'truenas',
- kind: 'snapshot',
- mode: 'snapshot',
- outcome: 'success',
- itemResourceId: 'res-1',
- itemRef: { type: 'truenas-dataset', name: 'tank/apps' },
- },
+ {
+ id: 'point-1',
+ platform: 'truenas',
+ kind: 'snapshot',
+ mode: 'snapshot',
+ outcome: 'success',
+ itemResourceId: 'res-1',
+ itemRef: { type: 'truenas-dataset', name: 'tank/apps' },
+ },
],
meta: { page: 1, limit: 100, total: 1, totalPages: 1 },
});
@@ -152,13 +152,13 @@ describe('recoveryPlatformModel', () => {
}),
).toEqual({
data: [
- {
- rollupId: 'rollup-1',
- lastOutcome: 'warning',
- itemResourceId: 'res-1',
- itemRef: { type: 'truenas-dataset', name: 'tank/apps' },
- platforms: ['truenas'],
- },
+ {
+ rollupId: 'rollup-1',
+ lastOutcome: 'warning',
+ itemResourceId: 'res-1',
+ itemRef: { type: 'truenas-dataset', name: 'tank/apps' },
+ platforms: ['truenas'],
+ },
],
meta: { page: 1, limit: 100, total: 1, totalPages: 1 },
});
diff --git a/frontend-modern/src/utils/__tests__/relayPresentation.test.ts b/frontend-modern/src/utils/__tests__/relayPresentation.test.ts
index a9809f2a00..412518d520 100644
--- a/frontend-modern/src/utils/__tests__/relayPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/relayPresentation.test.ts
@@ -54,14 +54,11 @@ describe('relayPresentation', () => {
it('returns activation-required presentation for missing Relay token errors', () => {
expect(
- getRelayConnectionPresentation(
- { enabled: true } as never,
- {
- connected: false,
- active_channels: 0,
- last_error: 'register: no license token available',
- },
- ),
+ getRelayConnectionPresentation({ enabled: true } as never, {
+ connected: false,
+ active_channels: 0,
+ last_error: 'register: no license token available',
+ }),
).toEqual({
variant: 'danger',
label: RELAY_ACTIVATION_REQUIRED_LABEL,
diff --git a/frontend-modern/src/utils/__tests__/reportableResourceTypes.branchcov0712.test.ts b/frontend-modern/src/utils/__tests__/reportableResourceTypes.branchcov0712.test.ts
index 046fbddaff..0045baecb0 100644
--- a/frontend-modern/src/utils/__tests__/reportableResourceTypes.branchcov0712.test.ts
+++ b/frontend-modern/src/utils/__tests__/reportableResourceTypes.branchcov0712.test.ts
@@ -105,7 +105,7 @@ describe('matchesReportableResourceTypeFilter — branch coverage (branchcov2)',
expect(matchesReportableResourceTypeFilter({ type: 'storage' }, 'recovery')).toBe(false);
});
- it("returns true via the defensive fall-through for an unrecognized filter value", () => {
+ it('returns true via the defensive fall-through for an unrecognized filter value', () => {
// No declared ResourcePickerTypeFilter reaches the final `return true`, so a
// bogus value is cast through unknown to satisfy strict mode while driving
// the branch at runtime.
diff --git a/frontend-modern/src/utils/__tests__/reportingPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/reportingPresentation.branchcov0712b.test.ts
index d53ed083f9..024d610209 100644
--- a/frontend-modern/src/utils/__tests__/reportingPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/reportingPresentation.branchcov0712b.test.ts
@@ -31,14 +31,11 @@ describe('resolveReportingDownloadFilename', () => {
it('returns the fallback when content-disposition is not a string (defensive typeof guard)', () => {
expect(
- resolveReportingDownloadFilename(
- undefined as unknown as ContentDisposition,
- fallback,
- ),
- ).toBe(fallback);
- expect(
- resolveReportingDownloadFilename(42 as unknown as ContentDisposition, fallback),
+ resolveReportingDownloadFilename(undefined as unknown as ContentDisposition, fallback),
).toBe(fallback);
+ expect(resolveReportingDownloadFilename(42 as unknown as ContentDisposition, fallback)).toBe(
+ fallback,
+ );
});
it('returns the fallback when content-disposition is an empty string', () => {
@@ -61,7 +58,7 @@ describe('resolveReportingDownloadFilename', () => {
it('prefers the RFC 5987 encoded filename over a quoted filename', () => {
expect(
resolveReportingDownloadFilename(
- "attachment; filename=\"quoted.pdf\"; filename*=UTF-8''encoded%20report.csv",
+ 'attachment; filename="quoted.pdf"; filename*=UTF-8\'\'encoded%20report.csv',
fallback,
),
).toBe('encoded report.csv');
@@ -69,17 +66,12 @@ describe('resolveReportingDownloadFilename', () => {
it('returns the raw encoded token when it cannot be URI-decoded (decodeRFC5987Value catch path)', () => {
// '%' is not a valid URI escape, so decodeURIComponent throws and the helper returns the original token.
- expect(
- resolveReportingDownloadFilename("attachment; filename*=UTF-8''%", fallback),
- ).toBe('%');
+ expect(resolveReportingDownloadFilename("attachment; filename*=UTF-8''%", fallback)).toBe('%');
});
it('returns the quoted filename when a quoted directive is present', () => {
expect(
- resolveReportingDownloadFilename(
- 'attachment; filename="canonical-report.pdf"',
- fallback,
- ),
+ resolveReportingDownloadFilename('attachment; filename="canonical-report.pdf"', fallback),
).toBe('canonical-report.pdf');
});
@@ -99,8 +91,6 @@ describe('resolveReportingDownloadFilename', () => {
});
it('returns the fallback when no filename directive is present at all', () => {
- expect(resolveReportingDownloadFilename('attachment; size=1234', fallback)).toBe(
- fallback,
- );
+ expect(resolveReportingDownloadFilename('attachment; size=1234', fallback)).toBe(fallback);
});
});
diff --git a/frontend-modern/src/utils/__tests__/resourceAssistantContextModel.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/resourceAssistantContextModel.branchcov0712b.test.ts
index 83c55dacba..d3e2fdb934 100644
--- a/frontend-modern/src/utils/__tests__/resourceAssistantContextModel.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceAssistantContextModel.branchcov0712b.test.ts
@@ -4,10 +4,7 @@ import {
type ResourceAssistantContextTarget,
} from '@/utils/resourceAssistantContextModel';
import type { AIChatContext } from '@/stores/aiChat';
-import type {
- ResourceDiscoveryReadiness,
- ResourceDiscoveryTarget,
-} from '@/types/resource';
+import type { ResourceDiscoveryReadiness, ResourceDiscoveryTarget } from '@/types/resource';
// Minimal target factory matching the required fields of
// `ResourceAssistantContextTarget`. Optional facets are layered in per-test to
@@ -33,9 +30,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
});
it('falls back to target.id when name is an empty string', () => {
- const context = buildResourceAssistantContextForTarget(
- makeTarget({ id: 'id-7', name: '' }),
- );
+ const context = buildResourceAssistantContextForTarget(makeTarget({ id: 'id-7', name: '' }));
expect(context.briefing?.title).toBe('id-7');
expect(context.handoffResources?.[0]?.name).toBe('id-7');
});
@@ -86,9 +81,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
discoveryReadiness: { state: 'fresh' } satisfies ResourceDiscoveryReadiness,
}),
);
- expect(context.briefing?.statusLabel).toBe(
- 'Read-only context attached · Discovery fresh',
- );
+ expect(context.briefing?.statusLabel).toBe('Read-only context attached · Discovery fresh');
});
it('appends the unknown statusLabel when discoveryTarget exists but readiness is absent', () => {
@@ -103,9 +96,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
} satisfies ResourceDiscoveryTarget,
}),
);
- expect(context.briefing?.statusLabel).toBe(
- 'Read-only context attached · Discovery unknown',
- );
+ expect(context.briefing?.statusLabel).toBe('Read-only context attached · Discovery unknown');
});
it('uses the plain statusLabel when neither readiness nor discoveryTarget are present', () => {
@@ -150,9 +141,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
});
it('drops the Parent line and leaves node undefined when parentName is absent', () => {
- const context = buildResourceAssistantContextForTarget(
- makeTarget({ parentName: undefined }),
- );
+ const context = buildResourceAssistantContextForTarget(makeTarget({ parentName: undefined }));
expect(context.briefing?.detailLines?.some((l) => l.startsWith('Parent:'))).toBe(false);
expect(context.handoffResources?.[0]?.node).toBeUndefined();
});
@@ -171,9 +160,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
});
it('drops the Discovery line when discoveryTarget is absent', () => {
- const context = buildResourceAssistantContextForTarget(
- makeTarget({ discoveryTarget: null }),
- );
+ const context = buildResourceAssistantContextForTarget(makeTarget({ discoveryTarget: null }));
expect(context.briefing?.detailLines?.some((l) => l.startsWith('Discovery:'))).toBe(false);
});
@@ -205,9 +192,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
describe('context + handoff shape', () => {
it('echoes status into context.resourceStatus when status is provided', () => {
- const context = buildResourceAssistantContextForTarget(
- makeTarget({ status: 'maintenance' }),
- );
+ const context = buildResourceAssistantContextForTarget(makeTarget({ status: 'maintenance' }));
expect(context.context).toStrictEqual({
source: 'resource-detail-drawer',
resourceId: 'res-1',
@@ -217,9 +202,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
});
it('leaves context.resourceStatus undefined when status is absent', () => {
- const context = buildResourceAssistantContextForTarget(
- makeTarget({ status: undefined }),
- );
+ const context = buildResourceAssistantContextForTarget(makeTarget({ status: undefined }));
// Destructure to assert the literal key is absent (undefined), not omitted
// from the returned object via toStrictEqual semantics.
expect(context.context?.resourceStatus).toBeUndefined();
@@ -279,9 +262,7 @@ describe('buildResourceAssistantContextForTarget — branch coverage (branchcov2
],
safetyNote: 'Approval required before any action.',
},
- handoffResources: [
- { id: 'vm-101', name: 'web-prod-01', type: 'vm', node: 'esxi-host-1' },
- ],
+ handoffResources: [{ id: 'vm-101', name: 'web-prod-01', type: 'vm', node: 'esxi-host-1' }],
handoffMetadata: { kind: 'resource_context' },
autonomousMode: false,
};
diff --git a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov.test.ts b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov.test.ts
index 85b7d34840..c0f9fe0b7f 100644
--- a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov.test.ts
@@ -171,9 +171,7 @@ describe('withBadgeVersion (via getInfrastructureSystemIdentityBadges) — branc
topology: 'datastore',
} as Resource['storage'],
});
- expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual([
- 'PBS 2',
- ]);
+ expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual(['PBS 2']);
});
it('keeps the title unchanged when the version already appears in the title', () => {
@@ -241,7 +239,9 @@ describe('getAgentSystemIdentityBadge (via getInfrastructureSystemIdentityBadges
osName: 'truenas',
}),
);
- expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual(['TrueNAS']);
+ expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual([
+ 'TrueNAS',
+ ]);
});
it('derives a known source from manifest display tokens in the osName', () => {
@@ -251,7 +251,9 @@ describe('getAgentSystemIdentityBadge (via getInfrastructureSystemIdentityBadges
osName: 'Synology DSM',
}),
);
- expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual(['Synology']);
+ expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual([
+ 'Synology',
+ ]);
});
it.each([
@@ -286,7 +288,9 @@ describe('getAgentSystemIdentityBadge (via getInfrastructureSystemIdentityBadges
osName: '',
}),
);
- expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual(['FreeBSD']);
+ expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual([
+ 'FreeBSD',
+ ]);
});
it('returns null for an agent with no recognizable identity (falls through)', () => {
@@ -318,7 +322,9 @@ describe('getKnownHostIdentitySource (via identity badges) — branch coverage',
osName: 'truenas',
}),
);
- expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual(['TrueNAS']);
+ expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual([
+ 'TrueNAS',
+ ]);
});
it('excludes docker from host identity even when docker tokens are present', () => {
@@ -360,7 +366,9 @@ describe('getHostIdentityAgentProfile (via identity badges) — branch coverage'
osName: 'truenas',
}),
);
- expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual(['TrueNAS']);
+ expect(getInfrastructureSystemIdentityBadges(resource).map((b) => b.label)).toEqual([
+ 'TrueNAS',
+ ]);
});
});
diff --git a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov2.test.ts
index b1684a2b01..15f56af420 100644
--- a/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceBadgePresentation.branchcov2.test.ts
@@ -84,9 +84,10 @@ describe('getInfrastructurePlatformBadges (branch coverage)', () => {
});
it('keeps every non-agent platform source when multiple infrastructure platforms remain', () => {
- expect(
- getInfrastructurePlatformBadges(['docker', 'kubernetes']).map((b) => b.label),
- ).toEqual(['Docker / Podman', 'K8s']);
+ expect(getInfrastructurePlatformBadges(['docker', 'kubernetes']).map((b) => b.label)).toEqual([
+ 'Docker / Podman',
+ 'K8s',
+ ]);
});
});
diff --git a/frontend-modern/src/utils/__tests__/resourceChangePresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/resourceChangePresentation.branchcov2.test.ts
index e8cf35f6c1..e947c961e8 100644
--- a/frontend-modern/src/utils/__tests__/resourceChangePresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceChangePresentation.branchcov2.test.ts
@@ -40,9 +40,7 @@ describe('formatResourceChangeKind (branch coverage)', () => {
it('returns an empty string for an empty kind via the default arm fallback', () => {
expect(
- formatResourceChangeKind(
- '' as unknown as Parameters<typeof formatResourceChangeKind>[0],
- ),
+ formatResourceChangeKind('' as unknown as Parameters<typeof formatResourceChangeKind>[0]),
).toBe('');
});
});
@@ -188,9 +186,9 @@ describe('formatResourceChangeHeadline (branch coverage)', () => {
});
it('falls back to the resourceId when a restart has neither endpoints nor a reason', () => {
- expect(
- formatResourceChangeHeadline(makeChange({ kind: 'restart', resourceId: 'vm:99' })),
- ).toBe('Restart: vm:99');
+ expect(formatResourceChangeHeadline(makeChange({ kind: 'restart', resourceId: 'vm:99' }))).toBe(
+ 'Restart: vm:99',
+ );
});
it('trims surrounding whitespace from a reason before composing the headline', () => {
diff --git a/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov.test.ts b/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov.test.ts
index 8ea9b42cec..1899b1a059 100644
--- a/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov.test.ts
@@ -12,9 +12,7 @@ import {
sortResourceRelationships,
} from '@/utils/resourceCorrelationPresentation';
-const makeCorrelation = (
- overrides: Partial<ResourceCorrelation> = {},
-): ResourceCorrelation => ({
+const makeCorrelation = (overrides: Partial<ResourceCorrelation> = {}): ResourceCorrelation => ({
source_id: 'storage-1',
source_name: 'Storage 1',
source_type: 'storage',
@@ -30,9 +28,7 @@ const makeCorrelation = (
...overrides,
});
-const makeRelationship = (
- overrides: Partial<ResourceRelationship> = {},
-): ResourceRelationship => ({
+const makeRelationship = (overrides: Partial<ResourceRelationship> = {}): ResourceRelationship => ({
sourceId: 'node:pve-1',
targetId: 'vm-42',
type: 'runs_on',
@@ -250,9 +246,9 @@ describe('sortResourceCorrelations (branch coverage)', () => {
describe('formatResourceRelationshipEndpoint (branch coverage)', () => {
it('returns Unknown resource when sourceId is empty', () => {
- expect(
- formatResourceRelationshipEndpoint(makeRelationship({ sourceId: '' }), 'source'),
- ).toBe('Unknown resource');
+ expect(formatResourceRelationshipEndpoint(makeRelationship({ sourceId: '' }), 'source')).toBe(
+ 'Unknown resource',
+ );
});
it('returns Unknown resource when targetId is whitespace-only', () => {
@@ -279,9 +275,7 @@ describe('formatResourceRelationshipSummary (branch coverage)', () => {
it('filters out the fallback discoverer label when discoverer is empty', () => {
expect(
- formatResourceRelationshipSummary(
- makeRelationship({ confidence: 0.5, discoverer: '' }),
- ),
+ formatResourceRelationshipSummary(makeRelationship({ confidence: 0.5, discoverer: '' })),
).toBe('50% confidence');
});
@@ -299,9 +293,7 @@ describe('formatResourceRelationshipSummary (branch coverage)', () => {
it('humanizes an all-caps discoverer via the lowercase arm', () => {
expect(
- formatResourceRelationshipSummary(
- makeRelationship({ confidence: 0.4, discoverer: 'SNMP' }),
- ),
+ formatResourceRelationshipSummary(makeRelationship({ confidence: 0.4, discoverer: 'SNMP' })),
).toBe('40% confidence · Snmp');
});
diff --git a/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov0712b.test.ts
index 0d641337e7..75a47cd1e0 100644
--- a/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceCorrelationPresentation.branchcov0712b.test.ts
@@ -14,9 +14,7 @@ import {
// when `avg_delay` is a Go duration string)
// - sortResourceCorrelations
// - sortResourceRelationships
-const makeCorrelation = (
- overrides: Partial<ResourceCorrelation> = {},
-): ResourceCorrelation => ({
+const makeCorrelation = (overrides: Partial<ResourceCorrelation> = {}): ResourceCorrelation => ({
source_id: 'storage-1',
source_name: 'Storage 1',
source_type: 'storage',
@@ -32,9 +30,7 @@ const makeCorrelation = (
...overrides,
});
-const makeRelationship = (
- overrides: Partial<ResourceRelationship> = {},
-): ResourceRelationship => ({
+const makeRelationship = (overrides: Partial<ResourceRelationship> = {}): ResourceRelationship => ({
sourceId: 'node:pve-1',
targetId: 'vm-42',
type: 'runs_on',
@@ -54,62 +50,58 @@ describe('parseGoDurationMs (via formatResourceCorrelationSummary)', () => {
// the formatted delay, making assertions unambiguous.
it('returns null (omitting delay) for a whitespace-only string via the empty-normalized early return', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: ' ' })),
- ).toBe('2 occurrences');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: ' ' }))).toBe(
+ '2 occurrences',
+ );
});
it('trims surrounding whitespace before parsing', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: ' 5s ' })),
- ).toBe('2 occurrences · avg delay 5s');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: ' 5s ' }))).toBe(
+ '2 occurrences · avg delay 5s',
+ );
});
it('parses the h (hour) unit', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '2h' })),
- ).toBe('2 occurrences · avg delay 120m');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '2h' }))).toBe(
+ '2 occurrences · avg delay 120m',
+ );
});
it('parses a fractional amount using the decimal part of the duration pattern', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '1.0s' })),
- ).toBe('2 occurrences · avg delay 1s');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '1.0s' }))).toBe(
+ '2 occurrences · avg delay 1s',
+ );
});
it('parses the us (microseconds) unit', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '2000us' })),
- ).toBe('2 occurrences · avg delay 2ms');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '2000us' }))).toBe(
+ '2 occurrences · avg delay 2ms',
+ );
});
it('parses the µs (unicode microseconds) unit', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '2000µs' })),
- ).toBe('2 occurrences · avg delay 2ms');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '2000µs' }))).toBe(
+ '2 occurrences · avg delay 2ms',
+ );
});
it('parses the ns (nanoseconds) unit', () => {
- expect(
- formatResourceCorrelationSummary(
- makeCorrelation({ avg_delay: '3000000ns' }),
- ),
- ).toBe('2 occurrences · avg delay 3ms');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '3000000ns' }))).toBe(
+ '2 occurrences · avg delay 3ms',
+ );
});
it('accumulates multiple unit tokens in a single duration string', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '1h30m' })),
- ).toBe('2 occurrences · avg delay 90m');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '1h30m' }))).toBe(
+ '2 occurrences · avg delay 90m',
+ );
});
it('returns null when the matched amount is not finite (defensive continue branch)', () => {
// 400 nines overflow Number.parseFloat to Infinity, exercising the
// `if (!Number.isFinite(amount)) continue;` branch.
expect(
- formatResourceCorrelationSummary(
- makeCorrelation({ avg_delay: `${'9'.repeat(400)}s` }),
- ),
+ formatResourceCorrelationSummary(makeCorrelation({ avg_delay: `${'9'.repeat(400)}s` })),
).toBe('2 occurrences');
});
@@ -118,22 +110,20 @@ describe('parseGoDurationMs (via formatResourceCorrelationSummary)', () => {
// to Infinity, exercising the `!Number.isFinite(totalNs)` arm of the
// terminal guard.
expect(
- formatResourceCorrelationSummary(
- makeCorrelation({ avg_delay: `${'9'.repeat(300)}h` }),
- ),
+ formatResourceCorrelationSummary(makeCorrelation({ avg_delay: `${'9'.repeat(300)}h` })),
).toBe('2 occurrences');
});
it('returns null when the parsed duration is zero (totalNs <= 0 guard)', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '0s' })),
- ).toBe('2 occurrences');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '0s' }))).toBe(
+ '2 occurrences',
+ );
});
it('returns null when no unit token matches at all (!matched guard)', () => {
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: 'abc' })),
- ).toBe('2 occurrences');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: 'abc' }))).toBe(
+ '2 occurrences',
+ );
});
it('documents the current behaviour that an `ms` token is consumed as minutes', () => {
@@ -142,9 +132,9 @@ describe('parseGoDurationMs (via formatResourceCorrelationSummary)', () => {
// `5m`) and the trailing `s` is left unparsed. The result is therefore
// 5 minutes, not 5 milliseconds. This is reported as a suspected source
// bug; the assertion pins the actual current behaviour.
- expect(
- formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '5ms' })),
- ).toBe('2 occurrences · avg delay 5m');
+ expect(formatResourceCorrelationSummary(makeCorrelation({ avg_delay: '5ms' }))).toBe(
+ '2 occurrences · avg delay 5m',
+ );
});
});
@@ -227,10 +217,7 @@ describe('sortResourceRelationships (branch coverage)', () => {
}),
makeRelationship({ sourceId: 'true-active', active: true, confidence: 0 }),
]);
- expect(sorted.map((r) => r.sourceId)).toEqual([
- 'true-active',
- 'undefined-active',
- ]);
+ expect(sorted.map((r) => r.sourceId)).toEqual(['true-active', 'undefined-active']);
});
it('sorts active before inactive, then by confidence, then by observedAt fallback', () => {
@@ -302,11 +289,7 @@ describe('sortResourceRelationships (branch coverage)', () => {
]);
// All active, all confidence 0.5 -> time tie-break, newest first.
// last-seen (2026-05) > observed-only (2026-04) > no-times (0).
- expect(sorted.map((r) => r.sourceId)).toEqual([
- 'last-seen',
- 'observed-only',
- 'no-times',
- ]);
+ expect(sorted.map((r) => r.sourceId)).toEqual(['last-seen', 'observed-only', 'no-times']);
});
it('returns a new array instance (does not return the input reference)', () => {
diff --git a/frontend-modern/src/utils/__tests__/resourceDiscoveryReadiness.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/resourceDiscoveryReadiness.branchcov2.test.ts
index 1605b2bb43..4d0f1cbeea 100644
--- a/frontend-modern/src/utils/__tests__/resourceDiscoveryReadiness.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceDiscoveryReadiness.branchcov2.test.ts
@@ -4,10 +4,7 @@ import {
formatReadinessAge,
getDiscoveryReadinessPresentation,
} from '@/utils/resourceDiscoveryReadiness';
-import type {
- ResourceDiscoveryReadiness,
- ResourceDiscoveryReadinessState,
-} from '@/types/resource';
+import type { ResourceDiscoveryReadiness, ResourceDiscoveryReadinessState } from '@/types/resource';
// `formatDiscoveryAge` (from @/api/discovery) is wall-clock dependent. Mock it
// deterministically so the `observedAt`-driven code paths assert concrete
@@ -113,13 +110,55 @@ describe('resourceDiscoveryReadiness — branch coverage (branchcov2)', () => {
statusLabel: string;
tone: string;
}> = [
- { state: 'fresh', label: 'Discovery fresh', shortLabel: 'Fresh', statusLabel: 'Discovery fresh', tone: 'success' },
- { state: 'stale', label: 'Discovery stale', shortLabel: 'Stale', statusLabel: 'Discovery stale', tone: 'warning' },
- { state: 'missing', label: 'Not discovered', shortLabel: 'None', statusLabel: 'No discovery data', tone: 'muted' },
- { state: 'running', label: 'Discovery running', shortLabel: 'Running', statusLabel: 'Discovery running', tone: 'info' },
- { state: 'failed', label: 'Discovery failed', shortLabel: 'Failed', statusLabel: 'Discovery failed', tone: 'danger' },
- { state: 'unavailable', label: 'Discovery unavailable', shortLabel: 'Unavailable', statusLabel: 'Discovery unavailable', tone: 'warning' },
- { state: 'unsupported', label: 'Not supported', shortLabel: 'N/A', statusLabel: 'Discovery unsupported', tone: 'muted' },
+ {
+ state: 'fresh',
+ label: 'Discovery fresh',
+ shortLabel: 'Fresh',
+ statusLabel: 'Discovery fresh',
+ tone: 'success',
+ },
+ {
+ state: 'stale',
+ label: 'Discovery stale',
+ shortLabel: 'Stale',
+ statusLabel: 'Discovery stale',
+ tone: 'warning',
+ },
+ {
+ state: 'missing',
+ label: 'Not discovered',
+ shortLabel: 'None',
+ statusLabel: 'No discovery data',
+ tone: 'muted',
+ },
+ {
+ state: 'running',
+ label: 'Discovery running',
+ shortLabel: 'Running',
+ statusLabel: 'Discovery running',
+ tone: 'info',
+ },
+ {
+ state: 'failed',
+ label: 'Discovery failed',
+ shortLabel: 'Failed',
+ statusLabel: 'Discovery failed',
+ tone: 'danger',
+ },
+ {
+ state: 'unavailable',
+ label: 'Discovery unavailable',
+ shortLabel: 'Unavailable',
+ statusLabel: 'Discovery unavailable',
+ tone: 'warning',
+ },
+ {
+ state: 'unsupported',
+ label: 'Not supported',
+ shortLabel: 'N/A',
+ statusLabel: 'Discovery unsupported',
+ tone: 'muted',
+ },
];
for (const { state, label, shortLabel, statusLabel, tone } of cases) {
@@ -133,7 +172,9 @@ describe('resourceDiscoveryReadiness — branch coverage (branchcov2)', () => {
});
it('falls back to the unknown copy when the state is not canonical (STATE_COPY ?? fallback)', () => {
- const presentation = getDiscoveryReadinessPresentation(makeReadiness({ state: UNKNOWN_STATE }));
+ const presentation = getDiscoveryReadinessPresentation(
+ makeReadiness({ state: UNKNOWN_STATE }),
+ );
expect(presentation).toStrictEqual({
state: UNKNOWN_STATE,
label: 'Discovery unknown',
@@ -205,9 +246,8 @@ describe('resourceDiscoveryReadiness — branch coverage (branchcov2)', () => {
it('falls back to formatReadinessAge(ageSeconds) when observedAt is missing or empty', () => {
expect(
- getDiscoveryReadinessPresentation(
- makeReadiness({ state: 'fresh', ageSeconds: 600 }),
- )?.detail,
+ getDiscoveryReadinessPresentation(makeReadiness({ state: 'fresh', ageSeconds: 600 }))
+ ?.detail,
).toBe('Observed 10 minutes old');
// Empty string is falsy, so the observedAt branch is skipped.
expect(
@@ -255,7 +295,9 @@ describe('resourceDiscoveryReadiness — branch coverage (branchcov2)', () => {
it('emits the service branch alone when only serviceName is set', () => {
expect(
- formatDiscoveryReadinessBriefingLine(makeReadiness({ state: 'failed', serviceName: 'SNMP' })),
+ formatDiscoveryReadinessBriefingLine(
+ makeReadiness({ state: 'failed', serviceName: 'SNMP' }),
+ ),
).toBe('Discovery data: Discovery failed, service SNMP');
});
diff --git a/frontend-modern/src/utils/__tests__/resourceIdentity.branchcov.test.ts b/frontend-modern/src/utils/__tests__/resourceIdentity.branchcov.test.ts
index 8ee36439c4..82dbb08322 100644
--- a/frontend-modern/src/utils/__tests__/resourceIdentity.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceIdentity.branchcov.test.ts
@@ -131,12 +131,8 @@ describe('getPrimaryResourceIdentity (branch coverage)', () => {
describe('getPreferredWorkloadsAgentHint (branch coverage)', () => {
it('returns undefined for resource types outside the docker/truenas/agent families', () => {
- expect(
- getPreferredWorkloadsAgentHint(makeResource({ type: 'vm' })),
- ).toBeUndefined();
- expect(
- getPreferredWorkloadsAgentHint(makeResource({ type: 'k8s-cluster' })),
- ).toBeUndefined();
+ expect(getPreferredWorkloadsAgentHint(makeResource({ type: 'vm' }))).toBeUndefined();
+ expect(getPreferredWorkloadsAgentHint(makeResource({ type: 'k8s-cluster' }))).toBeUndefined();
});
it('falls back to the shared hostname when the docker hostname is absent', () => {
@@ -286,7 +282,7 @@ describe('getPreferredResourceDisplayName (branch coverage)', () => {
describe('getInfrastructureMetadataId (branch coverage)', () => {
const nodeWith = (overrides: Partial<Pick<Node, 'id' | 'name' | 'linkedAgentId'>>) =>
- ({ id: 'node-1', name: 'pve1', ...overrides } as Pick<Node, 'id' | 'name' | 'linkedAgentId'>);
+ ({ id: 'node-1', name: 'pve1', ...overrides }) as Pick<Node, 'id' | 'name' | 'linkedAgentId'>;
it('falls back to the node id when no agent and no linked agent id resolve', () => {
expect(getInfrastructureMetadataId(nodeWith({ linkedAgentId: undefined }))).toBe('node-1');
@@ -305,9 +301,9 @@ describe('getInfrastructureMetadataId (branch coverage)', () => {
status: 'online',
lastSeen: Date.now(),
} as unknown as Agent;
- expect(
- getInfrastructureMetadataId(nodeWith({ linkedAgentId: 'agent-linked' }), agent),
- ).toBe('agent-linked');
+ expect(getInfrastructureMetadataId(nodeWith({ linkedAgentId: 'agent-linked' }), agent)).toBe(
+ 'agent-linked',
+ );
});
});
@@ -319,7 +315,12 @@ describe('getInfrastructureDiscoveryHostname / getAgentLikeDiscoveryHostname (br
status: 'online',
lastSeen: Date.now(),
canonicalIdentity: { hostname: 'canonical.host' },
- discoveryTarget: { resourceType: 'agent', agentId: 'a1', resourceId: 'a1', hostname: 'disc.host' },
+ discoveryTarget: {
+ resourceType: 'agent',
+ agentId: 'a1',
+ resourceId: 'a1',
+ hostname: 'disc.host',
+ },
platformData: { agent: { hostname: 'plat.host' } },
} as unknown as Agent;
expect(getInfrastructureDiscoveryHostname({ name: 'pve1' }, agent)).toBe('canonical.host');
@@ -331,7 +332,12 @@ describe('getInfrastructureDiscoveryHostname / getAgentLikeDiscoveryHostname (br
hostname: 'agent.host',
status: 'online',
lastSeen: Date.now(),
- discoveryTarget: { resourceType: 'agent', agentId: 'a1', resourceId: 'a1', hostname: 'disc.host' },
+ discoveryTarget: {
+ resourceType: 'agent',
+ agentId: 'a1',
+ resourceId: 'a1',
+ hostname: 'disc.host',
+ },
} as unknown as Agent;
expect(getInfrastructureDiscoveryHostname({ name: 'pve1' }, agent)).toBe('disc.host');
});
@@ -362,8 +368,7 @@ describe('getInfrastructureDiscoveryHostname / getAgentLikeDiscoveryHostname (br
});
describe('resolveGuestUrlWithIdentity (branch coverage)', () => {
- const withIP = (ip: string): Resource =>
- makeResource({ identity: { ips: [ip] } });
+ const withIP = (ip: string): Resource => makeResource({ identity: { ips: [ip] } });
it('substitutes the LAN IP into an http URL and preserves port and path', () => {
expect(resolveGuestUrlWithIdentity('http://pi:8006/console', withIP('192.168.0.2'))).toBe(
diff --git a/frontend-modern/src/utils/__tests__/resourceMetadataEvents.branchcov0712c.test.ts b/frontend-modern/src/utils/__tests__/resourceMetadataEvents.branchcov0712c.test.ts
index 3361377ceb..b40b1c2240 100644
--- a/frontend-modern/src/utils/__tests__/resourceMetadataEvents.branchcov0712c.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceMetadataEvents.branchcov0712c.test.ts
@@ -158,11 +158,9 @@ describe('dispatchResourceMetadataChanged', () => {
describe('catch arm (dispatch failures are swallowed, not re-thrown)', () => {
it('swallows a throw from window.dispatchEvent and does not propagate', () => {
- const dispatchSpy = vi
- .spyOn(win, 'dispatchEvent')
- .mockImplementation(() => {
- throw new Error('dispatch boom');
- });
+ const dispatchSpy = vi.spyOn(win, 'dispatchEvent').mockImplementation(() => {
+ throw new Error('dispatch boom');
+ });
const detail: ResourceMetadataChangedDetail = {
metadataKind: 'agent',
metadataId: 'agent-3',
@@ -186,11 +184,14 @@ describe('dispatchResourceMetadataChanged', () => {
// reject. This confirms the whole try expression is guarded, not just
// the dispatchEvent call.
const original = globalThis.CustomEvent;
- vi.stubGlobal('CustomEvent', class {
- constructor() {
- throw new Error('ctor boom');
- }
- });
+ vi.stubGlobal(
+ 'CustomEvent',
+ class {
+ constructor() {
+ throw new Error('ctor boom');
+ }
+ },
+ );
const detail: ResourceMetadataChangedDetail = {
metadataKind: 'guest',
metadataId: 'vm-102',
diff --git a/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.branchcov2.test.ts
index 395aacb2a5..b5247f974d 100644
--- a/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourcePolicyPresentation.branchcov2.test.ts
@@ -32,11 +32,13 @@ import type { ResourcePolicyDisplayResource } from '@/utils/resourcePolicyPresen
* which is the only call site — matching the existing test's approach.
*/
-const governedPolicy = (overrides: {
- sensitivity?: ResourceSensitivity;
- scope?: ResourceRoutingScope;
- redact?: ResourceRedactionHint[];
-} = {}): NonNullable<ResourcePolicyDisplayResource['policy']> => ({
+const governedPolicy = (
+ overrides: {
+ sensitivity?: ResourceSensitivity;
+ scope?: ResourceRoutingScope;
+ redact?: ResourceRedactionHint[];
+ } = {},
+): NonNullable<ResourcePolicyDisplayResource['policy']> => ({
sensitivity: overrides.sensitivity ?? 'restricted',
routing: {
scope: overrides.scope ?? 'local-only',
@@ -47,9 +49,8 @@ const governedPolicy = (overrides: {
// The static type marks `name` and `displayName` as required, but the source
// functions defendively optional-chain (`?.trim()`) on both. This helper lets
// us hand in deliberately-partial resources to exercise those fallback arms.
-const asResource = (
- r: Partial<ResourcePolicyDisplayResource>,
-): ResourcePolicyDisplayResource => r as unknown as ResourcePolicyDisplayResource;
+const asResource = (r: Partial<ResourcePolicyDisplayResource>): ResourcePolicyDisplayResource =>
+ r as unknown as ResourcePolicyDisplayResource;
describe('getResourceSensitivityLabel — branch coverage', () => {
it('returns the canonical label for every known sensitivity', () => {
@@ -90,9 +91,9 @@ describe('getResourceRedactionHintLabel — branch coverage', () => {
});
it('falls back to the raw hint string when the hint is not in the label map (?? hint arm)', () => {
- expect(
- getResourceRedactionHintLabel('custom-redaction' as ResourceRedactionHint),
- ).toBe('custom-redaction');
+ expect(getResourceRedactionHintLabel('custom-redaction' as ResourceRedactionHint)).toBe(
+ 'custom-redaction',
+ );
});
});
@@ -386,9 +387,7 @@ describe('shouldShowResourceAlternateName — branch coverage', () => {
it('treats a whitespace-only displayName as present (guard does not trim) and thus differing from name', () => {
// The guard `!resource?.displayName` does not trim, so ' ' is truthy and
// passes; then ''.toLowerCase() !== 'host-1' -> true.
- expect(
- shouldShowResourceAlternateName({ name: 'host-1', displayName: ' ' }),
- ).toBe(true);
+ expect(shouldShowResourceAlternateName({ name: 'host-1', displayName: ' ' })).toBe(true);
});
it('returns false when the policy requires governed handling', () => {
diff --git a/frontend-modern/src/utils/__tests__/resourceSearchMatch.test.ts b/frontend-modern/src/utils/__tests__/resourceSearchMatch.test.ts
index 7c15102298..d4e231caf8 100644
--- a/frontend-modern/src/utils/__tests__/resourceSearchMatch.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceSearchMatch.test.ts
@@ -181,13 +181,13 @@ describe('resourceMatchesSearch', () => {
});
it('matches object keys from kubernetes.hard', () => {
- const resource = makeResource({ kubernetes: { hard: { 'cpu': '4', 'memory': '8Gi' } } });
+ const resource = makeResource({ kubernetes: { hard: { cpu: '4', memory: '8Gi' } } });
expect(resourceMatchesSearch(resource, 'memory')).toBe(true);
expect(resourceMatchesSearch(resource, 'cpu')).toBe(true);
});
it('matches object keys from kubernetes.used', () => {
- const resource = makeResource({ kubernetes: { used: { 'pods': '10' } } });
+ const resource = makeResource({ kubernetes: { used: { pods: '10' } } });
expect(resourceMatchesSearch(resource, 'pods')).toBe(true);
});
@@ -232,9 +232,9 @@ describe('resourceMatchesSearch', () => {
describe('whitespace handling and filtering', () => {
it('trims the search term before matching', () => {
- expect(
- resourceMatchesSearch(makeResource({ displayName: 'tower' }), ' tower '),
- ).toBe(true);
+ expect(resourceMatchesSearch(makeResource({ displayName: 'tower' }), ' tower ')).toBe(
+ true,
+ );
});
it('trims candidate values before matching', () => {
diff --git a/frontend-modern/src/utils/__tests__/resourceSourceHealth.test.ts b/frontend-modern/src/utils/__tests__/resourceSourceHealth.test.ts
index 747c6b2638..7d2260dec8 100644
--- a/frontend-modern/src/utils/__tests__/resourceSourceHealth.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceSourceHealth.test.ts
@@ -34,9 +34,9 @@ describe('resourceSourceHealth', () => {
});
it('treats explicit connected source statuses as healthy and missing source statuses as unknown', () => {
- expect(getResourceSourceHealth(makeResource({ truenas: { status: 'online' } }), 'truenas')).toBe(
- 'connected',
- );
+ expect(
+ getResourceSourceHealth(makeResource({ truenas: { status: 'online' } }), 'truenas'),
+ ).toBe('connected');
expect(getResourceSourceHealth(makeResource(undefined), 'truenas')).toBe('unknown');
});
diff --git a/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage.test.ts b/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage.test.ts
index f0721565d9..769f84b92f 100644
--- a/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage.test.ts
@@ -224,9 +224,7 @@ describe('mapPBSBackupJob (via pbsInstanceFromResource.backupJobs)', () => {
});
it('defaults every string field (including id) and drops non-record entries', () => {
- const instance = pbsInstanceFromResource(
- createPBSResource({ backupJobs: [{}, null, 'x'] }),
- );
+ const instance = pbsInstanceFromResource(createPBSResource({ backupJobs: [{}, null, 'x'] }));
expect(instance?.backupJobs).toHaveLength(1);
expect(instance?.backupJobs[0]).toEqual({
@@ -538,10 +536,7 @@ describe('mapPMGRelayDomain (via pmgInstanceFromResource.relayDomains)', () => {
it('maps a relay domain with an optional comment', () => {
const instance = pmgInstanceFromResource(
createPMGResource({
- relayDomains: [
- { domain: 'example.com', comment: 'primary' },
- { domain: 'bare.example' },
- ],
+ relayDomains: [{ domain: 'example.com', comment: 'primary' }, { domain: 'bare.example' }],
}),
);
@@ -552,9 +547,7 @@ describe('mapPMGRelayDomain (via pmgInstanceFromResource.relayDomains)', () => {
});
it('defaults empty domain and drops non-record entries', () => {
- const instance = pmgInstanceFromResource(
- createPMGResource({ relayDomains: [{}, null] }),
- );
+ const instance = pmgInstanceFromResource(createPMGResource({ relayDomains: [{}, null] }));
expect(instance?.relayDomains).toHaveLength(1);
expect(instance?.relayDomains?.[0].domain).toBe('');
@@ -651,9 +644,7 @@ describe('mapPMGMailCountPoint (via pmgInstanceFromResource.mailCount)', () => {
});
it('falls back to the epoch timestamp and zeroes every count for an empty record', () => {
- const instance = pmgInstanceFromResource(
- createPMGResource({ mailCount: [{}, null] }),
- );
+ const instance = pmgInstanceFromResource(createPMGResource({ mailCount: [{}, null] }));
expect(instance?.mailCount).toHaveLength(1);
expect(instance?.mailCount?.[0]).toEqual({
diff --git a/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts b/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts
index 28f0b599c2..5d38b1a3d7 100644
--- a/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceStateAdapters.coverage2.test.ts
@@ -412,19 +412,17 @@ describe('deriveLegacySourceList (via canonicalizeRealtimeResource)', () => {
});
it('returns ["availability"] for network-endpoint type', () => {
- const result = canonicalizeRealtimeResource(
- ({
- id: 'ne-1',
- type: 'network-endpoint',
- name: 'endpoint',
- displayName: 'Endpoint',
- platformId: 'ne-1',
- platformType: 'generic',
- sourceType: 'api',
- status: 'online',
- lastSeen: 1_700_000_000_000,
- }) as Resource,
- );
+ const result = canonicalizeRealtimeResource({
+ id: 'ne-1',
+ type: 'network-endpoint',
+ name: 'endpoint',
+ displayName: 'Endpoint',
+ platformId: 'ne-1',
+ platformType: 'generic',
+ sourceType: 'api',
+ status: 'online',
+ lastSeen: 1_700_000_000_000,
+ } as Resource);
expect(pd(result).sources).toEqual(['availability']);
expect(result.platformType).toBe('availability');
});
@@ -792,7 +790,15 @@ describe('buildDisk (via nodeFromResource)', () => {
disk: undefined,
proxmox: {
nodeName: 'n1',
- disk: { total: 4000, used: 1000, free: 3000, usage: 25, mountpoint: '/', type: 'ext4', device: '/dev/sda1' },
+ disk: {
+ total: 4000,
+ used: 1000,
+ free: 3000,
+ usage: 25,
+ mountpoint: '/',
+ type: 'ext4',
+ device: '/dev/sda1',
+ },
} as unknown as Resource['proxmox'],
}),
);
@@ -984,12 +990,7 @@ describe('buildTemperature (via nodeFromResource)', () => {
platformData: {
temperature: {
available: true,
- nvme: [
- { device: 'nvme0', temp: 40 },
- { device: 'nvme1' },
- { temp: 35 },
- null,
- ],
+ nvme: [{ device: 'nvme0', temp: 40 }, { device: 'nvme1' }, { temp: 35 }, null],
},
},
}),
@@ -1006,7 +1007,12 @@ describe('mergePlatformData (via mergeCanonicalResource)', () => {
it('returns existing platformData when incoming has none', () => {
const merged = mergeCanonicalResource(
agent({ id: 'r1', platformData: undefined }),
- agent({ id: 'r1', platformType: 'agent', sourceType: 'agent', platformData: { agent: { hostname: 'h' } } }),
+ agent({
+ id: 'r1',
+ platformType: 'agent',
+ sourceType: 'agent',
+ platformData: { agent: { hostname: 'h' } },
+ }),
);
const agentFacet = pd(merged).agent as Record<string, unknown> | undefined;
expect(agentFacet?.hostname).toBe('h');
@@ -1222,9 +1228,7 @@ describe('mapPMGQuarantine (via pmgInstanceFromResource)', () => {
});
it('returns undefined quarantine when the value is not a record', () => {
- const instance = pmgInstanceFromResource(
- pmgResource({ quarantine: 'not-a-record' }),
- );
+ const instance = pmgInstanceFromResource(pmgResource({ quarantine: 'not-a-record' }));
expect(instance?.quarantine).toBeUndefined();
});
@@ -1295,9 +1299,7 @@ describe('pbsInstanceFromResource metric fallbacks', () => {
});
it('falls back to resource.status for connectionHealth when pbs facet lacks it', () => {
- const instance = pbsInstanceFromResource(
- pbsResource({}, { status: 'degraded' }),
- );
+ const instance = pbsInstanceFromResource(pbsResource({}, { status: 'degraded' }));
expect(instance?.connectionHealth).toBe('degraded');
});
diff --git a/frontend-modern/src/utils/__tests__/routeStateNavigation.branchcov0712.test.ts b/frontend-modern/src/utils/__tests__/routeStateNavigation.branchcov0712.test.ts
index 0984ee6865..480bdcb5c9 100644
--- a/frontend-modern/src/utils/__tests__/routeStateNavigation.branchcov0712.test.ts
+++ b/frontend-modern/src/utils/__tests__/routeStateNavigation.branchcov0712.test.ts
@@ -74,7 +74,10 @@ describe('routeStateNavigation – branch coverage (schedule / clearScrollRestor
scheduler.schedule('/proxmox/overview?type=vm');
vi.runAllTimers();
- expect(navigate).toHaveBeenCalledWith('/proxmox/overview?type=vm', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigate).toHaveBeenCalledWith(
+ '/proxmox/overview?type=vm',
+ ROUTE_STATE_REPLACE_OPTIONS,
+ );
expect(scrollToSpy).not.toHaveBeenCalled();
// scrollRestoration is only flipped to 'manual' inside the restoreScroll
// block, so the null arm leaves it untouched.
diff --git a/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts b/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts
index e1ae3d853c..58c3e4b37c 100644
--- a/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts
+++ b/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts
@@ -137,7 +137,10 @@ describe('routeStateNavigation', () => {
it('skips redundant navigations to the current path', () => {
const navigate = vi.fn();
- const scheduler = createRouteStateNavigateScheduler(navigate, () => '/proxmox/backups?rollupId=abc');
+ const scheduler = createRouteStateNavigateScheduler(
+ navigate,
+ () => '/proxmox/backups?rollupId=abc',
+ );
scheduler.schedule('/proxmox/backups?rollupId=abc');
vi.runAllTimers();
diff --git a/frontend-modern/src/utils/__tests__/searchQuery.branchcov.test.ts b/frontend-modern/src/utils/__tests__/searchQuery.branchcov.test.ts
index 5a0f9fe898..7214c93fb5 100644
--- a/frontend-modern/src/utils/__tests__/searchQuery.branchcov.test.ts
+++ b/frontend-modern/src/utils/__tests__/searchQuery.branchcov.test.ts
@@ -1,9 +1,5 @@
import { describe, expect, it } from 'vitest';
-import {
- evaluateFilterStack,
- parseFilter,
- parseFilterStack,
-} from '@/utils/searchQuery';
+import { evaluateFilterStack, parseFilter, parseFilterStack } from '@/utils/searchQuery';
import type {
ComparisonOperator,
FilterStack,
@@ -110,9 +106,7 @@ describe('evaluateMetricCondition — field switch branches (via evaluateFilterS
it('cpu: missing cpu key uses the : 0 ternary arm', () => {
// 'cpu' not in guest -> value 0; 0 < 1 true
- expect(
- evaluateFilterStack(guestWithout(['cpu']), single(metric('cpu', '<', 1))),
- ).toBe(true);
+ expect(evaluateFilterStack(guestWithout(['cpu']), single(metric('cpu', '<', 1)))).toBe(true);
});
it('memory: falsy/missing memory yields 0', () => {
@@ -124,9 +118,9 @@ describe('evaluateMetricCondition — field switch branches (via evaluateFilterS
),
).toBe(true);
// memory key absent -> 0; 0 <= 0 true
- expect(
- evaluateFilterStack(guestWithout(['memory']), single(metric('memory', '<=', 0))),
- ).toBe(true);
+ expect(evaluateFilterStack(guestWithout(['memory']), single(metric('memory', '<=', 0)))).toBe(
+ true,
+ );
});
it('memory: compares the raw usage value when present', () => {
@@ -150,7 +144,10 @@ describe('evaluateMetricCondition — field switch branches (via evaluateFilterS
it('uptime: running guest uses the uptime value', () => {
expect(
- evaluateFilterStack(makeGuest({ status: 'running', uptime: 7200 }), single(metric('uptime', '>', 3600))),
+ evaluateFilterStack(
+ makeGuest({ status: 'running', uptime: 7200 }),
+ single(metric('uptime', '>', 3600)),
+ ),
).toBe(true);
});
@@ -164,9 +161,9 @@ describe('evaluateMetricCondition — field switch branches (via evaluateFilterS
});
it('uptime: running status but missing uptime key yields 0', () => {
- expect(
- evaluateFilterStack(guestWithout(['uptime']), single(metric('uptime', '>', 1))),
- ).toBe(false);
+ expect(evaluateFilterStack(guestWithout(['uptime']), single(metric('uptime', '>', 1)))).toBe(
+ false,
+ );
});
it('default field: a switch-unlisted metric field present on the guest is read numerically', () => {
@@ -220,12 +217,8 @@ describe('evaluateTextCondition — field switch branches (via evaluateFilterSta
const text = (field: string, value: string): ParsedFilter => ({ type: 'text', field, value });
it('name: missing/empty name returns false', () => {
- expect(
- evaluateFilterStack(guestWithout(['name']), single(text('name', 'test'))),
- ).toBe(false);
- expect(
- evaluateFilterStack(makeGuest({ name: '' }), single(text('name', 'test'))),
- ).toBe(false);
+ expect(evaluateFilterStack(guestWithout(['name']), single(text('name', 'test')))).toBe(false);
+ expect(evaluateFilterStack(makeGuest({ name: '' }), single(text('name', 'test')))).toBe(false);
});
it('name: case-insensitive substring match', () => {
@@ -239,9 +232,9 @@ describe('evaluateTextCondition — field switch branches (via evaluateFilterSta
});
it('node: substring match', () => {
- expect(evaluateFilterStack(makeGuest({ node: 'cluster-a' }), single(text('node', 'cluster')))).toBe(
- true,
- );
+ expect(
+ evaluateFilterStack(makeGuest({ node: 'cluster-a' }), single(text('node', 'cluster'))),
+ ).toBe(true);
});
it('vmid: falsy vmid (0) returns false', () => {
@@ -258,9 +251,7 @@ describe('evaluateTextCondition — field switch branches (via evaluateFilterSta
});
it('returns false when tags is null', () => {
- expect(
- evaluateFilterStack(makeGuest({ tags: null }), single(text('tags', 'x'))),
- ).toBe(false);
+ expect(evaluateFilterStack(makeGuest({ tags: null }), single(text('tags', 'x')))).toBe(false);
});
it('returns false for an empty tags array', () => {
@@ -278,7 +269,10 @@ describe('evaluateTextCondition — field switch branches (via evaluateFilterSta
it('returns false when tags is a non-array, non-string value', () => {
expect(
- evaluateFilterStack(makeGuest({ tags: 42 as unknown as string[] }), single(text('tags', 'x'))),
+ evaluateFilterStack(
+ makeGuest({ tags: 42 as unknown as string[] }),
+ single(text('tags', 'x')),
+ ),
).toBe(false);
});
@@ -293,20 +287,14 @@ describe('evaluateTextCondition — field switch branches (via evaluateFilterSta
it('splits a comma-separated tags string and matches', () => {
expect(
- evaluateFilterStack(
- makeGuest({ tags: 'production,web,api' }),
- single(text('tags', 'api')),
- ),
+ evaluateFilterStack(makeGuest({ tags: 'production,web,api' }), single(text('tags', 'api'))),
).toBe(true);
});
it('ignores empty segments in a comma-separated tag search', () => {
// ',,' splits to [] after filtering -> no search tags -> some([]) is false
expect(
- evaluateFilterStack(
- makeGuest({ tags: ['production'] }),
- single(text('tags', ',,')),
- ),
+ evaluateFilterStack(makeGuest({ tags: ['production'] }), single(text('tags', ',,'))),
).toBe(false);
});
});
@@ -342,9 +330,7 @@ describe('evaluateTextCondition — field switch branches (via evaluateFilterSta
});
it('returns false when the default field is absent from the guest', () => {
- expect(
- evaluateFilterStack(guestWithout(['lock']), single(text('lock', 'x'))),
- ).toBe(false);
+ expect(evaluateFilterStack(guestWithout(['lock']), single(text('lock', 'x')))).toBe(false);
});
it('returns false for a non-string/number/boolean field value', () => {
@@ -385,9 +371,9 @@ describe('evaluateFilterStack — top-level branches', () => {
describe('raw text matching across fields', () => {
it('matches raw text against node', () => {
- expect(evaluateFilterStack(makeGuest({ node: 'cluster-a' }), single(parseFilter('cluster')))).toBe(
- true,
- );
+ expect(
+ evaluateFilterStack(makeGuest({ node: 'cluster-a' }), single(parseFilter('cluster'))),
+ ).toBe(true);
});
it('matches raw text against vmid', () => {
@@ -457,7 +443,16 @@ describe('evaluateFilterStack — top-level branches', () => {
],
operators: ['AND'],
};
- expect(evaluateFilterStack(makeGuest({ name: 'test-vm', cpu: 0.5, disk: { usage: 50, total: 100, used: 50, free: 50 } }), stack)).toBe(false);
+ expect(
+ evaluateFilterStack(
+ makeGuest({
+ name: 'test-vm',
+ cpu: 0.5,
+ disk: { usage: 50, total: 100, used: 50, free: 50 },
+ }),
+ stack,
+ ),
+ ).toBe(false);
});
});
});
diff --git a/frontend-modern/src/utils/__tests__/searchQuery.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/searchQuery.branchcov0712b.test.ts
index dc73900ea8..7a3b91a7fd 100644
--- a/frontend-modern/src/utils/__tests__/searchQuery.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/searchQuery.branchcov0712b.test.ts
@@ -1,6 +1,11 @@
import { describe, expect, it } from 'vitest';
import { evaluateFilterStack, parseFilter, parseFilterStack } from '@/utils/searchQuery';
-import type { ComparisonOperator, FilterStack, MetricCondition, ParsedFilter } from '@/utils/searchQuery';
+import type {
+ ComparisonOperator,
+ FilterStack,
+ MetricCondition,
+ ParsedFilter,
+} from '@/utils/searchQuery';
import type { VM } from '@/types/api';
/**
@@ -209,9 +214,13 @@ describe('evaluateMetricCondition — field-switch arms (via evaluateFilterStack
describe('cpu field', () => {
it('multiplies the decimal by 100; `>` true above and false at the threshold', () => {
// 0.9 -> 90 ; 90 > 50 true
- expect(evaluateFilterStack(makeGuest({ cpu: 0.9 }), single(metric('cpu', '>', 50)))).toBe(true);
+ expect(evaluateFilterStack(makeGuest({ cpu: 0.9 }), single(metric('cpu', '>', 50)))).toBe(
+ true,
+ );
// 0.4 -> 40 ; 40 > 50 false
- expect(evaluateFilterStack(makeGuest({ cpu: 0.4 }), single(metric('cpu', '>', 50)))).toBe(false);
+ expect(evaluateFilterStack(makeGuest({ cpu: 0.4 }), single(metric('cpu', '>', 50)))).toBe(
+ false,
+ );
});
});
@@ -284,9 +293,9 @@ describe('evaluateMetricCondition — field-switch arms (via evaluateFilterStack
});
it('returns 0 when running but the uptime key is absent', () => {
- expect(
- evaluateFilterStack(guestWithout(['uptime']), single(metric('uptime', '>', 1))),
- ).toBe(false);
+ expect(evaluateFilterStack(guestWithout(['uptime']), single(metric('uptime', '>', 1)))).toBe(
+ false,
+ );
});
});
@@ -312,7 +321,10 @@ describe('evaluateMetricCondition — field-switch arms (via evaluateFilterStack
it('returns false when the field exists but its value is undefined', () => {
expect(
- evaluateFilterStack(makeGuest({ networkIn: undefined }), single(metric('networkIn', '>', 0))),
+ evaluateFilterStack(
+ makeGuest({ networkIn: undefined }),
+ single(metric('networkIn', '>', 0)),
+ ),
).toBe(false);
});
@@ -345,28 +357,28 @@ describe('evaluateMetricCondition — field-switch arms (via evaluateFilterStack
describe('`=` / `==` epsilon arm (Math.abs(v - cond.value) < 0.01)', () => {
it('matches within the 0.01 window for "="', () => {
// 50.0 vs 50.005 -> diff 0.005 -> true
- expect(
- evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '=', 50.005))),
- ).toBe(true);
+ expect(evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '=', 50.005)))).toBe(
+ true,
+ );
});
it('does not match outside the 0.01 window for "="', () => {
// 50.0 vs 50.02 -> diff 0.02 -> false
- expect(
- evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '=', 50.02))),
- ).toBe(false);
+ expect(evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '=', 50.02)))).toBe(
+ false,
+ );
});
it('matches exactly with "==" at the same value', () => {
- expect(
- evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '==', 50))),
- ).toBe(true);
+ expect(evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '==', 50)))).toBe(
+ true,
+ );
});
it('does not match with "==" far from the value', () => {
- expect(
- evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '==', 51))),
- ).toBe(false);
+ expect(evaluateFilterStack(makeGuest({ cpu: 0.5 }), single(metric('cpu', '==', 51)))).toBe(
+ false,
+ );
});
});
@@ -386,12 +398,12 @@ describe('evaluateMetricCondition — field-switch arms (via evaluateFilterStack
describe('evaluateTextCondition — field-switch arms (via evaluateFilterStack)', () => {
describe('name field', () => {
it('matches case-insensitively and rejects a non-substring', () => {
- expect(evaluateFilterStack(makeGuest({ name: 'Prod-Web' }), single(text('name', 'prod')))).toBe(
- true,
- );
- expect(evaluateFilterStack(makeGuest({ name: 'Prod-Web' }), single(text('name', 'zzz')))).toBe(
- false,
- );
+ expect(
+ evaluateFilterStack(makeGuest({ name: 'Prod-Web' }), single(text('name', 'prod'))),
+ ).toBe(true);
+ expect(
+ evaluateFilterStack(makeGuest({ name: 'Prod-Web' }), single(text('name', 'zzz'))),
+ ).toBe(false);
});
it('returns false when name is the empty string (falsy)', () => {
@@ -441,28 +453,19 @@ describe('evaluateTextCondition — field-switch arms (via evaluateFilterStack)'
it('matches case-insensitively across array tags and search value', () => {
expect(
- evaluateFilterStack(
- makeGuest({ tags: ['Production'] }),
- single(text('tags', 'PROD')),
- ),
+ evaluateFilterStack(makeGuest({ tags: ['Production'] }), single(text('tags', 'PROD'))),
).toBe(true);
});
it('splits a comma-separated tags STRING and matches a segment', () => {
expect(
- evaluateFilterStack(
- makeGuest({ tags: 'production,web,api' }),
- single(text('tags', 'api')),
- ),
+ evaluateFilterStack(makeGuest({ tags: 'production,web,api' }), single(text('tags', 'api'))),
).toBe(true);
});
it('returns false when the tags string contains only empty segments', () => {
expect(
- evaluateFilterStack(
- makeGuest({ tags: ',,' }),
- single(text('tags', 'production')),
- ),
+ evaluateFilterStack(makeGuest({ tags: ',,' }), single(text('tags', 'production'))),
).toBe(false);
});
@@ -491,7 +494,9 @@ describe('evaluateTextCondition — field-switch arms (via evaluateFilterStack)'
describe('default field arm (non-name/node/vmid/tags)', () => {
it('matches a string field via case-insensitive substring', () => {
- expect(evaluateFilterStack(makeGuest({ type: 'qemu' }), single(text('type', 'QE')))).toBe(true);
+ expect(evaluateFilterStack(makeGuest({ type: 'qemu' }), single(text('type', 'QE')))).toBe(
+ true,
+ );
});
it('matches a numeric field via toString substring', () => {
diff --git a/frontend-modern/src/utils/__tests__/securityAuthPresentation.branchcov0713.test.ts b/frontend-modern/src/utils/__tests__/securityAuthPresentation.branchcov0713.test.ts
index f42cdc1e9f..42c22960ae 100644
--- a/frontend-modern/src/utils/__tests__/securityAuthPresentation.branchcov0713.test.ts
+++ b/frontend-modern/src/utils/__tests__/securityAuthPresentation.branchcov0713.test.ts
@@ -46,9 +46,7 @@ describe('getSecurityAuthRestartInstruction — branch coverage (batch 0713)', (
expect(getSecurityAuthRestartInstruction('systemd').command).toBe(
'sudo systemctl restart pulse',
);
- expect(getSecurityAuthRestartInstruction('manual').command).not.toBe(
- 'npm run dev:restart',
- );
+ expect(getSecurityAuthRestartInstruction('manual').command).not.toBe('npm run dev:restart');
});
});
@@ -91,9 +89,7 @@ describe('getSecurityAuthRestartInstruction — branch coverage (batch 0713)', (
});
it('falls through to default for null (deliberately malformed input)', () => {
- const result = getSecurityAuthRestartInstruction(
- null as unknown as DeploymentTypeParam,
- );
+ const result = getSecurityAuthRestartInstruction(null as unknown as DeploymentTypeParam);
expect(result).toEqual({
label: 'Restart Pulse using your deployment method',
});
@@ -102,9 +98,7 @@ describe('getSecurityAuthRestartInstruction — branch coverage (batch 0713)', (
});
it('falls through to default for a non-string runtime value (deliberately malformed)', () => {
- const result = getSecurityAuthRestartInstruction(
- 42 as unknown as DeploymentTypeParam,
- );
+ const result = getSecurityAuthRestartInstruction(42 as unknown as DeploymentTypeParam);
expect(result).toEqual({
label: 'Restart Pulse using your deployment method',
});
diff --git a/frontend-modern/src/utils/__tests__/securityScorePresentation.test.ts b/frontend-modern/src/utils/__tests__/securityScorePresentation.test.ts
index f43f0c7f03..042bb701d0 100644
--- a/frontend-modern/src/utils/__tests__/securityScorePresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/securityScorePresentation.test.ts
@@ -108,7 +108,9 @@ describe('securityScorePresentation', () => {
exportProtected: true,
hasHTTPS: false,
}).message,
- ).toBe('Authentication is enabled, but this Pulse instance is still missing HTTPS and an API token.');
+ ).toBe(
+ 'Authentication is enabled, but this Pulse instance is still missing HTTPS and an API token.',
+ );
});
it('keeps global warnings off for private authenticated setup debt', () => {
@@ -213,8 +215,7 @@ describe('securityScorePresentation', () => {
critical: true,
}),
).toMatchObject({
- cardClassName:
- 'border-emerald-200 dark:border-emerald-800 bg-emerald-50 dark:bg-emerald-950',
+ cardClassName: 'border-emerald-200 dark:border-emerald-800 bg-emerald-50 dark:bg-emerald-950',
iconClassName: 'text-emerald-500 dark:text-emerald-400',
statusLabel: 'Enabled',
});
diff --git a/frontend-modern/src/utils/__tests__/sourcePlatformOptions.branchcov0713.test.ts b/frontend-modern/src/utils/__tests__/sourcePlatformOptions.branchcov0713.test.ts
index 39a67e9f2f..97bb3482f3 100644
--- a/frontend-modern/src/utils/__tests__/sourcePlatformOptions.branchcov0713.test.ts
+++ b/frontend-modern/src/utils/__tests__/sourcePlatformOptions.branchcov0713.test.ts
@@ -26,10 +26,7 @@ describe('orderSourcePlatformKeys — branch coverage (batch 0713)', () => {
});
it('strips entries that normalize to "" while keeping valid ones (.filter(Boolean) truthy + falsy arms)', () => {
- expect(orderSourcePlatformKeys(['agent', '', ' ', 'docker'])).toEqual([
- 'agent',
- 'docker',
- ]);
+ expect(orderSourcePlatformKeys(['agent', '', ' ', 'docker'])).toEqual(['agent', 'docker']);
});
it('tolerates null/undefined entries that violate the declared Iterable<string>', () => {
@@ -102,9 +99,12 @@ describe('orderSourcePlatformKeys — branch coverage (batch 0713)', () => {
// agent (index 0) vs docker (index 6) -> return indexA - indexB arm.
// agent/docker vs aaa-custom/zzz-custom -> indexA === -1 and indexB === -1 arms.
// aaa-custom vs zzz-custom -> localeCompare fallback.
- expect(
- orderSourcePlatformKeys(['zzz-custom', 'agent', 'docker', 'aaa-custom']),
- ).toEqual(['agent', 'docker', 'aaa-custom', 'zzz-custom']);
+ expect(orderSourcePlatformKeys(['zzz-custom', 'agent', 'docker', 'aaa-custom'])).toEqual([
+ 'agent',
+ 'docker',
+ 'aaa-custom',
+ 'zzz-custom',
+ ]);
});
});
@@ -131,9 +131,11 @@ describe('orderSourcePlatformKeys — branch coverage (batch 0713)', () => {
it('ranks preferred keys ahead of non-preferred keys, then orders unknowns by label', () => {
// 'agent' is the only entry in the supplied preferredOrder, so it sorts first;
// 'aaa-custom' and 'bbb-custom' fall through to label-based ordering.
- expect(
- orderSourcePlatformKeys(['bbb-custom', 'agent', 'aaa-custom'], ['agent']),
- ).toEqual(['agent', 'aaa-custom', 'bbb-custom']);
+ expect(orderSourcePlatformKeys(['bbb-custom', 'agent', 'aaa-custom'], ['agent'])).toEqual([
+ 'agent',
+ 'aaa-custom',
+ 'bbb-custom',
+ ]);
});
});
});
diff --git a/frontend-modern/src/utils/__tests__/ssoProviderPresentation.branchcov0717.test.ts b/frontend-modern/src/utils/__tests__/ssoProviderPresentation.branchcov0717.test.ts
index 8d2ac0b843..7064ab0e3b 100644
--- a/frontend-modern/src/utils/__tests__/ssoProviderPresentation.branchcov0717.test.ts
+++ b/frontend-modern/src/utils/__tests__/ssoProviderPresentation.branchcov0717.test.ts
@@ -107,9 +107,7 @@ describe('ssoProviderPresentation branch coverage (supplemental)', () => {
describe('getSSOProvidersLoadErrorMessage / DetailsLoadErrorMessage', () => {
it('returns the canonical load-error strings', () => {
expect(getSSOProvidersLoadErrorMessage()).toBe('Unable to load SSO providers.');
- expect(getSSOProviderDetailsLoadErrorMessage()).toBe(
- 'Unable to load SSO provider details.',
- );
+ expect(getSSOProviderDetailsLoadErrorMessage()).toBe('Unable to load SSO provider details.');
});
});
@@ -127,15 +125,11 @@ describe('ssoProviderPresentation branch coverage (supplemental)', () => {
it('coerces an undefined error to the literal string "undefined" via String()', () => {
// `String(undefined)` => 'undefined' — documents the runtime behaviour of
// the optional `error` parameter when callers omit it.
- expect(getSSOProviderSaveErrorMessage()).toBe(
- 'Unable to save the SSO provider: undefined',
- );
+ expect(getSSOProviderSaveErrorMessage()).toBe('Unable to save the SSO provider: undefined');
});
it('coerces null to "null"', () => {
- expect(getSSOProviderSaveErrorMessage(null)).toBe(
- 'Unable to save the SSO provider: null',
- );
+ expect(getSSOProviderSaveErrorMessage(null)).toBe('Unable to save the SSO provider: null');
});
it('coerces a plain object to "[object Object]"', () => {
@@ -187,9 +181,7 @@ describe('ssoProviderPresentation branch coverage (supplemental)', () => {
describe('getSSOConnectionTestSuccessMessage / FailureMessage / ErrorMessage', () => {
it('returns the canonical connection-test strings', () => {
- expect(getSSOConnectionTestSuccessMessage()).toBe(
- 'Connection test completed successfully.',
- );
+ expect(getSSOConnectionTestSuccessMessage()).toBe('Connection test completed successfully.');
expect(getSSOConnectionTestFailureMessage('Bad certificate')).toBe(
'Connection test failed: Bad certificate',
);
@@ -304,9 +296,7 @@ describe('ssoProviderPresentation branch coverage (supplemental)', () => {
describe('getSSOProviderCardClass', () => {
it('returns the full enabled-card class string', () => {
- expect(getSSOProviderCardClass(true)).toBe(
- 'p-4 rounded-md border bg-surface border-border',
- );
+ expect(getSSOProviderCardClass(true)).toBe('p-4 rounded-md border bg-surface border-border');
});
it('returns the full disabled-card class string', () => {
diff --git a/frontend-modern/src/utils/__tests__/status.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/status.branchcov2.test.ts
index 31d534f17d..3886e569c9 100644
--- a/frontend-modern/src/utils/__tests__/status.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/status.branchcov2.test.ts
@@ -87,18 +87,14 @@ describe('getStatusIndicatorBadgeToneClasses (branch coverage)', () => {
expect(getStatusIndicatorBadgeToneClasses('info')).toBe(
'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300',
);
- expect(getStatusIndicatorBadgeToneClasses('muted')).toBe(
- 'bg-surface-alt text-base-content',
- );
+ expect(getStatusIndicatorBadgeToneClasses('muted')).toBe('bg-surface-alt text-base-content');
});
it('falls back to the muted tone class for a variant not present in the table', () => {
// `|| STATUS_INDICATOR_BADGE_TONE_CLASSES.muted` defensive arm — driven by a
// deliberately-malformed variant cast to satisfy the nominal type.
const invalid = 'chartreuse' as unknown as StatusIndicatorVariant;
- expect(getStatusIndicatorBadgeToneClasses(invalid)).toBe(
- 'bg-surface-alt text-base-content',
- );
+ expect(getStatusIndicatorBadgeToneClasses(invalid)).toBe('bg-surface-alt text-base-content');
});
});
@@ -120,9 +116,7 @@ describe('isNodeOnline (branch coverage)', () => {
expect(isNodeOnline({ status: 'online', uptime: 1000, connectionHealth: 'OFFLINE' })).toBe(
false,
);
- expect(isNodeOnline({ status: 'online', uptime: 1000, connectionHealth: 'Error' })).toBe(
- false,
- );
+ expect(isNodeOnline({ status: 'online', uptime: 1000, connectionHealth: 'Error' })).toBe(false);
});
it('rejects a whitespace-only connectionHealth neither matches offline nor error, but is still treated as connected', () => {
@@ -335,16 +329,18 @@ describe('getPBSStatusIndicator (branch coverage)', () => {
// DEGRADED arm driven by connection alone (status 'paused' is not healthy/
// online and not in the degraded set, so without connection it would fall
// through to defaultIndicator). Label prefers connection.
- expect(
- getPBSStatusIndicator({ status: 'paused', connectionHealth: 'maintenance' }),
- ).toEqual({ variant: 'warning', label: 'Maintenance' });
+ expect(getPBSStatusIndicator({ status: 'paused', connectionHealth: 'maintenance' })).toEqual({
+ variant: 'warning',
+ label: 'Maintenance',
+ });
});
it('prefers connection over status when both are degraded for the warning label', () => {
// `formatStatusLabel(connection || status, 'Degraded')` — connection wins.
- expect(
- getPBSStatusIndicator({ status: 'degraded', connectionHealth: 'recovering' }),
- ).toEqual({ variant: 'warning', label: 'Recovering' });
+ expect(getPBSStatusIndicator({ status: 'degraded', connectionHealth: 'recovering' })).toEqual({
+ variant: 'warning',
+ label: 'Recovering',
+ });
});
it('returns the muted default indicator for a status that is neither offline, healthy/online, nor degraded', () => {
diff --git a/frontend-modern/src/utils/__tests__/storageSources.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/storageSources.branchcov0712b.test.ts
index b756d431a4..eb2e6fe5af 100644
--- a/frontend-modern/src/utils/__tests__/storageSources.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/storageSources.branchcov0712b.test.ts
@@ -52,14 +52,17 @@ describe('storageSources.branchcov2', () => {
])(
'normalizes the raw platform alias %s into the wins-list key %s before resolving (type=%s ignored)',
(rawPlatform, expected, type) => {
- expect(resolveStorageSourceKey(makeStorage({ platform: rawPlatform, type }))).toBe(expected);
+ expect(resolveStorageSourceKey(makeStorage({ platform: rawPlatform, type }))).toBe(
+ expected,
+ );
},
);
it('prefers a winning platform tag over a type that would itself classify as kubernetes', () => {
// platform=kubernetes wins before the type-based kubernetes classifier runs.
- expect(resolveStorageSourceKey(makeStorage({ platform: 'kubernetes', type: 'csi-driver' })))
- .toBe('kubernetes');
+ expect(
+ resolveStorageSourceKey(makeStorage({ platform: 'kubernetes', type: 'csi-driver' })),
+ ).toBe('kubernetes');
});
});
@@ -69,14 +72,11 @@ describe('storageSources.branchcov2', () => {
['agent', 'dir'],
['docker', 'dir'],
['ceph', 'dir'],
- ])(
- 'ignores non-winning platform tag %s and resolves by on-disk type %s',
- (platform, type) => {
- // 'dir' -> proxmox-pve; 'ceph' -> ceph
- const expected = type === 'ceph' ? 'ceph' : 'proxmox-pve';
- expect(resolveStorageSourceKey(makeStorage({ platform, type }))).toBe(expected);
- },
- );
+ ])('ignores non-winning platform tag %s and resolves by on-disk type %s', (platform, type) => {
+ // 'dir' -> proxmox-pve; 'ceph' -> ceph
+ const expected = type === 'ceph' ? 'ceph' : 'proxmox-pve';
+ expect(resolveStorageSourceKey(makeStorage({ platform, type }))).toBe(expected);
+ });
it('coerces an undefined platform to empty string and still resolves by type', () => {
const storage = { ...makeStorage({}), platform: undefined } as Storage;
@@ -87,14 +87,12 @@ describe('storageSources.branchcov2', () => {
});
describe('resolveStorageSourceKey — type-based canonical recognition', () => {
- it.each([
- ['proxmox-pbs'],
- ['ceph'],
- ['kubernetes'],
- ['proxmox-pmg'],
- ])('returns the recognized canonical type %s directly when platform is empty', (type) => {
- expect(resolveStorageSourceKey(makeStorage({ platform: '', type }))).toBe(type);
- });
+ it.each([['proxmox-pbs'], ['ceph'], ['kubernetes'], ['proxmox-pmg']])(
+ 'returns the recognized canonical type %s directly when platform is empty',
+ (type) => {
+ expect(resolveStorageSourceKey(makeStorage({ platform: '', type }))).toBe(type);
+ },
+ );
it.each([['cephfs'], ['rbd']])(
'collapses the ceph family member %s to ceph via CEPH_TYPES',
diff --git a/frontend-modern/src/utils/__tests__/storageSources.test.ts b/frontend-modern/src/utils/__tests__/storageSources.test.ts
index c29517a0a0..352e3adbba 100644
--- a/frontend-modern/src/utils/__tests__/storageSources.test.ts
+++ b/frontend-modern/src/utils/__tests__/storageSources.test.ts
@@ -61,16 +61,12 @@ describe('storageSources', () => {
expect(normalizeStorageSourceKey('All')).toBe('all');
});
- it.each([
- [''],
- [' '],
- [undefined],
- [null],
- ['!!!'],
- ['@@@@'],
- ])('returns an empty string for empty or punctuation-only input %s', (input) => {
- expect(normalizeStorageSourceKey(input as string | null | undefined)).toBe('');
- });
+ it.each([[''], [' '], [undefined], [null], ['!!!'], ['@@@@']])(
+ 'returns an empty string for empty or punctuation-only input %s',
+ (input) => {
+ expect(normalizeStorageSourceKey(input as string | null | undefined)).toBe('');
+ },
+ );
it('slugifies mixed-case and whitespace into a canonical slug', () => {
expect(normalizeStorageSourceKey('TrueNAS')).toBe('truenas');
@@ -121,12 +117,9 @@ describe('storageSources', () => {
expect(resolveStorageSourceKey(makeStorage({ platform: '', type }))).toBe('proxmox-pve');
});
- it.each([[''], ['storage']])(
- 'falls back to proxmox-pve for empty/generic type %s',
- (type) => {
- expect(resolveStorageSourceKey(makeStorage({ platform: '', type }))).toBe('proxmox-pve');
- },
- );
+ it.each([[''], ['storage']])('falls back to proxmox-pve for empty/generic type %s', (type) => {
+ expect(resolveStorageSourceKey(makeStorage({ platform: '', type }))).toBe('proxmox-pve');
+ });
it.each([['ceph'], ['cephfs'], ['rbd']])('resolves ceph type %s to ceph', (type) => {
expect(resolveStorageSourceKey(makeStorage({ platform: '', type }))).toBe('ceph');
diff --git a/frontend-modern/src/utils/__tests__/storageSummaryCache.test.ts b/frontend-modern/src/utils/__tests__/storageSummaryCache.test.ts
index d2d5204e43..a1beffa986 100644
--- a/frontend-modern/src/utils/__tests__/storageSummaryCache.test.ts
+++ b/frontend-modern/src/utils/__tests__/storageSummaryCache.test.ts
@@ -2,10 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
import type { StorageSummaryChartsResponse, TimeRange } from '@/api/charts';
import { eventBus } from '@/stores/events';
import { getOrgID, setOrgID } from '@/utils/apiClient';
-import {
- fetchStorageSummaryAndCache,
- readStorageSummaryCache,
-} from '@/utils/storageSummaryCache';
+import { fetchStorageSummaryAndCache, readStorageSummaryCache } from '@/utils/storageSummaryCache';
const mockGetStorageSummaryCharts = vi.fn();
@@ -124,8 +121,9 @@ describe('storageSummaryCache', () => {
});
it('fetches separately per node scope', async () => {
- mockGetStorageSummaryCharts.mockImplementation((_range: TimeRange, _signal: unknown, options?: { nodeId?: string }) =>
- Promise.resolve(makeResponse(options?.nodeId ? 10 : 20)),
+ mockGetStorageSummaryCharts.mockImplementation(
+ (_range: TimeRange, _signal: unknown, options?: { nodeId?: string }) =>
+ Promise.resolve(makeResponse(options?.nodeId ? 10 : 20)),
);
await fetchStorageSummaryAndCache('1h', { nodeId: 'node-1' });
diff --git a/frontend-modern/src/utils/__tests__/swarmPresentation.branchcov0718.test.ts b/frontend-modern/src/utils/__tests__/swarmPresentation.branchcov0718.test.ts
index 9f49615908..ab0d3c8488 100644
--- a/frontend-modern/src/utils/__tests__/swarmPresentation.branchcov0718.test.ts
+++ b/frontend-modern/src/utils/__tests__/swarmPresentation.branchcov0718.test.ts
@@ -126,13 +126,9 @@ describe('swarmPresentation.branchcov0718', () => {
});
it('wires the control availability status labels', () => {
- expect(presentation.controlAvailableLabel).toBe(
- SWARM_DRAWER_CONTROL_AVAILABLE_LABEL,
- );
+ expect(presentation.controlAvailableLabel).toBe(SWARM_DRAWER_CONTROL_AVAILABLE_LABEL);
expect(presentation.controlAvailableLabel).toBe('available');
- expect(presentation.controlUnavailableLabel).toBe(
- SWARM_DRAWER_CONTROL_UNAVAILABLE_LABEL,
- );
+ expect(presentation.controlUnavailableLabel).toBe(SWARM_DRAWER_CONTROL_UNAVAILABLE_LABEL);
expect(presentation.controlUnavailableLabel).toBe('unavailable');
});
diff --git a/frontend-modern/src/utils/__tests__/systemLogsPresentation.branchcov0713.test.ts b/frontend-modern/src/utils/__tests__/systemLogsPresentation.branchcov0713.test.ts
index 5d408a8e93..bfa2385e65 100644
--- a/frontend-modern/src/utils/__tests__/systemLogsPresentation.branchcov0713.test.ts
+++ b/frontend-modern/src/utils/__tests__/systemLogsPresentation.branchcov0713.test.ts
@@ -77,9 +77,7 @@ describe('getSystemLogLineClass — branch coverage (batch 2)', () => {
});
it('resolves to red when all three severities appear in one line', () => {
- expect(
- getSystemLogLineClass('[DEBUG] [WARN] [ERROR] boom ERR WRN DBG'),
- ).toBe('text-red-400');
+ expect(getSystemLogLineClass('[DEBUG] [WARN] [ERROR] boom ERR WRN DBG')).toBe('text-red-400');
});
});
@@ -176,7 +174,9 @@ describe('getSystemLogStreamPresentation — ternary truthiness coercion (batch
const truthy = 'truthy' as unknown as Parameters<typeof getSystemLogStreamPresentation>[0];
const falsy = NaN as unknown as Parameters<typeof getSystemLogStreamPresentation>[0];
expect(getSystemLogStreamPresentation(truthy).indicatorClass).toBe('bg-amber-400');
- expect(getSystemLogStreamPresentation(falsy).indicatorClass).toBe('bg-emerald-400 animate-pulse');
+ expect(getSystemLogStreamPresentation(falsy).indicatorClass).toBe(
+ 'bg-emerald-400 animate-pulse',
+ );
});
});
diff --git a/frontend-modern/src/utils/__tests__/systemSettingsPresentation.branchcov0712b.test.ts b/frontend-modern/src/utils/__tests__/systemSettingsPresentation.branchcov0712b.test.ts
index 15709d4286..030c01f0f5 100644
--- a/frontend-modern/src/utils/__tests__/systemSettingsPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/utils/__tests__/systemSettingsPresentation.branchcov0712b.test.ts
@@ -66,9 +66,9 @@ describe('systemSettingsPresentation — branch coverage (branchcov2)', () => {
// A valid hourly interval is ignored once the disabled flag is set, and
// the disabled branch wins over a non-boolean falsy value (JS coercion).
expect(getBackupIntervalSummary(false, 3600)).toBe('Backup polling is disabled.');
- expect(
- getBackupIntervalSummary(0 as unknown as boolean, 86400),
- ).toBe('Backup polling is disabled.');
+ expect(getBackupIntervalSummary(0 as unknown as boolean, 86400)).toBe(
+ 'Backup polling is disabled.',
+ );
});
it('treats negative intervals as the default cadence (< 0 portion of `backupPollingInterval <= 0`)', () => {
@@ -98,21 +98,17 @@ describe('systemSettingsPresentation — branch coverage (branchcov2)', () => {
it('falls through the day and hour guards to the plural minutes fallback (false arms of `% 86400` and `% 3600`)', () => {
// 5400s = 90 min: not divisible by an hour or a day -> minutes fallback, plural.
- expect(getBackupIntervalSummary(true, 5400)).toBe(
- 'Pulse checks backups every 90 minutes.',
- );
+ expect(getBackupIntervalSummary(true, 5400)).toBe('Pulse checks backups every 90 minutes.');
// 300s = 5 min: same fall-through, plural count of 5.
- expect(getBackupIntervalSummary(true, 300)).toBe(
- 'Pulse checks backups every 5 minutes.',
- );
+ expect(getBackupIntervalSummary(true, 300)).toBe('Pulse checks backups every 5 minutes.');
});
it('honors a truthy non-boolean flag as enabled (coercion through `!backupPollingEnabled`)', () => {
// A non-empty string is truthy, so the disabled guard is skipped and the
// interval is formatted normally. Cast satisfies the declared boolean type.
- expect(
- getBackupIntervalSummary('true' as unknown as boolean, 3600),
- ).toBe('Pulse checks backups every hour.');
+ expect(getBackupIntervalSummary('true' as unknown as boolean, 3600)).toBe(
+ 'Pulse checks backups every hour.',
+ );
});
});
});
diff --git a/frontend-modern/src/utils/__tests__/textPresentation.test.ts b/frontend-modern/src/utils/__tests__/textPresentation.test.ts
index df255f237e..55148344de 100644
--- a/frontend-modern/src/utils/__tests__/textPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/textPresentation.test.ts
@@ -24,10 +24,12 @@ describe('textPresentation', () => {
'get container status',
);
expect(formatIdentifierLabel('some_reason')).toBe('some reason');
- expect(formatIdentifierLabel('pulse_very_long_unknown_tool_name', {
- stripPrefix: 'pulse_',
- maxLength: 12,
- })).toBe('very long un');
+ expect(
+ formatIdentifierLabel('pulse_very_long_unknown_tool_name', {
+ stripPrefix: 'pulse_',
+ maxLength: 12,
+ }),
+ ).toBe('very long un');
expect(formatIdentifierLabel(undefined, { fallback: 'Unknown' })).toBe('Unknown');
});
diff --git a/frontend-modern/src/utils/__tests__/theme.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/theme.branchcov2.test.ts
index 0bd30ffa96..7ef9b218eb 100644
--- a/frontend-modern/src/utils/__tests__/theme.branchcov2.test.ts
+++ b/frontend-modern/src/utils/__tests__/theme.branchcov2.test.ts
@@ -37,7 +37,7 @@ const THEME_KEY = STORAGE_KEYS.THEME_PREFERENCE;
const DARK_MEDIA_QUERY = '(prefers-color-scheme: dark)';
describe('normalizeThemePreference (branch coverage)', () => {
- it("returns each canonical preference unchanged via the isThemePreference truthy arm", () => {
+ it('returns each canonical preference unchanged via the isThemePreference truthy arm', () => {
// 'dark' and 'system' arms are not exercised by the sibling test.
expect(normalizeThemePreference('dark')).toBe('dark');
expect(normalizeThemePreference('system')).toBe('system');
diff --git a/frontend-modern/src/utils/__tests__/toast.test.ts b/frontend-modern/src/utils/__tests__/toast.test.ts
index 341454824b..f4c274560a 100644
--- a/frontend-modern/src/utils/__tests__/toast.test.ts
+++ b/frontend-modern/src/utils/__tests__/toast.test.ts
@@ -10,13 +10,7 @@ vi.mock('@/utils/logger', () => ({
}));
import { logger } from '@/utils/logger';
-import {
- showToast,
- showSuccess,
- showError,
- showErrorWithDetail,
- showWarning,
-} from '@/utils/toast';
+import { showToast, showSuccess, showError, showErrorWithDetail, showWarning } from '@/utils/toast';
describe('toast', () => {
const loggerInfo = vi.mocked(logger.info);
@@ -109,18 +103,15 @@ describe('toast', () => {
{ name: 'showWarning', fn: showWarning, type: 'warning' },
];
- it.each(wrapperCases)(
- '$name delegates to showToast with type "$type"',
- ({ fn, type }) => {
- const mock = vi.fn(() => 'id');
- (window as unknown as { showToast: typeof mock }).showToast = mock;
+ it.each(wrapperCases)('$name delegates to showToast with type "$type"', ({ fn, type }) => {
+ const mock = vi.fn(() => 'id');
+ (window as unknown as { showToast: typeof mock }).showToast = mock;
- const result = fn('Title', 'Message', 3000);
+ const result = fn('Title', 'Message', 3000);
- expect(mock).toHaveBeenCalledWith(type, 'Title', 'Message', 3000, undefined);
- expect(result).toBe('id');
- },
- );
+ expect(mock).toHaveBeenCalledWith(type, 'Title', 'Message', 3000, undefined);
+ expect(result).toBe('id');
+ });
it('showErrorWithDetail delegates with message undefined and detail as the 5th arg', () => {
const mock = vi.fn(() => 'id');
diff --git a/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts b/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
index 4b5b927b8a..9cf18f3dce 100644
--- a/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/typeColumnPresentation.test.ts
@@ -22,8 +22,7 @@ describe('typeColumnPresentation', () => {
const runtimeEntries = Object.entries(sourceFiles).filter(
([path]) => !path.endsWith('.test.ts') && !path.endsWith('.test.tsx'),
);
- const typeColumnPresentationImportPattern =
- /from\s*['"]@\/utils\/typeColumnPresentation['"]/;
+ const typeColumnPresentationImportPattern = /from\s*['"]@\/utils\/typeColumnPresentation['"]/;
const directTypeLabelHelperUsers = runtimeEntries
.filter(([, source]) => typeColumnPresentationImportPattern.test(source))
diff --git a/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts b/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts
index 99865a4aa9..fb693fd330 100644
--- a/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts
@@ -34,9 +34,9 @@ describe('unifiedAgentInventoryPresentation', () => {
});
it('returns canonical last-seen labels', () => {
- expect(
- getUnifiedAgentLastSeenLabel({ status: 'removed' }, 'Monitoring stopped'),
- ).toBe('Monitoring stopped');
+ expect(getUnifiedAgentLastSeenLabel({ status: 'removed' }, 'Monitoring stopped')).toBe(
+ 'Monitoring stopped',
+ );
expect(getUnifiedAgentLastSeenLabel({ status: 'active' }, 'Monitoring stopped')).toBe('—');
});
@@ -65,9 +65,7 @@ describe('unifiedAgentInventoryPresentation', () => {
expect(getUnifiedAgentConfigUpdateSuccessMessage(false)).toBe(
'Pulse command execution disabled. Syncing with agent...',
);
- expect(getUnifiedAgentConfigUpdateErrorMessage()).toBe(
- 'Failed to update agent configuration',
- );
+ expect(getUnifiedAgentConfigUpdateErrorMessage()).toBe('Failed to update agent configuration');
expect(getUnifiedAgentClipboardCopySuccessMessage()).toBe('Copied to clipboard');
expect(getUnifiedAgentClipboardCopyErrorMessage()).toBe('Failed to copy');
expect(getUnifiedAgentUninstallCommandCopiedMessage()).toBe('Uninstall command copied');
diff --git a/frontend-modern/src/utils/__tests__/unifiedAgentStatusPresentation.branchcov0713.test.ts b/frontend-modern/src/utils/__tests__/unifiedAgentStatusPresentation.branchcov0713.test.ts
index 0dd81f4116..8e1fbeff11 100644
--- a/frontend-modern/src/utils/__tests__/unifiedAgentStatusPresentation.branchcov0713.test.ts
+++ b/frontend-modern/src/utils/__tests__/unifiedAgentStatusPresentation.branchcov0713.test.ts
@@ -22,8 +22,7 @@ import {
const REMOVED_BADGE = 'bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200';
const CONNECTED_BADGE = 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300';
const DEFAULT_BADGE = 'bg-surface-alt text-base-content';
-const LOOKUP_CONNECTED_BADGE =
- 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300';
+const LOOKUP_CONNECTED_BADGE = 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300';
const LOOKUP_DISCONNECTED_BADGE =
'bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200';
@@ -138,7 +137,10 @@ describe('getUnifiedAgentStatusPresentation — branch coverage', () => {
it('routes a non-canonical state value to the default arm (only "removed" is special)', () => {
// A state outside {'active','removed'} is not 'removed', so it falls
// through to the connected/default logic.
- const result = getUnifiedAgentStatusPresentation('paused' as UnifiedAgentMonitoringState, 'offline');
+ const result = getUnifiedAgentStatusPresentation(
+ 'paused' as UnifiedAgentMonitoringState,
+ 'offline',
+ );
expect(result).toEqual({ badgeClass: DEFAULT_BADGE, label: 'offline' });
});
@@ -188,18 +190,14 @@ describe('getUnifiedAgentLookupStatusPresentation — branch coverage', () => {
['null', null],
['undefined', undefined],
] as const)('routes a falsy non-boolean value (%s) to the not-connected arm', (_name, value) => {
- expect(
- getUnifiedAgentLookupStatusPresentation(value as unknown as boolean),
- ).toEqual({
+ expect(getUnifiedAgentLookupStatusPresentation(value as unknown as boolean)).toEqual({
badgeClass: LOOKUP_DISCONNECTED_BADGE,
label: 'Not reporting yet',
});
});
it('routes a truthy non-boolean value (1) to the connected arm', () => {
- expect(
- getUnifiedAgentLookupStatusPresentation(1 as unknown as boolean),
- ).toEqual({
+ expect(getUnifiedAgentLookupStatusPresentation(1 as unknown as boolean)).toEqual({
badgeClass: LOOKUP_CONNECTED_BADGE,
label: 'Connected',
});
diff --git a/frontend-modern/src/utils/__tests__/upgradeNavigation.branchcov0712c.test.ts b/frontend-modern/src/utils/__tests__/upgradeNavigation.branchcov0712c.test.ts
index e9543cd4e8..7d23faddf5 100644
--- a/frontend-modern/src/utils/__tests__/upgradeNavigation.branchcov0712c.test.ts
+++ b/frontend-modern/src/utils/__tests__/upgradeNavigation.branchcov0712c.test.ts
@@ -13,7 +13,9 @@ describe('upgradeNavigation (branch coverage)', () => {
// SSR guard: typeof window === 'undefined' -> early return before window.open.
// If the guard were absent, `undefined.open(...)` would throw.
vi.stubGlobal('window', undefined);
- expect(() => openExternalUpgradeDestination('https://example.com/pricing', false)).not.toThrow();
+ expect(() =>
+ openExternalUpgradeDestination('https://example.com/pricing', false),
+ ).not.toThrow();
vi.unstubAllGlobals();
// The held spy was never wired during the SSR call -> concrete proof the guard fired.
expect(openSpy).toHaveBeenCalledTimes(0);
diff --git a/frontend-modern/src/utils/__tests__/upgradeNavigation.test.ts b/frontend-modern/src/utils/__tests__/upgradeNavigation.test.ts
index 7057ab92a8..01b6c4dda6 100644
--- a/frontend-modern/src/utils/__tests__/upgradeNavigation.test.ts
+++ b/frontend-modern/src/utils/__tests__/upgradeNavigation.test.ts
@@ -101,9 +101,6 @@ describe('upgradeNavigation', () => {
openExternalUpgradeDestination('/auth/license-purchase-start?feature=relay', true);
- expect(windowOpen).toHaveBeenCalledWith(
- '/auth/license-purchase-start?feature=relay',
- '_blank',
- );
+ expect(windowOpen).toHaveBeenCalledWith('/auth/license-purchase-start?feature=relay', '_blank');
});
});
diff --git a/frontend-modern/src/utils/__tests__/vmwareDisplay.test.ts b/frontend-modern/src/utils/__tests__/vmwareDisplay.test.ts
index f1a6dd1f3a..5fa8b00d16 100644
--- a/frontend-modern/src/utils/__tests__/vmwareDisplay.test.ts
+++ b/frontend-modern/src/utils/__tests__/vmwareDisplay.test.ts
@@ -23,10 +23,26 @@ describe('vmwareDisplay', () => {
});
it.each([
- ['both enabled', { clusterHaEnabled: true, clusterDrsEnabled: true }, 'HA enabled · DRS enabled'],
- ['both disabled', { clusterHaEnabled: false, clusterDrsEnabled: false }, 'HA disabled · DRS disabled'],
- ['HA enabled DRS disabled', { clusterHaEnabled: true, clusterDrsEnabled: false }, 'HA enabled · DRS disabled'],
- ['HA disabled DRS enabled', { clusterHaEnabled: false, clusterDrsEnabled: true }, 'HA disabled · DRS enabled'],
+ [
+ 'both enabled',
+ { clusterHaEnabled: true, clusterDrsEnabled: true },
+ 'HA enabled · DRS enabled',
+ ],
+ [
+ 'both disabled',
+ { clusterHaEnabled: false, clusterDrsEnabled: false },
+ 'HA disabled · DRS disabled',
+ ],
+ [
+ 'HA enabled DRS disabled',
+ { clusterHaEnabled: true, clusterDrsEnabled: false },
+ 'HA enabled · DRS disabled',
+ ],
+ [
+ 'HA disabled DRS enabled',
+ { clusterHaEnabled: false, clusterDrsEnabled: true },
+ 'HA disabled · DRS enabled',
+ ],
])('joins both flags with " · " for %s', (_label, meta, expected) => {
expect(formatVmwareClusterServices(meta as ResourceVMwareMeta)).toBe(expected);
});
diff --git a/frontend-modern/src/utils/__tests__/workloadTypePresentation.branchcov0712c.test.ts b/frontend-modern/src/utils/__tests__/workloadTypePresentation.branchcov0712c.test.ts
index 003bba2c0a..3f739b7062 100644
--- a/frontend-modern/src/utils/__tests__/workloadTypePresentation.branchcov0712c.test.ts
+++ b/frontend-modern/src/utils/__tests__/workloadTypePresentation.branchcov0712c.test.ts
@@ -190,9 +190,7 @@ describe('workloadTypePresentation (branch coverage 0712c)', () => {
it('treats a non-string rawType as unknown and falls back to DEFAULT', () => {
type RawTypeArg = Parameters<typeof getWorkloadTypePresentation>[0];
- expect(
- getWorkloadTypePresentation(0 as unknown as RawTypeArg),
- ).toStrictEqual({
+ expect(getWorkloadTypePresentation(0 as unknown as RawTypeArg)).toStrictEqual({
label: 'Unknown',
pluralLabel: 'Unknown',
title: 'Unknown',
diff --git a/frontend-modern/src/utils/__tests__/workloads.coverage.test.ts b/frontend-modern/src/utils/__tests__/workloads.coverage.test.ts
index 356cda91a4..3087681215 100644
--- a/frontend-modern/src/utils/__tests__/workloads.coverage.test.ts
+++ b/frontend-modern/src/utils/__tests__/workloads.coverage.test.ts
@@ -18,30 +18,29 @@ import type { ResourceDiscoveryTarget } from '@/types/resource';
// the malformed-input cases opt out of the contract intentionally.
type AppContainerMetadataIdInput = Pick<WorkloadGuest, 'dockerHostId' | 'name'>;
-
describe('buildAppContainerMetadataId', () => {
it('builds a host-and-name id in the canonical app-container format', () => {
- expect(
- buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: 'grafana' }),
- ).toBe('app-container:docker-main:name:grafana');
+ expect(buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: 'grafana' })).toBe(
+ 'app-container:docker-main:name:grafana',
+ );
});
it('strips leading slashes from the container name', () => {
- expect(
- buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: '/grafana' }),
- ).toBe('app-container:docker-main:name:grafana');
+ expect(buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: '/grafana' })).toBe(
+ 'app-container:docker-main:name:grafana',
+ );
});
it('strips multiple leading slashes from the container name', () => {
- expect(
- buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: '///traefik' }),
- ).toBe('app-container:docker-main:name:traefik');
+ expect(buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: '///traefik' })).toBe(
+ 'app-container:docker-main:name:traefik',
+ );
});
it('preserves internal slashes in the container name', () => {
- expect(
- buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: '/stack/app-1' }),
- ).toBe('app-container:docker-main:name:stack/app-1');
+ expect(buildAppContainerMetadataId({ dockerHostId: 'docker-main', name: '/stack/app-1' })).toBe(
+ 'app-container:docker-main:name:stack/app-1',
+ );
});
it('trims surrounding whitespace from both parts', () => {
@@ -128,18 +127,18 @@ describe('getWorkloadPlatformScopes', () => {
});
it('falls back to the platform type when no scopes are provided', () => {
- expect(getWorkloadPlatformScopes({ platformScopes: undefined, platformType: 'docker' })).toEqual(
- ['docker'],
- );
+ expect(
+ getWorkloadPlatformScopes({ platformScopes: undefined, platformType: 'docker' }),
+ ).toEqual(['docker']);
expect(getWorkloadPlatformScopes({ platformScopes: [], platformType: 'K8s' })).toEqual([
'kubernetes',
]);
});
it('returns an empty array when neither scopes nor platform type resolve', () => {
- expect(getWorkloadPlatformScopes({ platformScopes: undefined, platformType: undefined })).toEqual(
- [],
- );
+ expect(
+ getWorkloadPlatformScopes({ platformScopes: undefined, platformType: undefined }),
+ ).toEqual([]);
expect(getWorkloadPlatformScopes({ platformScopes: ['all'], platformType: '' })).toEqual([]);
});
@@ -156,7 +155,10 @@ describe('getWorkloadPlatformScopes', () => {
describe('workloadMatchesPlatformScope', () => {
it('matches a workload scope verbatim', () => {
expect(
- workloadMatchesPlatformScope({ platformScopes: ['docker'], platformType: undefined }, 'docker'),
+ workloadMatchesPlatformScope(
+ { platformScopes: ['docker'], platformType: undefined },
+ 'docker',
+ ),
).toBe(true);
});
@@ -177,7 +179,10 @@ describe('workloadMatchesPlatformScope', () => {
it('matches case-insensitively', () => {
expect(
- workloadMatchesPlatformScope({ platformScopes: ['Docker'], platformType: undefined }, 'DOCKER'),
+ workloadMatchesPlatformScope(
+ { platformScopes: ['Docker'], platformType: undefined },
+ 'DOCKER',
+ ),
).toBe(true);
});
@@ -457,21 +462,13 @@ describe('resolveDiscoveryTargetForWorkload', () => {
});
it('returns null when the docker host id is missing', () => {
- expect(
- resolveDiscoveryTargetForWorkload({ ...dockerGuest, dockerHostId: '' }),
- ).toBeNull();
- expect(
- resolveDiscoveryTargetForWorkload({ ...dockerGuest, dockerHostId: ' ' }),
- ).toBeNull();
+ expect(resolveDiscoveryTargetForWorkload({ ...dockerGuest, dockerHostId: '' })).toBeNull();
+ expect(resolveDiscoveryTargetForWorkload({ ...dockerGuest, dockerHostId: ' ' })).toBeNull();
});
it('returns null when the container id is missing', () => {
- expect(
- resolveDiscoveryTargetForWorkload({ ...dockerGuest, containerId: '' }),
- ).toBeNull();
- expect(
- resolveDiscoveryTargetForWorkload({ ...dockerGuest, containerId: ' ' }),
- ).toBeNull();
+ expect(resolveDiscoveryTargetForWorkload({ ...dockerGuest, containerId: '' })).toBeNull();
+ expect(resolveDiscoveryTargetForWorkload({ ...dockerGuest, containerId: ' ' })).toBeNull();
});
});
diff --git a/frontend-modern/src/utils/__tests__/workloadsSummaryCache.branchcov0717.test.ts b/frontend-modern/src/utils/__tests__/workloadsSummaryCache.branchcov0717.test.ts
index 205ef4fe86..76a0d0f2c7 100644
--- a/frontend-modern/src/utils/__tests__/workloadsSummaryCache.branchcov0717.test.ts
+++ b/frontend-modern/src/utils/__tests__/workloadsSummaryCache.branchcov0717.test.ts
@@ -62,8 +62,7 @@ const storageKeyFor = (
const metric = (value: number): MetricPoint => ({ timestamp: value, value });
-const points = (n: number): MetricPoint[] =>
- Array.from({ length: n }, (_, i) => metric(i));
+const points = (n: number): MetricPoint[] => Array.from({ length: n }, (_, i) => metric(i));
const makeResponse = (cpu?: MetricPoint[]): WorkloadChartsResponse => ({
data: {
@@ -107,36 +106,26 @@ describe('workloadsSummaryCache branch coverage (supplemental)', () => {
});
it('coerces undefined node scope to empty string via the ?. ?? chain', () => {
- expect(workloadsSummaryCacheScopeKey('1h', undefined, 'acme')).toBe(
- `${VERSION}::acme::1h::`,
- );
+ expect(workloadsSummaryCacheScopeKey('1h', undefined, 'acme')).toBe(`${VERSION}::acme::1h::`);
});
it('coerces null node scope to empty string (optional chaining treats null as nullish)', () => {
- expect(workloadsSummaryCacheScopeKey('1h', null, 'acme')).toBe(
- `${VERSION}::acme::1h::`,
- );
+ expect(workloadsSummaryCacheScopeKey('1h', null, 'acme')).toBe(`${VERSION}::acme::1h::`);
});
it('collapses a whitespace-only node scope to empty string', () => {
- expect(workloadsSummaryCacheScopeKey('1h', ' ', 'acme')).toBe(
- `${VERSION}::acme::1h::`,
- );
+ expect(workloadsSummaryCacheScopeKey('1h', ' ', 'acme')).toBe(`${VERSION}::acme::1h::`);
});
it('uses the defaulted params when only range is supplied', () => {
// nodeScope defaults '' and orgScope defaults undefined -> getOrgID().
- expect(workloadsSummaryCacheScopeKey('1h')).toBe(
- `${VERSION}::${ORG_FROM_GETORGID}::1h::`,
- );
+ expect(workloadsSummaryCacheScopeKey('1h')).toBe(`${VERSION}::${ORG_FROM_GETORGID}::1h::`);
});
});
describe('resolveOrgScope (via workloadsSummaryCacheScopeKey)', () => {
it('honours an explicitly provided org scope without calling getOrgID', () => {
- expect(workloadsSummaryCacheScopeKey('1h', '', 'custom')).toBe(
- `${VERSION}::custom::1h::`,
- );
+ expect(workloadsSummaryCacheScopeKey('1h', '', 'custom')).toBe(`${VERSION}::custom::1h::`);
});
it('falls back to getOrgID() when orgScope is undefined (?? right operand)', () => {
@@ -153,15 +142,11 @@ describe('workloadsSummaryCache branch coverage (supplemental)', () => {
it('normalises an empty-string orgScope to the default org (empty string is not nullish)', () => {
// '' ?? getOrgID() -> '' (not nullish), then normalizeOrgScope('') -> 'default'.
- expect(workloadsSummaryCacheScopeKey('1h', '', '')).toBe(
- `${VERSION}::default::1h::`,
- );
+ expect(workloadsSummaryCacheScopeKey('1h', '', '')).toBe(`${VERSION}::default::1h::`);
});
it('trims and keeps a whitespace-padded org scope', () => {
- expect(workloadsSummaryCacheScopeKey('1h', '', ' acme ')).toBe(
- `${VERSION}::acme::1h::`,
- );
+ expect(workloadsSummaryCacheScopeKey('1h', '', ' acme ')).toBe(`${VERSION}::acme::1h::`);
});
});
@@ -183,10 +168,7 @@ describe('workloadsSummaryCache branch coverage (supplemental)', () => {
});
describe('normalizeMaxPoints (via fetchWorkloadsSummaryAndCache call args)', () => {
- const expectCall = async (
- maxPoints: unknown,
- expected: number | undefined,
- ): Promise<void> => {
+ const expectCall = async (maxPoints: unknown, expected: number | undefined): Promise<void> => {
await fetchWorkloadsSummaryAndCache('1h', {
maxPoints: maxPoints as number | null,
});
@@ -267,9 +249,7 @@ describe('workloadsSummaryCache branch coverage (supplemental)', () => {
const response = makeResponse();
mockGetWorkloadCharts.mockResolvedValueOnce(response);
await fetchWorkloadsSummaryAndCache('1h', {});
- expect(readInMemoryWorkloadsSummaryCache('1h', '', ORG_FROM_GETORGID)).toBe(
- response,
- );
+ expect(readInMemoryWorkloadsSummaryCache('1h', '', ORG_FROM_GETORGID)).toBe(response);
});
});
@@ -403,22 +383,20 @@ describe('workloadsSummaryCache branch coverage (supplemental)', () => {
});
it('stores an empty data record when response.data is undefined (|| {} arm)', () => {
- persistWorkloadsSummaryCache(
- '1h',
- '',
- 'acme',
- { dockerData: {}, timestamp: 1, stats: { oldestDataTimestamp: 0 } } as unknown as WorkloadChartsResponse,
- );
+ persistWorkloadsSummaryCache('1h', '', 'acme', {
+ dockerData: {},
+ timestamp: 1,
+ stats: { oldestDataTimestamp: 0 },
+ } as unknown as WorkloadChartsResponse);
expect(readWorkloadsSummaryCache('1h', '', 'acme')?.data).toEqual({});
});
it('stores an empty dockerData record when response.dockerData is undefined (|| {} arm)', () => {
- persistWorkloadsSummaryCache(
- '1h',
- '',
- 'acme',
- { data: {}, timestamp: 1, stats: { oldestDataTimestamp: 0 } } as unknown as WorkloadChartsResponse,
- );
+ persistWorkloadsSummaryCache('1h', '', 'acme', {
+ data: {},
+ timestamp: 1,
+ stats: { oldestDataTimestamp: 0 },
+ } as unknown as WorkloadChartsResponse);
expect(readWorkloadsSummaryCache('1h', '', 'acme')?.dockerData).toEqual({});
});
@@ -451,15 +429,11 @@ describe('workloadsSummaryCache branch coverage (supplemental)', () => {
});
it('swallows a localStorage.setItem failure (catch arm) without throwing', () => {
- const spy = vi
- .spyOn(Storage.prototype, 'setItem')
- .mockImplementationOnce(() => {
- throw new Error('QuotaExceededError');
- });
+ const spy = vi.spyOn(Storage.prototype, 'setItem').mockImplementationOnce(() => {
+ throw new Error('QuotaExceededError');
+ });
const response = makeResponse();
- expect(() =>
- persistWorkloadsSummaryCache('1h', '', 'acme', response),
- ).not.toThrow();
+ expect(() => persistWorkloadsSummaryCache('1h', '', 'acme', response)).not.toThrow();
// Not persisted to storage (setItem threw)...
expect(localStorage.length).toBe(0);
// ...but memory was warmed before the try block.
@@ -501,11 +475,8 @@ describe('workloadsSummaryCache branch coverage (supplemental)', () => {
orgScope: string | undefined,
payload: Record<string, unknown>,
): void => {
- const normalizedNode = (nodeScope?.trim() ?? '');
- localStorage.setItem(
- storageKeyFor(range, normalizedNode, orgScope),
- JSON.stringify(payload),
- );
+ const normalizedNode = nodeScope?.trim() ?? '';
+ localStorage.setItem(storageKeyFor(range, normalizedNode, orgScope), JSON.stringify(payload));
};
it('rejects and removes an entry whose version mismatches', () => {
diff --git a/frontend-modern/src/utils/actionAuditPresentation.ts b/frontend-modern/src/utils/actionAuditPresentation.ts
index 572a281a3c..e736713848 100644
--- a/frontend-modern/src/utils/actionAuditPresentation.ts
+++ b/frontend-modern/src/utils/actionAuditPresentation.ts
@@ -117,27 +117,33 @@ const ACTION_REFUSAL_PRESENTATION: Record<
'policy_authorization_expired:': {
label: 'Policy authority expired',
detail: 'Pulse refused dispatch because the server authorization lease expired.',
- className: 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
+ className:
+ 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
},
'policy_authorization_invalid:': {
label: 'Policy authority invalid',
- detail: 'Pulse refused dispatch because current server policy authority could not be validated.',
- className: 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300',
+ detail:
+ 'Pulse refused dispatch because current server policy authority could not be validated.',
+ className:
+ 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300',
},
'policy_authorization_revoked:': {
label: 'Policy authority revoked',
detail: 'Pulse refused dispatch because current server policy authority was revoked.',
- className: 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300',
+ className:
+ 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300',
},
'action_emergency_stop:': {
label: 'Emergency stop active',
detail: 'Pulse refused dispatch because the action emergency stop is active.',
- className: 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300',
+ className:
+ 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300',
},
'action_replan_required:': {
label: 'New review required',
detail: 'Pulse refused dispatch because current policy requires a new plan and review.',
- className: 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
+ className:
+ 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
},
};
@@ -156,14 +162,14 @@ const VERIFICATION_OUTCOME_PRESENTATION: Record<
},
verified: {
label: 'Legacy check passed (source unclassified)',
- detail: 'This older record does not identify an evidence source. Do not treat it as independent confirmation.',
+ detail:
+ 'This older record does not identify an evidence source. Do not treat it as independent confirmation.',
className:
'border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300',
},
unverified: {
label: 'Verification not confirmed',
- detail:
- 'Pulse did not receive verification evidence that confirmed the intended state.',
+ detail: 'Pulse did not receive verification evidence that confirmed the intended state.',
className:
'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
},
@@ -265,12 +271,35 @@ export const getActionAuditResultPresentation = (
const truth = result.actionResultV2?.execution;
if (truth) {
const presentation = {
- succeeded: { kind: 'success' as const, label: 'Execution succeeded', className: 'border-blue-200 bg-blue-50 text-blue-800 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-200' },
- failed: { kind: 'failure' as const, label: 'Execution failed', className: 'border-red-200 bg-red-50 text-red-800 dark:border-red-800 dark:bg-red-950/40 dark:text-red-300' },
- not_run: { kind: 'failure' as const, label: 'Execution did not run', className: 'border-border bg-surface text-base-content' },
- inconclusive: { kind: 'failure' as const, label: 'Execution inconclusive', className: 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300' },
+ succeeded: {
+ kind: 'success' as const,
+ label: 'Execution succeeded',
+ className:
+ 'border-blue-200 bg-blue-50 text-blue-800 dark:border-blue-800 dark:bg-blue-950/40 dark:text-blue-200',
+ },
+ failed: {
+ kind: 'failure' as const,
+ label: 'Execution failed',
+ className:
+ 'border-red-200 bg-red-50 text-red-800 dark:border-red-800 dark:bg-red-950/40 dark:text-red-300',
+ },
+ not_run: {
+ kind: 'failure' as const,
+ label: 'Execution did not run',
+ className: 'border-border bg-surface text-base-content',
+ },
+ inconclusive: {
+ kind: 'failure' as const,
+ label: 'Execution inconclusive',
+ className:
+ 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
+ },
}[truth.status];
- return { ...presentation, detail: truth.summary?.trim() || undefined, reasonLabel: truth.reasonCode ? formatActionCapabilityLabel(truth.reasonCode) : undefined };
+ return {
+ ...presentation,
+ detail: truth.summary?.trim() || undefined,
+ reasonLabel: truth.reasonCode ? formatActionCapabilityLabel(truth.reasonCode) : undefined,
+ };
}
if (result.success) {
@@ -291,23 +320,39 @@ export const getActionAuditResultPresentation = (
};
};
-export const getActionAuditVerificationOutcomePresentation = (
- audit: {
- verificationOutcome?: { status?: string; evidenceSummary?: string };
- result?: ActionAuditRecord['result'];
- },
-): ActionAuditVerificationOutcomePresentation | undefined => {
+export const getActionAuditVerificationOutcomePresentation = (audit: {
+ verificationOutcome?: { status?: string; evidenceSummary?: string };
+ result?: ActionAuditRecord['result'];
+}): ActionAuditVerificationOutcomePresentation | undefined => {
const truth = audit.result?.actionResultV2?.verification;
if (truth) {
- const source = truth.evidenceClass === 'independent' ? 'Independent observer' : truth.evidenceClass === 'agent_attested' ? 'Executing agent (agent-attested)' : 'No evidence source';
- const statusCopy = {
- confirmed: truth.evidenceClass === 'independent'
- ? ['Confirmed by independent observer', 'An observer in a different trust domain confirmed the intended state.']
+ const source =
+ truth.evidenceClass === 'independent'
+ ? 'Independent observer'
: truth.evidenceClass === 'agent_attested'
- ? ['Confirmed by executing agent', 'The same agent trust domain that executed the action reported the intended state.']
- : ['Confirmation lacks an evidence source', 'The record says confirmed but provides no evidence source; do not treat it as independently verified.'],
+ ? 'Executing agent (agent-attested)'
+ : 'No evidence source';
+ const statusCopy = {
+ confirmed:
+ truth.evidenceClass === 'independent'
+ ? [
+ 'Confirmed by independent observer',
+ 'An observer in a different trust domain confirmed the intended state.',
+ ]
+ : truth.evidenceClass === 'agent_attested'
+ ? [
+ 'Confirmed by executing agent',
+ 'The same agent trust domain that executed the action reported the intended state.',
+ ]
+ : [
+ 'Confirmation lacks an evidence source',
+ 'The record says confirmed but provides no evidence source; do not treat it as independently verified.',
+ ],
contradicted: ['Outcome contradicted', 'Observed evidence contradicted the intended state.'],
- inconclusive: ['Outcome inconclusive', 'Available evidence could not establish the intended state.'],
+ inconclusive: [
+ 'Outcome inconclusive',
+ 'Available evidence could not establish the intended state.',
+ ],
not_attempted: ['Outcome not verified', 'No outcome verification was attempted.'],
} as const;
const [label, detail] = statusCopy[truth.status];
@@ -315,25 +360,25 @@ export const getActionAuditVerificationOutcomePresentation = (
label,
detail,
evidenceSummary: `${truth.summary?.trim() || 'No additional verification summary.'} Source: ${source}.`,
- className: truth.status === 'confirmed'
- ? 'border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300'
- : truth.status === 'contradicted'
- ? 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300'
- : 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
+ className:
+ truth.status === 'confirmed'
+ ? 'border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300'
+ : truth.status === 'contradicted'
+ ? 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-300'
+ : 'border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-300',
};
}
const outcome = audit.verificationOutcome;
const status = (outcome?.status || '').trim().toLowerCase();
if (!status) return undefined;
- const presentation =
- VERIFICATION_OUTCOME_PRESENTATION[
- status as keyof typeof VERIFICATION_OUTCOME_PRESENTATION
- ] ?? {
- label: 'Verification outcome recorded',
- detail: 'Pulse recorded a bounded verification status that this client does not classify.',
- className: 'border-border bg-surface text-base-content',
- };
+ const presentation = VERIFICATION_OUTCOME_PRESENTATION[
+ status as keyof typeof VERIFICATION_OUTCOME_PRESENTATION
+ ] ?? {
+ label: 'Verification outcome recorded',
+ detail: 'Pulse recorded a bounded verification status that this client does not classify.',
+ className: 'border-border bg-surface text-base-content',
+ };
const evidenceSummary = outcome?.evidenceSummary?.trim();
return {
diff --git a/frontend-modern/src/utils/agentCapabilityPresentation.ts b/frontend-modern/src/utils/agentCapabilityPresentation.ts
index c817cf2841..9957a1c0df 100644
--- a/frontend-modern/src/utils/agentCapabilityPresentation.ts
+++ b/frontend-modern/src/utils/agentCapabilityPresentation.ts
@@ -1,12 +1,5 @@
export type AgentCapability =
- | 'agent'
- | 'docker'
- | 'kubernetes'
- | 'proxmox'
- | 'pbs'
- | 'pmg'
- | 'truenas'
- | 'availability';
+ 'agent' | 'docker' | 'kubernetes' | 'proxmox' | 'pbs' | 'pmg' | 'truenas' | 'availability';
export function getAgentCapabilityLabel(capability: AgentCapability): string {
switch (capability) {
diff --git a/frontend-modern/src/utils/alertConfigPresentation.ts b/frontend-modern/src/utils/alertConfigPresentation.ts
index 88d55d45ad..e9e859f356 100644
--- a/frontend-modern/src/utils/alertConfigPresentation.ts
+++ b/frontend-modern/src/utils/alertConfigPresentation.ts
@@ -20,8 +20,7 @@ export const ALERT_CONFIG_COOLDOWN_TITLE = 'Alert cooldown';
export const ALERT_CONFIG_COOLDOWN_DESCRIPTION = 'Limit alert frequency to prevent spam.';
export const ALERT_CONFIG_COOLDOWN_PERIOD_LABEL = 'Cooldown period';
export const ALERT_CONFIG_COOLDOWN_PERIOD_SUFFIX = 'minutes';
-export const ALERT_CONFIG_COOLDOWN_PERIOD_HELP =
- 'Minimum time between alerts for the same issue';
+export const ALERT_CONFIG_COOLDOWN_PERIOD_HELP = 'Minimum time between alerts for the same issue';
export const ALERT_CONFIG_COOLDOWN_MAX_ALERTS_LABEL = 'Max alerts / hour';
export const ALERT_CONFIG_COOLDOWN_MAX_ALERTS_SUFFIX = 'alerts';
export const ALERT_CONFIG_COOLDOWN_MAX_ALERTS_HELP = 'Per workload/metric combination';
@@ -64,8 +63,7 @@ export const ALERT_CONFIG_SUMMARY_GROUPING_PREFIX = '• Grouping alerts within'
export const ALERT_CONFIG_SUMMARY_RECOVERY = '• Recovery notifications enabled when alerts clear';
export const ALERT_CONFIG_RECOVERY_HELP =
'Sends on the same channels as live alerts to confirm when a condition clears.';
-export const ALERT_CONFIG_ESCALATION_HELP =
- 'Define escalation levels for unresolved alerts:';
+export const ALERT_CONFIG_ESCALATION_HELP = 'Define escalation levels for unresolved alerts:';
export const ALERT_CONFIG_ESCALATION_AFTER_LABEL = 'After';
export const ALERT_CONFIG_ESCALATION_NOTIFY_LABEL = 'Notify';
export const ALERT_CONFIG_ESCALATION_MINUTES_SUFFIX = 'min';
@@ -153,9 +151,7 @@ export function getAlertConfigEscalationHelp() {
return ALERT_CONFIG_ESCALATION_HELP;
}
-export function getAlertConfigEscalationNotifyLabel(
- type: 'email' | 'webhook' | 'all',
-) {
+export function getAlertConfigEscalationNotifyLabel(type: 'email' | 'webhook' | 'all') {
switch (type) {
case 'email':
return ALERT_CONFIG_ESCALATION_NOTIFY_EMAIL;
diff --git a/frontend-modern/src/utils/alertDetailPresentation.ts b/frontend-modern/src/utils/alertDetailPresentation.ts
index 50e2fa9765..4dcd883bd0 100644
--- a/frontend-modern/src/utils/alertDetailPresentation.ts
+++ b/frontend-modern/src/utils/alertDetailPresentation.ts
@@ -9,54 +9,53 @@ const CODE_PREFIX_BY_PROVIDER: Record<PlatformAlertProvider, string> = {
vmware: 'vmware_',
};
-const RESOURCE_TYPE_LABELS: Record<PlatformAlertProvider, Partial<Record<ResourceType, string>>> =
- {
- docker: {
- agent: 'Host',
- 'app-container': 'Container',
- 'docker-service': 'Service',
- 'docker-task': 'Task',
- 'docker-swarm-node': 'Swarm Node',
- 'docker-image': 'Image',
- 'docker-volume': 'Volume',
- 'docker-network': 'Network',
- 'docker-secret': 'Secret',
- 'docker-config': 'Config',
- },
- kubernetes: {
- agent: 'Node',
- 'k8s-cluster': 'Cluster',
- 'k8s-node': 'Node',
- pod: 'Pod',
- 'k8s-deployment': 'Deployment',
- 'k8s-replicaset': 'ReplicaSet',
- 'k8s-statefulset': 'StatefulSet',
- 'k8s-daemonset': 'DaemonSet',
- 'k8s-job': 'Job',
- 'k8s-cronjob': 'CronJob',
- 'k8s-service': 'Service',
- 'k8s-ingress': 'Ingress',
- 'k8s-namespace': 'Namespace',
- 'k8s-event': 'Event',
- 'k8s-persistent-volume': 'PersistentVolume',
- 'k8s-persistent-volume-claim': 'PVC',
- },
- truenas: {
- agent: 'System',
- storage: 'Pool',
- pool: 'Pool',
- dataset: 'Dataset',
- physical_disk: 'Disk',
- 'network-share': 'Share',
- vm: 'VM',
- 'app-container': 'App',
- },
- vmware: {
- agent: 'Host',
- vm: 'VM',
- storage: 'Datastore',
- },
- };
+const RESOURCE_TYPE_LABELS: Record<PlatformAlertProvider, Partial<Record<ResourceType, string>>> = {
+ docker: {
+ agent: 'Host',
+ 'app-container': 'Container',
+ 'docker-service': 'Service',
+ 'docker-task': 'Task',
+ 'docker-swarm-node': 'Swarm Node',
+ 'docker-image': 'Image',
+ 'docker-volume': 'Volume',
+ 'docker-network': 'Network',
+ 'docker-secret': 'Secret',
+ 'docker-config': 'Config',
+ },
+ kubernetes: {
+ agent: 'Node',
+ 'k8s-cluster': 'Cluster',
+ 'k8s-node': 'Node',
+ pod: 'Pod',
+ 'k8s-deployment': 'Deployment',
+ 'k8s-replicaset': 'ReplicaSet',
+ 'k8s-statefulset': 'StatefulSet',
+ 'k8s-daemonset': 'DaemonSet',
+ 'k8s-job': 'Job',
+ 'k8s-cronjob': 'CronJob',
+ 'k8s-service': 'Service',
+ 'k8s-ingress': 'Ingress',
+ 'k8s-namespace': 'Namespace',
+ 'k8s-event': 'Event',
+ 'k8s-persistent-volume': 'PersistentVolume',
+ 'k8s-persistent-volume-claim': 'PVC',
+ },
+ truenas: {
+ agent: 'System',
+ storage: 'Pool',
+ pool: 'Pool',
+ dataset: 'Dataset',
+ physical_disk: 'Disk',
+ 'network-share': 'Share',
+ vm: 'VM',
+ 'app-container': 'App',
+ },
+ vmware: {
+ agent: 'Host',
+ vm: 'VM',
+ storage: 'Datastore',
+ },
+};
const titleCaseToken = (part: string): string =>
part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();
@@ -64,10 +63,7 @@ const titleCaseToken = (part: string): string =>
const isUnsetDate = (date: Date): boolean =>
Number.isNaN(date.getTime()) || date.getUTCFullYear() < 2000;
-export function formatPlatformAlertCode(
- code: string,
- provider?: PlatformAlertProvider,
-): string {
+export function formatPlatformAlertCode(code: string, provider?: PlatformAlertProvider): string {
const trimmed = code.trim();
const prefix = provider ? CODE_PREFIX_BY_PROVIDER[provider] : undefined;
const normalized =
diff --git a/frontend-modern/src/utils/alertFrequencyPresentation.ts b/frontend-modern/src/utils/alertFrequencyPresentation.ts
index d7c26af4ca..699ab93541 100644
--- a/frontend-modern/src/utils/alertFrequencyPresentation.ts
+++ b/frontend-modern/src/utils/alertFrequencyPresentation.ts
@@ -2,8 +2,7 @@ export function getAlertFrequencySelectionPresentation() {
return {
containerClass:
'inline-flex items-center gap-2 rounded-full border border-blue-200 bg-blue-50 px-3 py-1 text-xs text-blue-700 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200',
- labelClass:
- 'font-medium uppercase tracking-wide text-[10px] text-blue-600 dark:text-blue-300',
+ labelClass: 'font-medium uppercase tracking-wide text-[10px] text-blue-600 dark:text-blue-300',
};
}
diff --git a/frontend-modern/src/utils/alertIncidentPresentation.ts b/frontend-modern/src/utils/alertIncidentPresentation.ts
index e412d9065f..f767a5a408 100644
--- a/frontend-modern/src/utils/alertIncidentPresentation.ts
+++ b/frontend-modern/src/utils/alertIncidentPresentation.ts
@@ -78,7 +78,9 @@ export function getAlertIncidentLevelBadgeClass(level: AlertIncidentLevel): stri
return `${ALERT_INCIDENT_LEVEL_BASE} bg-yellow-100 dark:bg-yellow-900 text-yellow-700 dark:text-yellow-300`;
}
-export function getAlertHistoryStatusPresentation(status?: string | null): AlertHistoryStatusPresentation {
+export function getAlertHistoryStatusPresentation(
+ status?: string | null,
+): AlertHistoryStatusPresentation {
const normalized = (status ?? '').trim().toLowerCase();
if (normalized === 'active') {
@@ -127,7 +129,9 @@ export function getAlertResourceIncidentCountLabel(count: number) {
}
export function getAlertResourceIncidentRefreshLabel(isLoading: boolean) {
- return isLoading ? ALERT_RESOURCE_INCIDENT_REFRESHING_LABEL : ALERT_RESOURCE_INCIDENT_REFRESH_LABEL;
+ return isLoading
+ ? ALERT_RESOURCE_INCIDENT_REFRESHING_LABEL
+ : ALERT_RESOURCE_INCIDENT_REFRESH_LABEL;
}
export function getAlertResourceIncidentAcknowledgedByLabel(user: string) {
@@ -153,7 +157,9 @@ export function getAlertResourceIncidentNotePlaceholder() {
}
export function getAlertResourceIncidentSaveNoteLabel(isSaving: boolean) {
- return isSaving ? ALERT_RESOURCE_INCIDENT_SAVING_NOTE_LABEL : ALERT_RESOURCE_INCIDENT_SAVE_NOTE_LABEL;
+ return isSaving
+ ? ALERT_RESOURCE_INCIDENT_SAVING_NOTE_LABEL
+ : ALERT_RESOURCE_INCIDENT_SAVE_NOTE_LABEL;
}
export function getAlertResourceIncidentLoadFailure() {
diff --git a/frontend-modern/src/utils/alertResourceTablePresentation.ts b/frontend-modern/src/utils/alertResourceTablePresentation.ts
index 85da2a79d4..727cf553be 100644
--- a/frontend-modern/src/utils/alertResourceTablePresentation.ts
+++ b/frontend-modern/src/utils/alertResourceTablePresentation.ts
@@ -4,8 +4,7 @@ export const ALERT_RESOURCE_TABLE_METRIC_DISABLED_PLACEHOLDER = 'Off';
export const ALERT_RESOURCE_TABLE_OVERRIDE_NOTE_PLACEHOLDER =
'Add a note about this override (optional)';
export const ALERT_RESOURCE_TABLE_EDIT_NOTE_PLACEHOLDER = 'Add a note...';
-export const ALERT_RESOURCE_TABLE_RESET_FACTORY_DEFAULTS_LABEL =
- 'Reset to factory defaults';
+export const ALERT_RESOURCE_TABLE_RESET_FACTORY_DEFAULTS_LABEL = 'Reset to factory defaults';
export const ALERT_RESOURCE_TABLE_REVERT_TO_DEFAULTS_LABEL = 'Revert to defaults';
export const ALERT_RESOURCE_TABLE_ALERT_DELAY_LABEL = 'Alert Delay (s)';
export const ALERT_RESOURCE_TABLE_OFFLINE_STATE_OFF_LABEL = 'Off';
diff --git a/frontend-modern/src/utils/alertThresholdsPresentation.ts b/frontend-modern/src/utils/alertThresholdsPresentation.ts
index 432d33cb2d..c5e4b0275c 100644
--- a/frontend-modern/src/utils/alertThresholdsPresentation.ts
+++ b/frontend-modern/src/utils/alertThresholdsPresentation.ts
@@ -2,16 +2,18 @@ import { getInfrastructureSettingsLocationLabel } from '@/utils/infrastructureSe
export const PBS_THRESHOLDS_EMPTY_STATE = 'No PBS servers configured.';
export const GUEST_THRESHOLDS_EMPTY_STATE = 'No VMs or containers found.';
-export const NODE_THRESHOLDS_FILTER_EMPTY_STATE = 'No virtualization hosts match the current filters.';
+export const NODE_THRESHOLDS_FILTER_EMPTY_STATE =
+ 'No virtualization hosts match the current filters.';
export const PBS_THRESHOLDS_FILTER_EMPTY_STATE = 'No PBS servers match the current filters.';
-export const GUEST_THRESHOLDS_FILTER_EMPTY_STATE = 'No VMs or containers match the current filters.';
+export const GUEST_THRESHOLDS_FILTER_EMPTY_STATE =
+ 'No VMs or containers match the current filters.';
export const GUEST_FILTERING_EMPTY_STATE = 'Configure VM and container filtering rules.';
export const BACKUP_THRESHOLDS_EMPTY_STATE = 'Configure recovery alert thresholds.';
export const SNAPSHOT_THRESHOLDS_EMPTY_STATE = 'Configure snapshot age thresholds.';
export const STORAGE_THRESHOLDS_EMPTY_STATE = 'No storage devices found.';
-export const STORAGE_THRESHOLDS_FILTER_EMPTY_STATE = 'No storage devices match the current filters.';
-export const PMG_THRESHOLDS_EMPTY_STATE =
- `No mail gateways configured yet. Add a Proxmox Mail Gateway connection in ${getInfrastructureSettingsLocationLabel()} to manage thresholds.`;
+export const STORAGE_THRESHOLDS_FILTER_EMPTY_STATE =
+ 'No storage devices match the current filters.';
+export const PMG_THRESHOLDS_EMPTY_STATE = `No mail gateways configured yet. Add a Proxmox Mail Gateway connection in ${getInfrastructureSettingsLocationLabel()} to manage thresholds.`;
export const PMG_THRESHOLDS_FILTER_EMPTY_STATE = 'No mail gateways match the current filters.';
export const AGENT_THRESHOLDS_FILTER_EMPTY_STATE = 'No machines match the current filters.';
export const AGENT_DISKS_EMPTY_STATE =
diff --git a/frontend-modern/src/utils/approvalState.ts b/frontend-modern/src/utils/approvalState.ts
index ae3bd9bf5e..6b72f6ee7d 100644
--- a/frontend-modern/src/utils/approvalState.ts
+++ b/frontend-modern/src/utils/approvalState.ts
@@ -1,8 +1,8 @@
import type { ApprovalRequest } from '@/api/ai';
-export const getApprovalExpiryTime = (
- approval: { expiresAt?: ApprovalRequest['expiresAt'] | null },
-): number | null => {
+export const getApprovalExpiryTime = (approval: {
+ expiresAt?: ApprovalRequest['expiresAt'] | null;
+}): number | null => {
const expiry = Date.parse(approval.expiresAt ?? '');
return Number.isFinite(expiry) ? expiry : null;
};
diff --git a/frontend-modern/src/utils/commercialBillingModel.ts b/frontend-modern/src/utils/commercialBillingModel.ts
index 6fe4b42b80..e9f5bdc889 100644
--- a/frontend-modern/src/utils/commercialBillingModel.ts
+++ b/frontend-modern/src/utils/commercialBillingModel.ts
@@ -36,10 +36,7 @@ export interface SelfHostedCommercialModelInput {
}
export interface HostedCommercialModelInput {
- status?: Pick<
- LicenseStatus,
- 'email' | 'is_lifetime' | 'expires_at' | 'max_guests'
- > | null;
+ status?: Pick<LicenseStatus, 'email' | 'is_lifetime' | 'expires_at' | 'max_guests'> | null;
tierLabel: string;
licenseStatusLabel: string;
organizationCount: number;
diff --git a/frontend-modern/src/utils/connectionErrorPresentation.ts b/frontend-modern/src/utils/connectionErrorPresentation.ts
index 20a40dfcc1..23d9424e57 100644
--- a/frontend-modern/src/utils/connectionErrorPresentation.ts
+++ b/frontend-modern/src/utils/connectionErrorPresentation.ts
@@ -95,10 +95,7 @@ const HUMANIZED_PATTERNS: { match: RegExp; headline: string; hint: string | null
];
const stripImplementationPrefixes = (raw: string): string =>
- raw
- .replace(POLL_PREFIX_PATTERN, '')
- .replace(HTTP_VERB_PATTERN, '')
- .trim();
+ raw.replace(POLL_PREFIX_PATTERN, '').replace(HTTP_VERB_PATTERN, '').trim();
export const humanizeConnectionError = (raw?: string | null): HumanizedConnectionError | null => {
if (!raw) return null;
diff --git a/frontend-modern/src/utils/findingAlertIdentity.ts b/frontend-modern/src/utils/findingAlertIdentity.ts
index 869368e5a4..f603921ee5 100644
--- a/frontend-modern/src/utils/findingAlertIdentity.ts
+++ b/frontend-modern/src/utils/findingAlertIdentity.ts
@@ -2,10 +2,9 @@ type FindingAlertIdentity = {
alertIdentifier?: string;
};
-export const getFindingAlertIdentifier = (
- finding: FindingAlertIdentity,
-): string | undefined => {
- const canonical = typeof finding.alertIdentifier === 'string' ? finding.alertIdentifier.trim() : '';
+export const getFindingAlertIdentifier = (finding: FindingAlertIdentity): string | undefined => {
+ const canonical =
+ typeof finding.alertIdentifier === 'string' ? finding.alertIdentifier.trim() : '';
return canonical || undefined;
};
diff --git a/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts b/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts
index 72955e1320..509a7cb05b 100644
--- a/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts
+++ b/frontend-modern/src/utils/infrastructureOnboardingPresentation.ts
@@ -35,15 +35,7 @@ export interface InfrastructureSourceManagerProductPresentation extends Infrastr
}
export type InfrastructureSourcePickerItemId =
- | 'vmware'
- | 'pve'
- | 'truenas'
- | 'unraid'
- | 'pbs'
- | 'pmg'
- | 'linux-host'
- | 'docker'
- | 'kubernetes';
+ 'vmware' | 'pve' | 'truenas' | 'unraid' | 'pbs' | 'pmg' | 'linux-host' | 'docker' | 'kubernetes';
export type InfrastructureSourcePickerRouteStep = InfrastructureSourcePickerItemId;
diff --git a/frontend-modern/src/utils/infrastructureSummaryCache.ts b/frontend-modern/src/utils/infrastructureSummaryCache.ts
index dd33a52326..f1547d93db 100644
--- a/frontend-modern/src/utils/infrastructureSummaryCache.ts
+++ b/frontend-modern/src/utils/infrastructureSummaryCache.ts
@@ -15,7 +15,15 @@ export const INFRA_SUMMARY_CACHE_MAX_AGE_MS = 5 * 60_000;
const INFRA_SUMMARY_CACHE_VERSION = 5;
const INFRA_SUMMARY_CACHE_MAX_CHARS = 900_000;
const INFRA_SUMMARY_CACHE_MAX_POINTS_PER_SERIES = 360;
-const DEFAULT_INFRA_SUMMARY_METRICS = ['cpu', 'memory', 'disk', 'diskread', 'diskwrite', 'netin', 'netout'] as const;
+const DEFAULT_INFRA_SUMMARY_METRICS = [
+ 'cpu',
+ 'memory',
+ 'disk',
+ 'diskread',
+ 'diskwrite',
+ 'netin',
+ 'netout',
+] as const;
type NormalizedInfrastructureSummaryMetrics = readonly InfrastructureSummaryMetric[];
const INFRA_SUMMARY_PERF_LOG_PREFIX = '[InfraSummaryPerf]';
@@ -331,7 +339,7 @@ export function fetchInfrastructureSummaryAndCache(
const requestId = ++infraSummaryFetchSeq;
const startedAt = infraSummaryPerfNow();
- infraSummaryPerfLog('fetch start', { caller, range, orgScope, requestId });
+ infraSummaryPerfLog('fetch start', { caller, range, orgScope, requestId });
const request = ChartsAPI.getInfrastructureSummaryCharts(range, undefined, {
metrics: [...normalizedMetrics],
@@ -343,7 +351,13 @@ export function fetchInfrastructureSummaryAndCache(
Number.isFinite(response.stats.oldestDataTimestamp)
? response.stats.oldestDataTimestamp
: null;
- persistInfrastructureSummaryCache(range, map, oldestDataTimestamp, orgScope, normalizedMetrics);
+ persistInfrastructureSummaryCache(
+ range,
+ map,
+ oldestDataTimestamp,
+ orgScope,
+ normalizedMetrics,
+ );
infraSummaryPerfLog('fetch done', {
caller,
diff --git a/frontend-modern/src/utils/licensePresentation.ts b/frontend-modern/src/utils/licensePresentation.ts
index cdf715b97d..79e3f99265 100644
--- a/frontend-modern/src/utils/licensePresentation.ts
+++ b/frontend-modern/src/utils/licensePresentation.ts
@@ -1092,8 +1092,7 @@ export const getCommercialMigrationNotice = (
'Pulse detected a paid v5 license, but that key was rejected during v6 migration. Retrieve your current key at pulserelay.pro/retrieve-license if this purchase is still active.';
break;
case 'exchange_stale_key':
- body =
- 'Pulse detected a paid v5 license, but this key has been superseded by a renewal.';
+ body = 'Pulse detected a paid v5 license, but this key has been superseded by a renewal.';
break;
case 'exchange_malformed':
body = 'Pulse detected a v5-looking key, but it is malformed and cannot be migrated.';
diff --git a/frontend-modern/src/utils/metricsKeys.ts b/frontend-modern/src/utils/metricsKeys.ts
index 44f48811ab..c27ce7b84a 100644
--- a/frontend-modern/src/utils/metricsKeys.ts
+++ b/frontend-modern/src/utils/metricsKeys.ts
@@ -8,13 +8,7 @@
import type { Resource } from '@/types/resource';
export type MetricResourceKind =
- | 'node'
- | 'vm'
- | 'container'
- | 'agent'
- | 'dockerHost'
- | 'dockerContainer'
- | 'k8s';
+ 'node' | 'vm' | 'container' | 'agent' | 'dockerHost' | 'dockerContainer' | 'k8s';
/**
* Build a namespaced metric key for a resource
diff --git a/frontend-modern/src/utils/monitoredSystemPresentation.ts b/frontend-modern/src/utils/monitoredSystemPresentation.ts
index a09a246089..9873c75cca 100644
--- a/frontend-modern/src/utils/monitoredSystemPresentation.ts
+++ b/frontend-modern/src/utils/monitoredSystemPresentation.ts
@@ -105,8 +105,7 @@ const normalizeImpactPreviewCount = (count: number | null | undefined): number =
const formatImpactPreviewCount = (count: number): string =>
`${count} monitored ${count === 1 ? 'system' : 'systems'}`;
-const formatImpactPreviewDelta = (delta: number): string =>
- delta > 0 ? `+${delta}` : `${delta}`;
+const formatImpactPreviewDelta = (delta: number): string => (delta > 0 ? `+${delta}` : `${delta}`);
export function getMonitoredSystemLedgerPresentation() {
return MONITORED_SYSTEM_LEDGER_PRESENTATION;
diff --git a/frontend-modern/src/utils/organizationSettingsPresentation.ts b/frontend-modern/src/utils/organizationSettingsPresentation.ts
index 659c2a589e..03c4abeac3 100644
--- a/frontend-modern/src/utils/organizationSettingsPresentation.ts
+++ b/frontend-modern/src/utils/organizationSettingsPresentation.ts
@@ -6,11 +6,7 @@ export const ORGANIZATION_SETTINGS_UNAVAILABLE_MESSAGE =
export const ORGANIZATION_SETTINGS_UNAVAILABLE_CLASS = 'p-4 text-sm text-slate-500';
export type OrganizationSettingsLoadContext =
- | 'access'
- | 'overview'
- | 'sharing'
- | 'billing'
- | 'billing-admin';
+ 'access' | 'overview' | 'sharing' | 'billing' | 'billing-admin';
const ORGANIZATION_SETTINGS_LOAD_FALLBACKS: Record<OrganizationSettingsLoadContext, string> = {
access: 'Unable to load organization access settings.',
diff --git a/frontend-modern/src/utils/patrolEmptyStatePresentation.ts b/frontend-modern/src/utils/patrolEmptyStatePresentation.ts
index a9a3ae17a6..33a41625f6 100644
--- a/frontend-modern/src/utils/patrolEmptyStatePresentation.ts
+++ b/frontend-modern/src/utils/patrolEmptyStatePresentation.ts
@@ -71,8 +71,7 @@ type PatrolRunSnapshotEmptyStateArgs = Pick<
| 'error_count'
>;
-const DEGRADED_COVERAGE_EMPTY_STATE_BODY =
- 'Run Patrol to check everything and refresh open work.';
+const DEGRADED_COVERAGE_EMPTY_STATE_BODY = 'Run Patrol to check everything and refresh open work.';
const DEGRADED_HEALTH_EMPTY_STATE_BODY =
'No current issues are listed, but Patrol health needs review.';
const HISTORICAL_REGRESSION_EMPTY_STATE_BODY = 'Past issues are in History if you need the record.';
@@ -140,9 +139,7 @@ function hasHistoricalRegressions(count: number | undefined): boolean {
return typeof count === 'number' && Number.isFinite(count) && count > 0;
}
-function getLatestRunCoverageContext(
- runs: PatrolRunRecord[] | undefined,
-): string | undefined {
+function getLatestRunCoverageContext(runs: PatrolRunRecord[] | undefined): string | undefined {
if (!runs || runs.length === 0) {
return undefined;
}
diff --git a/frontend-modern/src/utils/rbacPresentation.ts b/frontend-modern/src/utils/rbacPresentation.ts
index e26bf0c8f8..fafbd8ea8a 100644
--- a/frontend-modern/src/utils/rbacPresentation.ts
+++ b/frontend-modern/src/utils/rbacPresentation.ts
@@ -39,8 +39,7 @@ export function getRBACFeatureGateCopy(
export function getUserAssignmentsEmptyStateCopy(): UserAssignmentsEmptyStateCopy {
return {
title: 'No users yet',
- body:
- "Users appear here automatically when they sign in via SSO (OIDC/SAML) or proxy authentication. Once they've logged in, you can assign roles to control their access.",
+ body: "Users appear here automatically when they sign in via SSO (OIDC/SAML) or proxy authentication. Once they've logged in, you can assign roles to control their access.",
ssoHint: 'Configure SSO in Security settings',
syncHint: 'Users sync on first login',
};
diff --git a/frontend-modern/src/utils/recoveryItemTypePresentation.ts b/frontend-modern/src/utils/recoveryItemTypePresentation.ts
index 377db5c1d5..cefcb59be6 100644
--- a/frontend-modern/src/utils/recoveryItemTypePresentation.ts
+++ b/frontend-modern/src/utils/recoveryItemTypePresentation.ts
@@ -27,9 +27,7 @@ interface RecoveryItemTypeLike {
subjectRef?: RecoveryExternalRef | null;
}
-const getRecoveryItemTypeValue = (
- value: RecoveryItemTypeLike | null | undefined,
-): string =>
+const getRecoveryItemTypeValue = (value: RecoveryItemTypeLike | null | undefined): string =>
String(
value?.display?.itemType ||
value?.display?.subjectType ||
@@ -38,10 +36,10 @@ const getRecoveryItemTypeValue = (
'',
);
-export const normalizeRecoveryItemTypeQueryValue = (
- value: string | null | undefined,
-): string => {
- const normalized = String(value || '').trim().toLowerCase();
+export const normalizeRecoveryItemTypeQueryValue = (value: string | null | undefined): string => {
+ const normalized = String(value || '')
+ .trim()
+ .toLowerCase();
switch (normalized) {
case '':
case 'all':
diff --git a/frontend-modern/src/utils/recoveryPlatformModel.ts b/frontend-modern/src/utils/recoveryPlatformModel.ts
index 11f4a0d642..f320e74514 100644
--- a/frontend-modern/src/utils/recoveryPlatformModel.ts
+++ b/frontend-modern/src/utils/recoveryPlatformModel.ts
@@ -12,8 +12,7 @@ import type {
RecoveryRollupsTransportResponse,
} from '@/types/recovery';
-const toTrimmedString = (value: unknown): string =>
- typeof value === 'string' ? value.trim() : '';
+const toTrimmedString = (value: unknown): string => (typeof value === 'string' ? value.trim() : '');
interface RecoveryPointPlatformLike {
platform?: string | null;
@@ -58,9 +57,8 @@ const normalizeRecoveryDisplay = (
};
};
-const getRecoveryItemResourceId = (
- value: RecoveryItemResourceLike | null | undefined,
-): string => toTrimmedString(value?.itemResourceId) || toTrimmedString(value?.subjectResourceId);
+const getRecoveryItemResourceId = (value: RecoveryItemResourceLike | null | undefined): string =>
+ toTrimmedString(value?.itemResourceId) || toTrimmedString(value?.subjectResourceId);
const getRecoveryItemRef = (
value: RecoveryItemRefLike | null | undefined,
@@ -81,7 +79,9 @@ export const getRecoveryRollupPlatforms = (
return values.map((value) => toTrimmedString(value)).filter(Boolean);
};
-const normalizeRecoveryMeta = (meta: RecoveryResponseMeta | null | undefined): RecoveryResponseMeta => {
+const normalizeRecoveryMeta = (
+ meta: RecoveryResponseMeta | null | undefined,
+): RecoveryResponseMeta => {
const page = typeof meta?.page === 'number' && Number.isFinite(meta.page) ? meta.page : 1;
const limit = typeof meta?.limit === 'number' && Number.isFinite(meta.limit) ? meta.limit : 0;
const total = typeof meta?.total === 'number' && Number.isFinite(meta.total) ? meta.total : 0;
diff --git a/frontend-modern/src/utils/reportableResourceTypes.ts b/frontend-modern/src/utils/reportableResourceTypes.ts
index 14e07c63f0..81451da290 100644
--- a/frontend-modern/src/utils/reportableResourceTypes.ts
+++ b/frontend-modern/src/utils/reportableResourceTypes.ts
@@ -1,11 +1,7 @@
import type { Resource, ResourceType } from '@/types/resource';
export type ResourcePickerTypeFilter =
- | 'all'
- | 'infrastructure'
- | 'workloads'
- | 'storage'
- | 'recovery';
+ 'all' | 'infrastructure' | 'workloads' | 'storage' | 'recovery';
const RESOURCE_PICKER_TYPE_FILTER_LABELS: Record<ResourcePickerTypeFilter, string> = {
all: 'All',
diff --git a/frontend-modern/src/utils/reportingPresentation.ts b/frontend-modern/src/utils/reportingPresentation.ts
index 3904853fcb..f7bc47a491 100644
--- a/frontend-modern/src/utils/reportingPresentation.ts
+++ b/frontend-modern/src/utils/reportingPresentation.ts
@@ -22,10 +22,7 @@ export function getReportingInventoryExportErrorMessage(): string {
return 'Failed to generate VM inventory export';
}
-export function formatReportingFilenameDate(
- date: Date,
- style: 'utc_yyyymmdd',
-): string {
+export function formatReportingFilenameDate(date: Date, style: 'utc_yyyymmdd'): string {
const year = date.getUTCFullYear();
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
const day = String(date.getUTCDate()).padStart(2, '0');
diff --git a/frontend-modern/src/utils/resourceAssistantContextModel.ts b/frontend-modern/src/utils/resourceAssistantContextModel.ts
index a1173c9b04..a6dfc3d9d3 100644
--- a/frontend-modern/src/utils/resourceAssistantContextModel.ts
+++ b/frontend-modern/src/utils/resourceAssistantContextModel.ts
@@ -1,5 +1,9 @@
import type { AIChatContext } from '@/stores/aiChat';
-import type { Resource, ResourceDiscoveryReadiness, ResourceDiscoveryTarget } from '@/types/resource';
+import type {
+ Resource,
+ ResourceDiscoveryReadiness,
+ ResourceDiscoveryTarget,
+} from '@/types/resource';
import {
formatDiscoveryReadinessBriefingLine,
getDiscoveryReadinessPresentation,
diff --git a/frontend-modern/src/utils/resourceBadgePresentation.ts b/frontend-modern/src/utils/resourceBadgePresentation.ts
index 4bd25e8cb6..8aa8199f36 100644
--- a/frontend-modern/src/utils/resourceBadgePresentation.ts
+++ b/frontend-modern/src/utils/resourceBadgePresentation.ts
@@ -463,8 +463,7 @@ const getAvailabilitySystemIdentityBadge = (
): ResourceBadge | null => {
const availability = (asRecord(platformData?.availability) ||
asRecord(getResourceRecord(resource).availability)) as
- | { address?: string; protocol?: string; port?: number }
- | undefined;
+ { address?: string; protocol?: string; port?: number } | undefined;
const isAvailabilityEndpoint =
resource.type === 'network-endpoint' ||
Boolean(availability) ||
@@ -632,8 +631,7 @@ export function getInfrastructureSystemIdentityBadges(resource: Resource): Resou
}
const platformData = getPlatformDataRecord(resource) as
- | (Record<string, unknown> & { sources?: string[] })
- | undefined;
+ (Record<string, unknown> & { sources?: string[] }) | undefined;
const explicitSources = Array.isArray(resource.sources) ? resource.sources : [];
const rawSources =
explicitSources.length > 0
diff --git a/frontend-modern/src/utils/resourceChangePresentation.ts b/frontend-modern/src/utils/resourceChangePresentation.ts
index dd2dc03057..8852fe043e 100644
--- a/frontend-modern/src/utils/resourceChangePresentation.ts
+++ b/frontend-modern/src/utils/resourceChangePresentation.ts
@@ -96,11 +96,7 @@ const RESOURCE_CHANGE_KIND_PRESENTATIONS: Record<
};
type ResourceChangeSourceType =
- | 'platform_event'
- | 'pulse_diff'
- | 'heuristic'
- | 'user_action'
- | 'agent_action';
+ 'platform_event' | 'pulse_diff' | 'heuristic' | 'user_action' | 'agent_action';
export const RESOURCE_CHANGE_SOURCE_TYPE_ORDER: ResourceChangeSourceType[] = [
'platform_event',
diff --git a/frontend-modern/src/utils/resourceDiscoveryReadiness.ts b/frontend-modern/src/utils/resourceDiscoveryReadiness.ts
index c9ae83f501..b9de0282ff 100644
--- a/frontend-modern/src/utils/resourceDiscoveryReadiness.ts
+++ b/frontend-modern/src/utils/resourceDiscoveryReadiness.ts
@@ -1,8 +1,5 @@
import { formatDiscoveryAge } from '@/api/discovery';
-import type {
- ResourceDiscoveryReadiness,
- ResourceDiscoveryReadinessState,
-} from '@/types/resource';
+import type { ResourceDiscoveryReadiness, ResourceDiscoveryReadinessState } from '@/types/resource';
export type DiscoveryReadinessTone = 'success' | 'warning' | 'info' | 'danger' | 'muted';
diff --git a/frontend-modern/src/utils/routeStateNavigation.ts b/frontend-modern/src/utils/routeStateNavigation.ts
index 01f1985156..dbabd87f67 100644
--- a/frontend-modern/src/utils/routeStateNavigation.ts
+++ b/frontend-modern/src/utils/routeStateNavigation.ts
@@ -16,8 +16,7 @@ export const markRouteStateDeliberateScroll = (now = Date.now()): void => {
);
};
-const resolvePathname = (path: string): string =>
- new URL(path, window.location.origin).pathname;
+const resolvePathname = (path: string): string => new URL(path, window.location.origin).pathname;
const isSamePathnameNavigation = (currentPath: string, targetPath: string): boolean =>
resolvePathname(currentPath) === resolvePathname(targetPath);
diff --git a/frontend-modern/src/utils/searchQuery.ts b/frontend-modern/src/utils/searchQuery.ts
index 975339d0c4..1e35627720 100644
--- a/frontend-modern/src/utils/searchQuery.ts
+++ b/frontend-modern/src/utils/searchQuery.ts
@@ -39,14 +39,7 @@ export type LogicalOperator = 'AND' | 'OR';
export interface MetricCondition {
field:
- | 'cpu'
- | 'memory'
- | 'disk'
- | 'diskRead'
- | 'diskWrite'
- | 'networkIn'
- | 'networkOut'
- | 'uptime';
+ 'cpu' | 'memory' | 'disk' | 'diskRead' | 'diskWrite' | 'networkIn' | 'networkOut' | 'uptime';
operator: ComparisonOperator;
value: number;
}
diff --git a/frontend-modern/src/utils/securityScorePresentation.ts b/frontend-modern/src/utils/securityScorePresentation.ts
index aef4bb21b1..0549e41392 100644
--- a/frontend-modern/src/utils/securityScorePresentation.ts
+++ b/frontend-modern/src/utils/securityScorePresentation.ts
@@ -46,10 +46,7 @@ export interface SecurityFeatureCardPresentation {
}
export type SecurityHardeningActionKey =
- | 'enable-authentication'
- | 'protect-exports'
- | 'configure-https'
- | 'create-api-token';
+ 'enable-authentication' | 'protect-exports' | 'configure-https' | 'create-api-token';
export interface SecurityHardeningAction {
key: SecurityHardeningActionKey;
@@ -169,7 +166,8 @@ export function getSecurityWarningPresentation(options: {
return `${items.slice(0, -1).join(', ')}, and ${items[items.length - 1]}`;
};
- let message = 'Review the remaining security settings before using this instance for live infrastructure.';
+ let message =
+ 'Review the remaining security settings before using this instance for live infrastructure.';
if (!options.hasAuthentication) {
message =
'Authentication is disabled. Anyone who can reach this Pulse instance can access stored infrastructure credentials.';
@@ -221,9 +219,7 @@ export function getSecurityFeatureStatePresentation(
};
}
-export function getSecurityScoreIconComponent(
- score: number,
-): Component<{ class?: string }> {
+export function getSecurityScoreIconComponent(score: number): Component<{ class?: string }> {
switch (getSecurityScorePresentation(score).icon) {
case 'shield-check':
return ShieldCheck;
@@ -240,8 +236,7 @@ export function getSecurityFeatureCardPresentation(options: {
}): SecurityFeatureCardPresentation {
if (options.enabled) {
return {
- cardClassName:
- 'border-emerald-200 dark:border-emerald-800 bg-emerald-50 dark:bg-emerald-950',
+ cardClassName: 'border-emerald-200 dark:border-emerald-800 bg-emerald-50 dark:bg-emerald-950',
iconClassName: 'text-emerald-500 dark:text-emerald-400',
statusLabel: 'Enabled',
criticalLabelClassName: 'text-emerald-600 dark:text-emerald-400',
@@ -250,8 +245,7 @@ export function getSecurityFeatureCardPresentation(options: {
if (options.critical) {
return {
- cardClassName:
- 'border-rose-200 dark:border-rose-800 bg-rose-50 dark:bg-rose-950',
+ cardClassName: 'border-rose-200 dark:border-rose-800 bg-rose-50 dark:bg-rose-950',
iconClassName: 'text-rose-500 dark:text-rose-400',
statusLabel: 'Disabled',
criticalLabelClassName: 'text-rose-600 dark:text-rose-400',
@@ -356,9 +350,7 @@ export function getSecurityPostureItems(status: SecurityPostureStatus): Security
key: 'export',
label: 'Export protection',
enabled: status.exportProtected && !status.unprotectedExportAllowed,
- description: status.unprotectedExportAllowed
- ? 'Unprotected'
- : 'Token + passphrase required',
+ description: status.unprotectedExportAllowed ? 'Unprotected' : 'Token + passphrase required',
critical: true,
},
{
diff --git a/frontend-modern/src/utils/selfHostedFeatureCatalog.generated.ts b/frontend-modern/src/utils/selfHostedFeatureCatalog.generated.ts
index 1bb3321f03..0d46196fd6 100644
--- a/frontend-modern/src/utils/selfHostedFeatureCatalog.generated.ts
+++ b/frontend-modern/src/utils/selfHostedFeatureCatalog.generated.ts
@@ -2,11 +2,7 @@
// Do not edit it manually.
export type SelfHostedFeatureRole =
- | 'hidden'
- | 'included'
- | 'primary_pillar'
- | 'included_extra'
- | 'compatibility_only';
+ 'hidden' | 'included' | 'primary_pillar' | 'included_extra' | 'compatibility_only';
export interface GeneratedSelfHostedFeatureCatalogEntry {
key: string;
@@ -28,350 +24,354 @@ export interface GeneratedSelfHostedFeatureCatalogEntry {
export const SELF_HOSTED_FEATURE_CATALOG: readonly GeneratedSelfHostedFeatureCatalogEntry[] = [
{
- "key": "update_alerts",
- "displayName": "Update Alerts (Container/Package Updates)",
- "comparisonName": "Update Alerts",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "included",
- "relay": "included",
- "pro": "included"
- },
- "includedIn": {
- "community": true,
- "relay": true,
- "pro": true
- }
+ key: 'update_alerts',
+ displayName: 'Update Alerts (Container/Package Updates)',
+ comparisonName: 'Update Alerts',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'included',
+ relay: 'included',
+ pro: 'included',
+ },
+ includedIn: {
+ community: true,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "sso",
- "displayName": "Core SSO (OIDC/SAML)",
- "comparisonName": "Core SSO (OIDC/SAML)",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "included",
- "relay": "included",
- "pro": "included"
- },
- "includedIn": {
- "community": true,
- "relay": true,
- "pro": true
- }
+ key: 'sso',
+ displayName: 'Core SSO (OIDC/SAML)',
+ comparisonName: 'Core SSO (OIDC/SAML)',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'included',
+ relay: 'included',
+ pro: 'included',
+ },
+ includedIn: {
+ community: true,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "ai_patrol",
- "displayName": "Pulse Patrol (Background Health Checks)",
- "comparisonName": "Pulse Patrol",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "included",
- "relay": "included",
- "pro": "included"
- },
- "includedIn": {
- "community": true,
- "relay": true,
- "pro": true
- }
+ key: 'ai_patrol',
+ displayName: 'Pulse Patrol (Background Health Checks)',
+ comparisonName: 'Pulse Patrol',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'included',
+ relay: 'included',
+ pro: 'included',
+ },
+ includedIn: {
+ community: true,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "relay",
- "displayName": "Pulse Relay (Remote Access)",
- "comparisonName": "Pulse Relay (Remote Access)",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "primary_pillar",
- "pro": "included"
- },
- "includedIn": {
- "community": false,
- "relay": true,
- "pro": true
- }
+ key: 'relay',
+ displayName: 'Pulse Relay (Remote Access)',
+ comparisonName: 'Pulse Relay (Remote Access)',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'primary_pillar',
+ pro: 'included',
+ },
+ includedIn: {
+ community: false,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "mobile_app",
- "displayName": "Pulse Mobile Pairing",
- "comparisonName": "Pulse Mobile Pairing",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "primary_pillar",
- "pro": "included"
- },
- "includedIn": {
- "community": false,
- "relay": true,
- "pro": true
- }
+ key: 'mobile_app',
+ displayName: 'Pulse Mobile Pairing',
+ comparisonName: 'Pulse Mobile Pairing',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'primary_pillar',
+ pro: 'included',
+ },
+ includedIn: {
+ community: false,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "push_notifications",
- "displayName": "Push Notifications",
- "comparisonName": "Push Notifications",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "primary_pillar",
- "pro": "included"
- },
- "includedIn": {
- "community": false,
- "relay": true,
- "pro": true
- }
+ key: 'push_notifications',
+ displayName: 'Push Notifications',
+ comparisonName: 'Push Notifications',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'primary_pillar',
+ pro: 'included',
+ },
+ includedIn: {
+ community: false,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "ai_alerts",
- "displayName": "Patrol Investigates Issues and Explains the Root Cause",
- "comparisonName": "Patrol Investigates Issues and Explains the Root Cause",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "primary_pillar"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": true
- }
+ key: 'ai_alerts',
+ displayName: 'Patrol Investigates Issues and Explains the Root Cause',
+ comparisonName: 'Patrol Investigates Issues and Explains the Root Cause',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'primary_pillar',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: true,
+ },
},
{
- "key": "ai_autofix",
- "displayName": "Patrol Applies Safe Fixes and Verifies the Result",
- "comparisonName": "Patrol Applies Safe Fixes and Verifies the Result",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "primary_pillar"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": true
- }
+ key: 'ai_autofix',
+ displayName: 'Patrol Applies Safe Fixes and Verifies the Result',
+ comparisonName: 'Patrol Applies Safe Fixes and Verifies the Result',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'primary_pillar',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: true,
+ },
},
{
- "key": "long_term_metrics",
- "displayName": "Extended Metric History",
- "comparisonName": "Extended Metric History",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "primary_pillar",
- "pro": "primary_pillar"
- },
- "includedIn": {
- "community": false,
- "relay": true,
- "pro": true
- }
+ key: 'long_term_metrics',
+ displayName: 'Extended Metric History',
+ comparisonName: 'Extended Metric History',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'primary_pillar',
+ pro: 'primary_pillar',
+ },
+ includedIn: {
+ community: false,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "advanced_sso",
- "displayName": "Multi-Provider SSO",
- "comparisonName": "Multi-Provider SSO",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": false,
- "roles": {
- "community": "included",
- "relay": "included",
- "pro": "included"
- },
- "includedIn": {
- "community": true,
- "relay": true,
- "pro": true
- }
+ key: 'advanced_sso',
+ displayName: 'Multi-Provider SSO',
+ comparisonName: 'Multi-Provider SSO',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: false,
+ roles: {
+ community: 'included',
+ relay: 'included',
+ pro: 'included',
+ },
+ includedIn: {
+ community: true,
+ relay: true,
+ pro: true,
+ },
},
{
- "key": "rbac",
- "displayName": "Role-Based Access Control (RBAC)",
- "comparisonName": "Role-Based Access Control (RBAC)",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "included_extra"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": true
- }
+ key: 'rbac',
+ displayName: 'Role-Based Access Control (RBAC)',
+ comparisonName: 'Role-Based Access Control (RBAC)',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'included_extra',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: true,
+ },
},
{
- "key": "audit_logging",
- "displayName": "Audit Logging",
- "comparisonName": "Audit Logging",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "included_extra"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": true
- }
+ key: 'audit_logging',
+ displayName: 'Audit Logging',
+ comparisonName: 'Audit Logging',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'included_extra',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: true,
+ },
},
{
- "key": "advanced_reporting",
- "displayName": "PDF/CSV Reporting",
- "comparisonName": "PDF/CSV Reporting",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "included_extra"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": true
- }
+ key: 'advanced_reporting',
+ displayName: 'PDF/CSV Reporting',
+ comparisonName: 'PDF/CSV Reporting',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'included_extra',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: true,
+ },
},
{
- "key": "agent_profiles",
- "displayName": "Centralized Agent Profiles",
- "comparisonName": "Centralized Agent Profiles",
- "showInComparisonTable": true,
- "displayableInSelfHostedPlan": true,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "included_extra"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": true
- }
+ key: 'agent_profiles',
+ displayName: 'Centralized Agent Profiles',
+ comparisonName: 'Centralized Agent Profiles',
+ showInComparisonTable: true,
+ displayableInSelfHostedPlan: true,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'included_extra',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: true,
+ },
},
{
- "key": "kubernetes_ai",
- "displayName": "Kubernetes AI Analysis (Compatibility)",
- "comparisonName": "Kubernetes AI Analysis (Compatibility)",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": false,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "compatibility_only"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": true
- }
+ key: 'kubernetes_ai',
+ displayName: 'Kubernetes AI Analysis (Compatibility)',
+ comparisonName: 'Kubernetes AI Analysis (Compatibility)',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: false,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'compatibility_only',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: true,
+ },
},
{
- "key": "multi_user",
- "displayName": "Multi-User Mode",
- "comparisonName": "Multi-User Mode",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": false,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "hidden"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": false
- }
+ key: 'multi_user',
+ displayName: 'Multi-User Mode',
+ comparisonName: 'Multi-User Mode',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: false,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'hidden',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: false,
+ },
},
{
- "key": "white_label",
- "displayName": "White-Label Branding",
- "comparisonName": "White-Label Branding",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": false,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "hidden"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": false
- }
+ key: 'white_label',
+ displayName: 'White-Label Branding',
+ comparisonName: 'White-Label Branding',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: false,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'hidden',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: false,
+ },
},
{
- "key": "multi_tenant",
- "displayName": "Multi-Tenant Mode",
- "comparisonName": "Multi-Tenant Mode",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": false,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "hidden"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": false
- }
+ key: 'multi_tenant',
+ displayName: 'Multi-Tenant Mode',
+ comparisonName: 'Multi-Tenant Mode',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: false,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'hidden',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: false,
+ },
},
{
- "key": "unlimited",
- "displayName": "Hosted Capacity Policy",
- "comparisonName": "Hosted Capacity Policy",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": false,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "hidden"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": false
- }
+ key: 'unlimited',
+ displayName: 'Hosted Capacity Policy',
+ comparisonName: 'Hosted Capacity Policy',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: false,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'hidden',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: false,
+ },
},
{
- "key": "demo_fixtures",
- "displayName": "Demo Fixtures (Internal)",
- "comparisonName": "Demo Fixtures (Internal)",
- "showInComparisonTable": false,
- "displayableInSelfHostedPlan": false,
- "roles": {
- "community": "hidden",
- "relay": "hidden",
- "pro": "hidden"
- },
- "includedIn": {
- "community": false,
- "relay": false,
- "pro": false
- }
- }
+ key: 'demo_fixtures',
+ displayName: 'Demo Fixtures (Internal)',
+ comparisonName: 'Demo Fixtures (Internal)',
+ showInComparisonTable: false,
+ displayableInSelfHostedPlan: false,
+ roles: {
+ community: 'hidden',
+ relay: 'hidden',
+ pro: 'hidden',
+ },
+ includedIn: {
+ community: false,
+ relay: false,
+ pro: false,
+ },
+ },
] as const;
-export const SELF_HOSTED_FEATURE_CATALOG_BY_KEY: Record<string, GeneratedSelfHostedFeatureCatalogEntry> = Object.fromEntries(
- SELF_HOSTED_FEATURE_CATALOG.map((entry) => [entry.key, entry]),
-) as Record<string, GeneratedSelfHostedFeatureCatalogEntry>;
+export const SELF_HOSTED_FEATURE_CATALOG_BY_KEY: Record<
+ string,
+ GeneratedSelfHostedFeatureCatalogEntry
+> = Object.fromEntries(SELF_HOSTED_FEATURE_CATALOG.map((entry) => [entry.key, entry])) as Record<
+ string,
+ GeneratedSelfHostedFeatureCatalogEntry
+>;
export function getSelfHostedFeatureCatalogEntry(
key?: string | null,
diff --git a/frontend-modern/src/utils/storageSources.ts b/frontend-modern/src/utils/storageSources.ts
index d4aa8f79b7..cfd89c6c25 100644
--- a/frontend-modern/src/utils/storageSources.ts
+++ b/frontend-modern/src/utils/storageSources.ts
@@ -3,14 +3,7 @@ import { getAllFilterOptionLabel } from '@/components/shared/filterOptionPresent
import { getSourcePlatformLabel, normalizeSourcePlatformKey } from '@/utils/sourcePlatforms';
import { titleCaseDelimitedLabel } from '@/utils/textPresentation';
-export type StorageSourceTone =
- | 'slate'
- | 'orange'
- | 'indigo'
- | 'rose'
- | 'teal'
- | 'cyan'
- | 'blue';
+export type StorageSourceTone = 'slate' | 'orange' | 'indigo' | 'rose' | 'teal' | 'cyan' | 'blue';
export interface StorageSourceOption {
key: string;
diff --git a/frontend-modern/src/utils/textPresentation.ts b/frontend-modern/src/utils/textPresentation.ts
index 76141e4cee..c8790f33be 100644
--- a/frontend-modern/src/utils/textPresentation.ts
+++ b/frontend-modern/src/utils/textPresentation.ts
@@ -21,19 +21,18 @@ export function humanizeToken(value?: string, options?: HumanizeTokenOptions): s
return options?.fallback ?? '';
}
- if (options?.preserveShortAllCaps && normalized === normalized.toUpperCase() && normalized.length <= 4) {
+ if (
+ options?.preserveShortAllCaps &&
+ normalized === normalized.toUpperCase() &&
+ normalized.length <= 4
+ ) {
return normalized;
}
- return normalized
- .replace(/_/g, ' ')
- .replace(/\b\w/g, (char) => char.toUpperCase());
+ return normalized.replace(/_/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase());
}
-export function formatIdentifierLabel(
- value?: string,
- options?: IdentifierLabelOptions,
-): string {
+export function formatIdentifierLabel(value?: string, options?: IdentifierLabelOptions): string {
let normalized = (value || '').trim();
if (!normalized) {
return options?.fallback ?? '';
@@ -55,10 +54,7 @@ export function formatIdentifierLabel(
return label;
}
-export function titleCaseDelimitedLabel(
- value?: string,
- options?: TitleCaseLabelOptions,
-): string {
+export function titleCaseDelimitedLabel(value?: string, options?: TitleCaseLabelOptions): string {
const normalized = (value || '').trim();
if (!normalized) {
return options?.fallback ?? '';
diff --git a/frontend-modern/src/utils/workloadTypePresentation.ts b/frontend-modern/src/utils/workloadTypePresentation.ts
index 958159dff6..87ce30c318 100644
--- a/frontend-modern/src/utils/workloadTypePresentation.ts
+++ b/frontend-modern/src/utils/workloadTypePresentation.ts
@@ -10,11 +10,7 @@ export interface WorkloadTypePresentation {
}
type WorkloadTypePresentationKey =
- | WorkloadType
- | 'system-container'
- | 'app-container'
- | 'agent'
- | 'pod';
+ WorkloadType | 'system-container' | 'app-container' | 'agent' | 'pod';
const PRESENTATION_MAP: Record<WorkloadTypePresentationKey, WorkloadTypePresentation> = {
vm: {
diff --git a/frontend-modern/src/utils/workloadsSummaryCache.ts b/frontend-modern/src/utils/workloadsSummaryCache.ts
index b5d3475d59..86d41c3758 100644
--- a/frontend-modern/src/utils/workloadsSummaryCache.ts
+++ b/frontend-modern/src/utils/workloadsSummaryCache.ts
@@ -41,7 +41,8 @@ type FetchWorkloadsSummaryAndCacheOptions = {
const inMemoryWorkloadCache = new Map<string, WorkloadChartsResponse>();
const inFlightWorkloadFetches = new Map<string, Promise<WorkloadChartsResponse>>();
-const normalizeNodeScope = (nodeScope: string | null | undefined): string => nodeScope?.trim() ?? '';
+const normalizeNodeScope = (nodeScope: string | null | undefined): string =>
+ nodeScope?.trim() ?? '';
const normalizeMaxPoints = (maxPoints: number | null | undefined): number | undefined => {
if (typeof maxPoints !== 'number' || !Number.isFinite(maxPoints) || maxPoints <= 0) {
@@ -50,7 +51,8 @@ const normalizeMaxPoints = (maxPoints: number | null | undefined): number | unde
return Math.round(maxPoints);
};
-const resolveOrgScope = (orgScope?: string | null): string => normalizeOrgScope(orgScope ?? getOrgID());
+const resolveOrgScope = (orgScope?: string | null): string =>
+ normalizeOrgScope(orgScope ?? getOrgID());
const storageCacheKeyFor = (range: TimeRange, nodeScope: string, orgScope: string): string =>
`${WORKLOADS_SUMMARY_CACHE_PREFIX}${encodeURIComponent(orgScope)}::${range}::${encodeURIComponent(nodeScope || '__all__')}`;
@@ -63,7 +65,7 @@ export function workloadsSummaryCacheScopeKey(
return `${WORKLOADS_SUMMARY_CACHE_VERSION}::${resolveOrgScope(orgScope)}::${range}::${normalizeNodeScope(nodeScope)}`;
}
-const trimPoints = <T,>(points: T[] | undefined, max: number): T[] => {
+const trimPoints = <T>(points: T[] | undefined, max: number): T[] => {
if (!points || points.length === 0) return [];
if (points.length <= max) return points;
if (max <= 1) return points.slice(points.length - 1);
@@ -100,7 +102,10 @@ const writeInMemoryWorkloadsSummaryCache = (
response: WorkloadChartsResponse,
): void => {
const scopeKey = workloadsSummaryCacheScopeKey(range, nodeScope, orgScope);
- if (!inMemoryWorkloadCache.has(scopeKey) && inMemoryWorkloadCache.size >= MAX_IN_MEMORY_WORKLOAD_ENTRIES) {
+ if (
+ !inMemoryWorkloadCache.has(scopeKey) &&
+ inMemoryWorkloadCache.size >= MAX_IN_MEMORY_WORKLOAD_ENTRIES
+ ) {
const oldest = inMemoryWorkloadCache.keys().next().value;
if (oldest !== undefined) inMemoryWorkloadCache.delete(oldest);
}
@@ -112,7 +117,9 @@ export function readInMemoryWorkloadsSummaryCache(
nodeScope: string | null | undefined = '',
orgScope?: string | null,
): WorkloadChartsResponse | null {
- return inMemoryWorkloadCache.get(workloadsSummaryCacheScopeKey(range, nodeScope, orgScope)) ?? null;
+ return (
+ inMemoryWorkloadCache.get(workloadsSummaryCacheScopeKey(range, nodeScope, orgScope)) ?? null
+ );
}
export function persistWorkloadsSummaryCache(