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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
test(web): protect mobile history focus after row removal
pulse-triage[bot]1be404f2d453
diff --git a/frontend-modern/src/features/alerts/__tests__/AlertHistoryMobileList.test.tsx b/frontend-modern/src/features/alerts/__tests__/AlertHistoryMobileList.test.tsxindex ab1b171d14..5e00659504 100644--- a/frontend-modern/src/features/alerts/__tests__/AlertHistoryMobileList.test.tsx+++ b/frontend-modern/src/features/alerts/__tests__/AlertHistoryMobileList.test.tsx@@ -43,14 +43,16 @@ function createState() {);const closeResourceIncidentPanel = vi.fn(() => setResourceIncidentPanel(null));+ const [groupedAlerts, setGroupedAlerts] = createSignal([+ {+ label: 'Today (August 4th)',+ fullLabel: 'Today, August 4th 2026',+ alerts: [alert],+ },+ ]);+const state = {- groupedAlerts: () => [- {- label: 'Today (August 4th)',- fullLabel: 'Today, August 4th 2026',- alerts: [alert],- },- ],+ groupedAlerts,getIncidentRowKey: () => 'alert-1-row',expandedIncidents,incidentLoading: () => ({}),@@ -81,6 +83,7 @@ function createState() {closeResourceIncidentPanel,openResourceIncidentPanel,state,+ setGroupedAlerts,toggleIncidentTimeline,};}@@ -171,3 +174,29 @@ describe('AlertHistoryMobileList', () => {expect(screen.getByRole('button', { name: 'Resource' })).toHaveFocus();});});++describe('AlertHistoryMobileList changing history', () => {+ it('returns focus to the list when the investigated row disappears', async () => {+ const { closeResourceIncidentPanel, setGroupedAlerts, state } = createState();+ render(() => <AlertHistoryMobileList state={state} />);++ const resourceButton = screen.getByRole('button', { name: 'Resource' });+ resourceButton.focus();+ await fireEvent.click(resourceButton);+ expect(screen.getByRole('dialog', {+ name: 'Resource incidents for pve-production-01',+ })).toBeInTheDocument();++ // A refresh or filter change can remove the originating history card.+ setGroupedAlerts([]);+ expect(resourceButton).not.toBeInTheDocument();+ await fireEvent.keyDown(document, { key: 'Escape' });+ await new Promise<void>((resolve) =>+ requestAnimationFrame(() => requestAnimationFrame(() => resolve())),+ );++ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();+ expect(closeResourceIncidentPanel).toHaveBeenCalledOnce();+ expect(screen.getByTestId('alert-history-mobile-list')).toHaveFocus();+ });+});