T8/T9: TEA Seguimiento and Análisis de riesgo as two components in rebuild's list style

tea-list is replaced by tab-seguimiento-tea and tab-riesgos-tea over one
tea-rows module (params, rows, workbook, export), with Material filters,
cards and pager. The risk list defaults to every child and keeps the
association pairs per row; the focused patient is fetched with the list's
own search. Specs and page cases follow.
This commit is contained in:
2026-12-01 03:55:35 -06:00
parent 48e6c9f390
commit fcb3634fa9
17 changed files with 1219 additions and 990 deletions
+27 -6
View File
@@ -42,7 +42,7 @@ test('tea indicators: every tab loads, and the follow-up list exports to Excel',
await expect(page.locator('app-tab-trazabilidad app-plot').first()).toBeVisible();
await page.getByRole('tab', { name: 'Seguimiento' }).click();
const rows = page.locator('app-tab-seguimiento table tbody tr');
const rows = page.locator('app-tab-seguimiento-tea table tbody tr');
await expect(rows.first().locator('td').first()).toHaveText(/^N-?\d{4}$/);
const name = await downloaded(
page,
@@ -52,8 +52,16 @@ test('tea indicators: every tab loads, and the follow-up list exports to Excel',
expect(name).toMatch(/^tea-seguimiento-/);
await page.getByRole('tab', { name: 'Análisis de riesgo' }).click();
await expect(page.locator('app-tab-riesgos app-tea-list')).toBeVisible();
await expect(page.getByText('Cargando pacientes…')).toHaveCount(0);
const risk = page.locator('app-tab-riesgos-tea');
await expect(
risk.getByRole('heading', { name: 'EEG de los pacientes del periodo' }),
).toBeVisible();
await expect(risk.locator('table.worklist tbody tr').first().locator('td').first()).toHaveText(
/^N-?\d{4}$/,
);
await risk.getByRole('combobox', { name: 'Modelo de asociación' }).click();
await page.getByRole('option', { name: 'Con resultados' }).click();
await expect(risk.getByText('No hay registros para los filtros aplicados.')).toBeVisible();
await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
await expect(page.locator('app-tab-definiciones details')).toHaveCount(measures);
@@ -64,9 +72,9 @@ test('tea patient: the record and the risk page load and export to PDF', async (
const problems = watch(page);
await page.goto('/indicadores/tea');
await page.getByRole('tab', { name: 'Seguimiento' }).click();
const first = page.locator('app-tab-seguimiento table tbody tr').first();
const first = page.locator('app-tab-seguimiento-tea table tbody tr').first();
await expect(first.locator('td').first()).toHaveText(/^N-?\d{4}$/);
await first.getByRole('link', { name: 'Expediente' }).click();
await first.getByRole('link').click();
await expect(page).toHaveURL(/\/indicadores\/tea\/pacientes\/[^/]+$/);
await expect(page.getByRole('heading', { level: 1 })).toBeVisible();
@@ -74,7 +82,20 @@ test('tea patient: the record and the risk page load and export to PDF', async (
const record = await downloaded(page, page.getByRole('button', { name: 'Exportar PDF' }), 'pdf');
expect(record).toMatch(/^tea-seguimiento-/);
await page.getByRole('link', { name: 'Riesgo' }).click();
await page.getByRole('link', { name: 'Regresar a Seguimiento' }).click();
const focused = page.locator('app-tab-seguimiento-tea');
await expect(focused.getByRole('button', { name: 'Ver todos los pacientes' })).toBeVisible();
const focusedRows = focused.locator('table tbody tr');
await expect(focusedRows).toHaveCount(1);
await expect(focusedRows.first().locator('td').nth(4)).toHaveText(
/M-CHAT|Psicología|Neuropediatría|EEG/,
);
await expect(focusedRows.first().locator('td').nth(5)).toHaveText(
/Diagnóstico confirmado|En proceso|Sin TEA/,
);
await focusedRows.first().getByRole('link').click();
await page.getByRole('link', { name: 'Análisis de riesgo' }).click();
await expect(page.getByRole('heading', { name: 'Análisis de riesgo TEA' })).toBeVisible();
await expect(page.locator('app-tea-section').first()).toBeVisible();
expect(await downloaded(page, page.getByRole('button', { name: 'Exportar PDF' }), 'pdf')).toMatch(