feat(indicadores): habilitar dashboards Angular TEA CaCu y CaMa

This commit is contained in:
Angel Capetillo Zavala
2026-10-12 16:39:37 -06:00
parent a66205b725
commit b1c4b78f32
15 changed files with 5036 additions and 41 deletions
@@ -1,3 +1,4 @@
import { syntheticFigures } from '../../features/indicadores/indicadores.synthetic-fixtures';
import { vi } from 'vitest';
import { PlotlyController } from './plotly-controller';
import { PlotlyRuntime } from './plotly-runtime';
@@ -175,4 +176,23 @@ describe('PlotlyController con Plotly instalado', () => {
controller?.destroy(); host.remove();
}
});
it.each(syntheticFigures)('renderiza el JSON G7D.2B $name sin convertir nulos, IC ni bdata', async ({ figure }) => {
const host = document.createElement('div');
document.body.append(host);
const original = JSON.stringify(figure);
let controller!: PlotlyController;
try {
await new Promise<void>((resolve, reject) => {
controller = new PlotlyController(host, () => Promise.resolve(runtime), state => {
if (state === 'ready') resolve();
if (state === 'error') reject(new Error('Plotly synthetic fixture failed'));
});
controller.setFigure(figure);
});
expect(host.querySelector('.main-svg')).not.toBeNull();
expect(host.style.visibility).toBe('visible');
expect(JSON.stringify(figure)).toBe(original);
} finally { controller?.destroy(); host.remove(); }
});
});