feat(ui): incorporar filtros globales por dominio UX-06E.D.2
This commit is contained in:
@@ -70,7 +70,7 @@ describe('UX-04 navegación Angular', () => {
|
||||
load('tea', harness); harness.detectChanges();
|
||||
const control = harness.routeDebugElement!.query(By.directive(IndicadorPeriodFilters)).componentInstance as IndicadorPeriodFilters;
|
||||
control.changeMode('manual'); control.year = '2025'; control.unit = 'S1'; control.add();
|
||||
(harness.routeDebugElement!.query(By.directive(IndicadorFigurePanel)).componentInstance as IndicadorFigurePanel).applyFilters();
|
||||
(harness.routeDebugElement!.componentInstance as IndicadoresPage).applyFilters(); harness.detectChanges();
|
||||
http.expectOne(r => r.url.includes('/figuras/')).flush({ data: [], layout: {} });
|
||||
control.unit = 'S2'; control.add();
|
||||
await harness.navigateByUrl('/indicadores/cacu', IndicadoresPage); load('cacu', harness);
|
||||
@@ -78,7 +78,7 @@ describe('UX-04 navegación Angular', () => {
|
||||
const restored = await harness.navigateByUrl('/indicadores/tea', IndicadoresPage);
|
||||
const req = load('tea', harness);
|
||||
expect(req.request.params.get('periodos')).toBe('2025-S1');
|
||||
expect((harness.routeDebugElement!.query(By.directive(IndicadorFigurePanel)).componentInstance as IndicadorFigurePanel).filters?.editors.semestre?.draft).toEqual({ mode: 'explicit', periodos: ['2025-S1', '2025-S2'] });
|
||||
expect((harness.routeDebugElement!.componentInstance as IndicadoresPage).filters?.editors.semestre?.draft).toEqual({ mode: 'explicit', periodos: ['2025-S1', '2025-S2'] });
|
||||
expect(TestBed.inject(Router).url).toBe('/indicadores/tea');
|
||||
});
|
||||
it('un nuevo arranque conserva la URL de entrada y reinicia indicador, tema y filtros', async () => {
|
||||
@@ -89,7 +89,7 @@ describe('UX-04 navegación Angular', () => {
|
||||
http.expectOne(r => r.url.includes('/figuras/')).flush({ data: [], layout: {} });
|
||||
const control = harness.routeDebugElement!.query(By.directive(IndicadorPeriodFilters)).componentInstance as IndicadorPeriodFilters;
|
||||
control.changeTipo('mes'); control.year = '2025'; control.unit = '01'; control.add();
|
||||
(harness.routeDebugElement!.query(By.directive(IndicadorFigurePanel)).componentInstance as IndicadorFigurePanel).applyFilters();
|
||||
(harness.routeDebugElement!.componentInstance as IndicadoresPage).applyFilters(); harness.detectChanges();
|
||||
http.expectOne(r => r.url.includes('/figuras/')).flush({ data: [], layout: {} });
|
||||
const url = TestBed.inject(Router).url;
|
||||
http.verify(); TestBed.resetTestingModule();
|
||||
@@ -99,8 +99,8 @@ describe('UX-04 navegación Angular', () => {
|
||||
expect(TestBed.inject(Router).url).toBe('/indicadores/cacu');
|
||||
expect((harness.routeDebugElement!.query(By.directive(IndicadorCatalogCard)).componentInstance as IndicadorCatalogCard).expanded).toBe(true);
|
||||
expect(restarted.tema).toBe('claro');
|
||||
expect((harness.routeDebugElement!.query(By.directive(IndicadorFigurePanel)).componentInstance as IndicadorFigurePanel).filters?.tipo).toBe('semestre');
|
||||
expect((harness.routeDebugElement!.query(By.directive(IndicadorFigurePanel)).componentInstance as IndicadorFigurePanel).filters?.editors.mes?.draft.mode).toBe('empty');
|
||||
expect((harness.routeDebugElement!.componentInstance as IndicadoresPage).filters?.tipo).toBe('semestre');
|
||||
expect((harness.routeDebugElement!.componentInstance as IndicadoresPage).filters?.editors.mes?.draft.mode).toBe('empty');
|
||||
expect(req.request.params.has('periodos')).toBe(false);
|
||||
expect(req.request.params.get('tema')).toBe('claro');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user