0e4bde9c62
The definitions tab renders a TEA section from indicadores/tea-definitions.ts, shown only for the TEA domain through definitionGroups(domain). Five groups: EEG alterations and the 16-36 month range, how to read z, the head map colors and the norm bands (P25-P75 = 50 %, P5-P95 = 90 %), the "No evaluable" reasons, the risk analysis (odds ratio reading and what the probability means), and the indicators (prevalence per 10,000 and the data it needs, medians that do not add up, M23 groups). Choices left open by the spec: - The text is plain data (group id, title, term/text entries) rendered as definition lists, above the indicator catalog. - The "No evaluable" reasons cover every code in eeg-labels.ts, merging sin N2 / sin N3, sin edad / edad fuera de la curva, with the spec's seven reasons all present. - The range text says 16 to 36 months for every alteration, spikes included. - The only test covers the domain filter and the shape of the data, not the text.
22 lines
742 B
TypeScript
22 lines
742 B
TypeScript
import { definitionGroups, TEA_DEFINITIONS } from './tea-definitions';
|
|
|
|
describe('TEA definitions', () => {
|
|
it('are shown only for the TEA domain', () => {
|
|
expect(definitionGroups('tea')).toBe(TEA_DEFINITIONS);
|
|
expect(definitionGroups('cacu')).toEqual([]);
|
|
expect(definitionGroups('cama')).toEqual([]);
|
|
});
|
|
|
|
it('have unique group ids and no empty entries', () => {
|
|
const ids = TEA_DEFINITIONS.map((g) => g.id);
|
|
expect(new Set(ids).size).toBe(ids.length);
|
|
for (const group of TEA_DEFINITIONS) {
|
|
expect(group.entries.length).toBeGreaterThan(0);
|
|
for (const entry of group.entries) {
|
|
expect(entry.term.trim()).not.toBe('');
|
|
expect(entry.text.trim()).not.toBe('');
|
|
}
|
|
}
|
|
});
|
|
});
|