feat(ui): incorporar filtros globales por dominio UX-06E.D.2

This commit is contained in:
Angel Capetillo Zavala
2026-10-13 19:45:48 -06:00
parent 98d0614d80
commit c4faa7d9f6
20 changed files with 467 additions and 218 deletions
@@ -61,4 +61,24 @@ describe('UX-05B ciclo de vida con componentes Plotly y runtime simulado', () =>
expect(runtime.purge).toHaveBeenCalledTimes(2); expect(disconnects).toHaveLength(2);
for (const disconnect of disconnects) expect(disconnect).toHaveBeenCalledTimes(1);
});
it('D.2 conserva hosts reales ocultando resultados anteriores durante carga e incompatibilidad', async () => {
respond(); await settle();
const charts = fixture.debugElement.queryAll(By.directive(PlotlyChart));
const hosts = charts.map(c => c.componentInstance.host.nativeElement);
const page = fixture.componentInstance;
page.filters!.editors.semestre!.draft = { mode: 'explicit', periodos: ['2025-S1'] };
page.applyFilters(); fixture.detectChanges();
expect(fixture.debugElement.queryAll(By.directive(PlotlyChart)).map(c => c.componentInstance)).toEqual(charts.map(c => c.componentInstance));
for (const host of hosts) expect(host.closest('[hidden]')).toBeTruthy();
expect(runtime.purge).not.toHaveBeenCalled();
respond(); await settle();
for (const host of hosts) expect(host.closest('[hidden]')).toBeNull();
expect(fixture.debugElement.queryAll(By.directive(PlotlyChart)).map(c => c.componentInstance.host.nativeElement)).toEqual(hosts);
// Published capability change is evaluated by each existing consumer.
const current = page.catalog()[0];
page.catalog.set([{ ...current, tipos_periodo: ['mes'] }]); fixture.detectChanges(); await settle();
for (const host of hosts) expect(host.closest('[hidden]')).toBeTruthy();
expect(fixture.nativeElement.querySelectorAll('.incompatible')).toHaveLength(2);
expect(runtime.purge).not.toHaveBeenCalled(); http.expectNone(() => true);
});
});