SYNC: charts fix

This commit is contained in:
SPRINX0\prochazka
2025-06-19 17:57:01 +02:00
committed by Diflow
parent 28439c010f
commit cd505abb22
3 changed files with 39 additions and 1 deletions

View File

@@ -373,4 +373,34 @@ describe('Chart processor', () => {
expect(chart.buckets).toEqual(expectedBuckets);
}
);
test.only('Incorrect chart definition', () => {
const processor = new ChartProcessor([
{
chartType: 'bar',
xdef: {
field: 'category',
transformFunction: 'date:day',
},
ydefs: [],
},
]);
processor.addRows(...DS1.slice(0, 3));
processor.finalize();
expect(processor.charts.length).toEqual(1);
const chart = processor.charts[0];
expect(chart.definition.xdef.transformFunction).toEqual('date:day');
// console.log(getChartDebugPrint(processor.charts[0]));
// expect(chart.definition.xdef.transformFunction).toEqual('date:day');
// expect(chart.definition.ydefs).toEqual([
// expect.objectContaining({
// field: 'value',
// }),
// ]);
// expect(chart.bucketKeysOrdered).toEqual(['2023-10-01', '2023-10-02', '2023-10-03']);
});
});