feat(indicadores): habilitar dashboards Angular TEA CaCu y CaMa
This commit is contained in:
@@ -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(); }
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user