Display Windows fixed volumes individually in both fleet views

This commit is contained in:
2026-11-20 08:53:20 +01:00
parent 9c61f8f2eb
commit 04037c7acf
4 changed files with 55 additions and 4 deletions
+17 -2
View File
@@ -48,7 +48,12 @@ test('shows used disk and RAM in GiB and draws the occupied share in red on desk
json: listing(readings.map(([hostname, free, total]) => ({
tenant_id: customer.tenant_id, customer_name: customer.name, asset_id: hostname, agent_id: hostname,
lifecycle: 'current', status: 'online', hostname, ram_available_bytes: free, ram_total_bytes: total,
disk_free_bytes: free, disk_total_bytes: total
disk_free_bytes: free, disk_total_bytes: total,
...(hostname === 'mostly-free' ? { volumes: [
{ name: 'C:', free_bytes: free, total_bytes: total },
{ name: 'D:', free_bytes: 0, total_bytes: 64 * gib },
{ name: 'E:', free_bytes: null, total_bytes: null }
] } : {})
})))
});
return route.fulfill({ status: 404 });
@@ -58,7 +63,11 @@ test('shows used disk and RAM in GiB and draws the occupied share in red on desk
for (const width of [1280, 900, 390]) {
await page.setViewportSize({ width, height: 844 });
for (const label of ['RAM', 'Speicher']) {
const cell = (host: string) => row(host).locator(`[data-label="${label} belegt / gesamt"]`);
const cell = (host: string) => {
const column = row(host).locator(`[data-label="${label} belegt / gesamt"]`);
return host === 'mostly-free' && label === 'Speicher'
? column.locator('.drive-capacity').filter({ hasText: 'C:' }) : column;
};
for (const [host, used, usedGiB] of [['mostly-free', 25, 4], ['all-used', 100, 16], ['all-free', 0, 0]] as const) {
await expect(cell(host)).toContainText(`${usedGiB} / 16 GiB`);
await expect(cell(host).locator('.capacity-caption')).toHaveText(`${used} % belegt`);
@@ -77,6 +86,12 @@ test('shows used disk and RAM in GiB and draws the occupied share in red on desk
await expect(cell(host)).toHaveText(host === 'invalid-total' ? 'Nicht gemeldet' : '– / 16 GiB');
}
}
const drives = row('mostly-free').locator('.drive-capacity');
await expect(drives).toHaveCount(3);
await expect(drives.nth(1)).toContainText('D: 64 / 64 GiB');
await expect(drives.nth(1).getByRole('img', { name: '100 % belegt, 0 % frei' })).toBeVisible();
await expect(drives.nth(2)).toHaveText('E: Nicht gemeldet');
await expect(drives.nth(2).getByRole('img')).toHaveCount(0);
}
});