feat(frontend): collapse responding services on the diagnostics page
CI / checks (pull_request) Failing after 12m12s

Failing console services stay visible; responding ones are behind a toggle.
This commit is contained in:
Zakaria
2026-10-23 12:00:10 -04:00
parent f956d977ca
commit 8b166d86d4
2 changed files with 35 additions and 6 deletions
@@ -49,7 +49,9 @@ test('summarises the runtime and lists failing console services first', async ()
expect(screen.getByText('1 not running')).toBeInTheDocument()
expect(screen.getByText('2 / 3')).toBeInTheDocument()
const rows = within(screen.getByRole('region', {name: 'Console services'})).getAllByRole('row')
const consoleServices = screen.getByRole('region', {name: 'Console services'})
const rows = within(consoleServices).getAllByRole('row')
expect(rows).toHaveLength(2)
expect(rows[1]).toHaveTextContent('messaging')
expect(rows[1]).toHaveTextContent('Service is not running (RUNTIME_UNAVAILABLE)')
@@ -59,6 +61,25 @@ test('summarises the runtime and lists failing console services first', async ()
expect(screen.getByText('OIDC single sign-on')).toBeInTheDocument()
})
test('keeps responding console services behind a toggle', async () => {
const user = userEvent.setup()
api.getCloudDiagnostics.mockResolvedValue({
...healthy,
consoleServices: healthy.consoleServices.map((service) => ({...service, runtime: 'reachable', error: null, errorCode: null})),
} satisfies RuntimeDiagnostics)
renderPage()
const consoleServices = await screen.findByRole('region', {name: 'Console services'})
expect(within(consoleServices).getByText('All 2 responding')).toBeInTheDocument()
expect(within(consoleServices).queryByRole('table')).not.toBeInTheDocument()
await user.click(within(consoleServices).getByRole('button', {name: 'Show 2 responding'}))
expect(within(consoleServices).getAllByRole('row')).toHaveLength(3)
await user.click(within(consoleServices).getByRole('button', {name: 'Hide responding'}))
expect(within(consoleServices).queryByRole('table')).not.toBeInTheDocument()
})
test('filters emulated services by console coverage and state', async () => {
const user = userEvent.setup()
api.getCloudDiagnostics.mockResolvedValue(healthy)