Ajustar pestañas y etiquetas de días
This commit is contained in:
+15
-5
@@ -58,14 +58,14 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie
|
||||
);
|
||||
await expect(page.locator('app-tab-indicadores app-plot').first()).toBeVisible();
|
||||
|
||||
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
||||
await page.getByRole('tab', { name: 'Histórico' }).click();
|
||||
await expect(page.locator('app-tab-trazabilidad section.panel')).toHaveCount(9);
|
||||
|
||||
await page.getByRole('tab', { name: 'Datos y definiciones' }).click();
|
||||
await expect(page.locator('app-tab-definiciones details')).toHaveCount(21);
|
||||
|
||||
const list = page.waitForResponse((r) => r.url().includes('/fhir/Patient?'));
|
||||
await page.getByRole('tab', { name: 'Análisis de riesgos' }).click();
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
const bundle = await (await list).json();
|
||||
const patient = bundle.entry.find((e: any) => e.search.mode === 'match').resource;
|
||||
const first = patient.name?.[0]?.text ?? patient.id.slice(0, 10);
|
||||
@@ -85,7 +85,7 @@ test("indicators: the KPIs are the API's MeasureReports, every tab and the patie
|
||||
|
||||
await page.goto('/indicadores/cama');
|
||||
await expect(page.getByRole('tab', { name: 'Indicadores' })).toBeVisible();
|
||||
await page.getByRole('tab', { name: 'Análisis de riesgos' }).click();
|
||||
await page.getByRole('tab', { name: 'Seguimiento' }).click();
|
||||
await page.locator('mat-form-field', { hasText: 'Ventana' }).click();
|
||||
await page.getByRole('option', { name: '12 meses' }).click();
|
||||
const camaRows = page.locator('table.worklist tbody tr');
|
||||
@@ -205,6 +205,16 @@ function captured(domain: string) {
|
||||
const period = (text: string) => text.replace(/, \d{4}-(S[12]|\d{2})$/, ', <periodo>');
|
||||
const kindOf = (types: string[]) => [...new Set(types)].sort().join('+');
|
||||
|
||||
for (const domain of ['cacu', 'cama', 'tea']) {
|
||||
test(`pestañas de indicadores ${domain} tienen nombres únicos`, async ({ page }) => {
|
||||
await page.goto(`/indicadores/${domain}`);
|
||||
await expect(page.getByRole('tab', { name: 'Seguimiento', exact: true })).toHaveCount(1);
|
||||
await expect(page.getByRole('tab', { name: 'Histórico', exact: true })).toHaveCount(1);
|
||||
const labels = await page.getByRole('tab').allTextContents();
|
||||
expect(new Set(labels.map((s) => s.trim())).size).toBe(labels.length);
|
||||
});
|
||||
}
|
||||
|
||||
// CaCu's page is its own (Phase 6); CaMa's and TEA's follow the old one.
|
||||
for (const domain of ['cama', 'tea']) {
|
||||
test(`indicadores ${domain}: the old page's headings, in order, and the same kinds of plots`, async ({
|
||||
@@ -242,7 +252,7 @@ for (const domain of ['cama', 'tea']) {
|
||||
.evaluateAll((els) => els.map((e) => (e as HTMLElement).innerText.trim()));
|
||||
const from = headings.indexOf('Indicadores de oportunidad');
|
||||
expect(headings.slice(from).map(period)).toEqual(
|
||||
old.filter((i) => i.kind !== 'plot').map((i) => period(i.text)),
|
||||
old.filter((i) => i.kind !== 'plot').map((i) => period(domain === 'cama' ? i.text.replace(/^Tiempo de /, 'Días de ') : i.text)),
|
||||
);
|
||||
// Each figure drawn is one of the old kinds (a figure with no data in the period is named).
|
||||
const drawn = await tab
|
||||
@@ -268,7 +278,7 @@ for (const domain of ['cacu', 'cama', 'tea']) {
|
||||
['h2', 'h3', 'plot'].includes(i.kind),
|
||||
);
|
||||
await page.goto(`/indicadores/${domain}`);
|
||||
await page.getByRole('tab', { name: 'Trazabilidad' }).click();
|
||||
await page.getByRole('tab', { name: 'Histórico' }).click();
|
||||
const tab = page.locator('app-tab-trazabilidad');
|
||||
await expect(tab.getByRole('heading', { name: 'Filtros' })).toBeVisible();
|
||||
await expect(tab.locator('app-loading')).toHaveCount(0, { timeout: 5 * 60_000 });
|
||||
|
||||
Reference in New Issue
Block a user