feat(ui): incorporar ayuda contextual UX-06E.B1

This commit is contained in:
Angel Capetillo Zavala
2026-10-13 15:21:48 -06:00
parent fe9442237b
commit f96fe97ed6
6 changed files with 142 additions and 20 deletions
@@ -134,6 +134,14 @@ describe('UX-05C búsqueda local y partición estable', () => {
const writes = selects.map(e => vi.spyOn(e.injector.get(NgModel).control, 'setValue'));
const memory = TestBed.inject(IndicadoresMemory), saves = vi.spyOn(memory, 'save'), restores = vi.spyOn(memory, 'restore');
const reacts = runtime.react.mock.calls.length;
const helps = [...fixture.nativeElement.querySelectorAll('.methodology-toggle')] as HTMLButtonElement[];
expect(helps).toHaveLength(3);
const helpIds = helps.map(button => button.getAttribute('aria-controls')!);
expect(new Set(helpIds).size).toBe(3);
for (const id of helpIds) expect(document.getElementById(id)?.hidden).toBe(true);
helps[0].click(); fixture.detectChanges(); await settle();
expect(helps.map(button => button.getAttribute('aria-expanded'))).toEqual(['true', 'false', 'false']);
expect(helpIds.map(id => document.getElementById(id)?.hidden)).toEqual([false, true, true]);
for (const query of ['sexo', 'evaluacion', '']) {
if (query) await search(query);
else { fixture.nativeElement.querySelector('.catalog-search button').click(); fixture.detectChanges(); await settle(); }
@@ -143,6 +151,10 @@ describe('UX-05C búsqueda local y partición estable', () => {
beforeCharts.forEach(c => expect(charts().find(chart => chart.host.nativeElement === c.host.nativeElement)).toBe(c));
}
expect(cards()).toEqual(beforeCards); expect(beforeCards.slice(0, 3).every(c => c.expanded)).toBe(true);
for (const button of helps) expect(button.isConnected).toBe(true);
expect(helps.map(button => button.getAttribute('aria-expanded'))).toEqual(['true', 'false', 'false']);
helps[0].click(); fixture.detectChanges(); await settle();
expect(document.getElementById(helpIds[0])?.hidden).toBe(true);
expect(panels()).toEqual(beforePanels); expect(filters()).toEqual(beforeFilters); expect(charts()).toEqual(beforeCharts);
expect(beforePanels.map(p => p.titleId)).toEqual(titleIds);
for (const id of titleIds) {