feat(ui): completar presentacion de figuras UX-06D
This commit is contained in:
@@ -109,12 +109,12 @@ describe('UX-05B catálogo expandible', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('UX-06B conserva el selector técnico claro/oscuro y no vuelve a cargar el catálogo', async () => {
|
||||
it('UX-06D retira el selector visual, inicia claro y conserva oscuro sin recargar catálogo', async () => {
|
||||
load();
|
||||
await fixture.whenStable(); fixture.detectChanges();
|
||||
const select = fixture.debugElement.query(By.directive(MatSelect)).componentInstance as MatSelect;
|
||||
expect(select.options.map(option => option.value)).toEqual(['claro', 'oscuro']);
|
||||
expect(select.value).toBe('claro');
|
||||
expect(fixture.debugElement.query(By.directive(MatSelect))).toBeNull();
|
||||
expect(fixture.nativeElement.textContent).not.toContain('Tema del dominio');
|
||||
expect(page.tema).toBe('claro');
|
||||
page.changeTema('oscuro'); fixture.detectChanges();
|
||||
expect(page.tema).toBe('oscuro');
|
||||
expect(cards().every(card => !card.expanded)).toBe(true);
|
||||
@@ -180,6 +180,23 @@ describe('UX-05B catálogo expandible', () => {
|
||||
expect(a.selectedPeriods).toEqual(['2025-S1', '2025-S2']); expect(b.selectedPeriods).toEqual(['2026-01']);
|
||||
themedA.flush({ data: [], layout: {} }); themedB.flush({ data: [], layout: {} });
|
||||
});
|
||||
it('UX-06D expandir metodología conserva panel, figura y borrador sin generar HTTP', () => {
|
||||
load([{ ...item, contrato: 'C2', figuras: ['fig_c2_apiladas'] }]); flushAll();
|
||||
const panel = panels()[0], chart = fixture.debugElement.query(By.directive(ChartStub)).componentInstance;
|
||||
const filters = control();
|
||||
filters.changeMode('manual'); filters.year = '2025'; filters.unit = 'S1'; filters.add();
|
||||
const draft = structuredClone(filters.entry.draft), applied = structuredClone(panel.filters!.applied);
|
||||
const result = panel.result();
|
||||
const button = fixture.nativeElement.querySelector('.methodology-toggle') as HTMLButtonElement;
|
||||
for (let i = 0; i < 2; i++) {
|
||||
button.click(); fixture.detectChanges();
|
||||
expect(button.getAttribute('aria-expanded')).toBe(i === 0 ? 'true' : 'false');
|
||||
expect(panels()[0]).toBe(panel); expect(panel.result()).toBe(result);
|
||||
expect(fixture.debugElement.query(By.directive(ChartStub)).componentInstance).toBe(chart);
|
||||
expect(filters.entry.draft).toEqual(draft); expect(panel.filters!.applied).toEqual(applied);
|
||||
http.expectNone(() => true);
|
||||
}
|
||||
});
|
||||
it('cerrar y reabrir restaura borrador y aplicado por figura sin confirmar borradores', () => {
|
||||
load([item]); flushAll(); const a = control(); a.changeMode('manual'); a.year = '2025'; a.unit = 'S1'; a.add();
|
||||
panels()[0].applyFilters(); request('f1').flush({ data: [], layout: {} }); a.unit = 'S2'; a.add();
|
||||
@@ -282,8 +299,9 @@ describe('UX-05B catálogo expandible', () => {
|
||||
expect(writes).not.toHaveBeenCalled(); expect(saves).not.toHaveBeenCalled();
|
||||
expect(panels()[0].result()).toBe(state); http.expectNone(() => true);
|
||||
});
|
||||
it('mantiene el aviso de investigación en el catálogo', () => {
|
||||
load(); expect(fixture.nativeElement.querySelector('.notice').textContent).toBe('Uso exclusivo de investigación. No usar para decisiones clínicas.');
|
||||
it('UX-06D retira solo el aviso general del catálogo', () => {
|
||||
load(); expect(fixture.nativeElement.querySelector('.notice')).toBeNull();
|
||||
expect(fixture.nativeElement.textContent).not.toContain('Uso exclusivo de investigación. No usar para decisiones clínicas.');
|
||||
});
|
||||
it('IDs distintos con el mismo título y figura conservan paneles y etiquetas independientes', () => {
|
||||
load([{ ...item, figuras: ['f1'] }, { ...second, titulo: item.titulo, figuras: ['f1'] }]);
|
||||
|
||||
Reference in New Issue
Block a user