integration layer; merge work on indicators from forks with existing ingestion pipeline
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { vi } from 'vitest';
|
||||
import { loadPlotly } from './plotly-runtime';
|
||||
|
||||
it('carga una sola instancia oficial con el esquema requerido por C1/C2/C3r', async () => {
|
||||
// No chart rendering in jsdom. Schema inspection only needs browser globals.
|
||||
const canvas = vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockReturnValue(null);
|
||||
try {
|
||||
const first = loadPlotly();
|
||||
expect(loadPlotly()).toBe(first);
|
||||
const runtime = await first as unknown as { version: string; PlotSchema: { get(): any } };
|
||||
expect(runtime.version).toBe('4.1.2');
|
||||
const schema = runtime.PlotSchema.get();
|
||||
expect(schema.traces.scatter).toBeDefined();
|
||||
expect(schema.traces.bar).toBeDefined();
|
||||
expect(schema.traces.box).toBeDefined();
|
||||
expect(schema.traces.scatter.attributes.error_y).toBeDefined();
|
||||
expect(schema.layout.layoutAttributes.xaxis.type.values).toContain('multicategory');
|
||||
expect(schema.traces.scatter.layoutAttributes.scattermode.values).toContain('group');
|
||||
expect(schema.traces.box.layoutAttributes.boxmode.values).toContain('group');
|
||||
for (const key of ['q1', 'median', 'q3', 'lowerfence', 'upperfence']) expect(schema.traces.box.attributes[key]).toBeDefined();
|
||||
for (const key of ['annotations', 'template', 'paper_bgcolor', 'plot_bgcolor']) expect(schema.layout.layoutAttributes[key]).toBeDefined();
|
||||
} finally { canvas.mockRestore(); }
|
||||
});
|
||||
Reference in New Issue
Block a user