');
+ expect(source).toMatch(/
]*class="space-y-4"/);
expect(source).toContain('
{
expect(vmwarePageSurfaceSource).not.toContain(' {
@@ -270,5 +283,17 @@ describe('platform overview layout guardrails', () => {
/getPlatformTableHeadClassForKind\('numeric-value'\)[\s\S]{0,200}?VMs/,
);
expect(vsphereHostsTableSource).toContain('hidden md:table-cell');
+ expect(agentsMachinesTableSource).toMatch(
+ /getPlatformTableHeadClassForKind\('name'\)[\s\S]{0,200}?Machine/,
+ );
+ expect(agentsMachinesTableSource).toMatch(
+ /getPlatformTableHeadClassForKind\('metric-bar'\)[\s\S]{0,200}?CPU/,
+ );
+ expect(agentsMachinesTableSource).toMatch(
+ /getPlatformTableHeadClassForKind\('metric-bar'\)[\s\S]{0,200}?Memory/,
+ );
+ expect(agentsMachinesTableSource).toMatch(
+ /getPlatformTableHeadClassForKind\('metric-bar'\)[\s\S]{0,200}?Disk/,
+ );
});
});
diff --git a/frontend-modern/src/features/platformPage/__tests__/platformResourceTableDrawers.test.tsx b/frontend-modern/src/features/platformPage/__tests__/platformResourceTableDrawers.test.tsx
index d1abad270e..b42f8af172 100644
--- a/frontend-modern/src/features/platformPage/__tests__/platformResourceTableDrawers.test.tsx
+++ b/frontend-modern/src/features/platformPage/__tests__/platformResourceTableDrawers.test.tsx
@@ -2,6 +2,7 @@ import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
import { afterEach, describe, expect, it, vi } from 'vitest';
import type { Resource } from '@/types/resource';
+import { AgentsMachinesTable } from '@/features/agents/AgentsMachinesTable';
import { KubernetesClustersTable } from '@/features/kubernetes/KubernetesClustersTable';
import { KubernetesNodesTable } from '@/features/kubernetes/KubernetesNodesTable';
import { TrueNASStorageTopologyTable } from '@/features/truenas/TrueNASStorageTopologyTable';
@@ -34,6 +35,10 @@ vi.mock('@/components/Workloads/StackedMemoryBar', () => ({
StackedMemoryBar: () => ,
}));
+vi.mock('@/components/Workloads/StackedDiskBar', () => ({
+ StackedDiskBar: () => ,
+}));
+
const makeResource = ({
id,
type,
@@ -82,6 +87,37 @@ afterEach(() => {
});
describe('platform resource table drawers', () => {
+ it('opens canonical resource details from Agent machine rows', async () => {
+ const machine = makeResource({
+ id: 'agent:mac-mini',
+ type: 'agent',
+ name: 'mac-mini',
+ platformType: 'agent',
+ sourceType: 'agent',
+ agent: {
+ hostname: 'mac-mini.local',
+ osName: 'macOS',
+ osVersion: '15.2',
+ agentVersion: '6.0.0',
+ platform: 'darwin',
+ uptimeSeconds: 96_000,
+ },
+ });
+
+ render(() => (
+ }
+ emptyTitle="No machines"
+ emptyDescription="No machines"
+ />
+ ));
+
+ const row = screen.getByText('mac-mini').closest('tr');
+ expect(row).toBeTruthy();
+ await expectRowOpensResourceDrawer(row!, machine.id);
+ });
+
it('opens canonical resource details from TrueNAS system rows', async () => {
const system = makeResource({
id: 'agent:truenas-main',