style(indicadores): cards with a value don't say "Disponible"
How: the KPI card renders its state line only when the state is not
"Disponible"; a card with a value shows the value, unit, period and its one-line
description. Every other state ("Dato oculto por tamaño", "Selección no
consolidable", "Indicador no disponible"...) still shows, as a status message.
Implications: applies to every domain's cards. kpiResult still returns
"Disponible", so TEA's summary paragraph and any logic reading the state are
unchanged; only the card's text changes.
This commit is contained in:
@@ -28,7 +28,8 @@ import { KpiIntervalo } from './indicadores-kpi';
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@if (temporalReference) { <p>{{ temporalReference }}</p> }
|
@if (temporalReference) { <p>{{ temporalReference }}</p> }
|
||||||
<p class="kpi-state" role="status">{{ state }}</p>
|
<!-- A card with its value says nothing more about its state; any other state is the message. -->
|
||||||
|
@if (state !== 'Disponible') { <p class="kpi-state" role="status">{{ state }}</p> }
|
||||||
@if (informationLine) { <p class="additional-info">{{ informationLine }}</p> }
|
@if (informationLine) { <p class="additional-info">{{ informationLine }}</p> }
|
||||||
</mat-card>
|
</mat-card>
|
||||||
`,
|
`,
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ describe('KPI integración con autoridad global', () => {
|
|||||||
expect(cards.map(card => card.querySelector('.value')?.firstChild?.textContent?.trim())).toEqual(domain === 'cacu' ? ['5', undefined, '7', undefined, undefined] : ['5', '40.0', '7', '7']);
|
expect(cards.map(card => card.querySelector('.value')?.firstChild?.textContent?.trim())).toEqual(domain === 'cacu' ? ['5', undefined, '7', undefined, undefined] : ['5', '40.0', '7', '7']);
|
||||||
expect(cards.map(card => card.querySelector('.value span')?.textContent.trim())).toEqual(domain === 'cacu' ? ['pacientes', undefined, 'días (mediana)', undefined, undefined]
|
expect(cards.map(card => card.querySelector('.value span')?.textContent.trim())).toEqual(domain === 'cacu' ? ['pacientes', undefined, 'días (mediana)', undefined, undefined]
|
||||||
: ['pacientes', '%', 'días (mediana)', 'días (mediana)']);
|
: ['pacientes', '%', 'días (mediana)', 'días (mediana)']);
|
||||||
expect(cards.map(card => card.querySelector('.kpi-state')?.textContent.trim())).toEqual(domain === 'cacu' ? ['Disponible', 'Selección no consolidable', 'Disponible', 'Indicador no disponible', 'Indicador no disponible'] : Array(4).fill('Disponible'));
|
expect(cards.map(card => card.querySelector('.kpi-state')?.textContent.trim())).toEqual(domain === 'cacu' ? [undefined, 'Selección no consolidable', undefined, 'Indicador no disponible', 'Indicador no disponible'] : Array(4).fill(undefined));
|
||||||
expect(cards.map(card => card.textContent)).toEqual(expect.arrayContaining([
|
expect(cards.map(card => card.textContent)).toEqual(expect.arrayContaining([
|
||||||
expect.stringContaining('2025-S1'),
|
expect.stringContaining('2025-S1'),
|
||||||
expect.stringContaining(domain === 'cacu' ? '5 citologías; primer cuartil: 3 días; tercer cuartil: 9 días.' : '5 mastografías; Q1 a Q3: 3 a 9 días.'),
|
expect.stringContaining(domain === 'cacu' ? '5 citologías; primer cuartil: 3 días; tercer cuartil: 9 días.' : '5 mastografías; Q1 a Q3: 3 a 9 días.'),
|
||||||
|
|||||||
Reference in New Issue
Block a user