SYNC: autodetect - with grouping field

This commit is contained in:
Jan Prochazka
2025-07-02 10:22:41 +02:00
committed by Diflow
parent 794dd5a797
commit cd3a1bebff
5 changed files with 93 additions and 70 deletions

View File

@@ -116,8 +116,8 @@ describe('Chart processor', () => {
const processor = new ChartProcessor();
processor.addRows(...DS1.slice(0, 3));
processor.finalize();
expect(processor.charts.length).toEqual(1);
const chart = processor.charts[0];
expect(processor.charts.length).toEqual(2);
const chart = processor.charts.find(x => !x.definition.groupingField);
expect(chart.definition.xdef.transformFunction).toEqual('date:day');
expect(chart.definition.ydefs).toEqual([
expect.objectContaining({
@@ -130,8 +130,8 @@ describe('Chart processor', () => {
const processor = new ChartProcessor();
processor.addRows(...DS1.slice(0, 4));
processor.finalize();
expect(processor.charts.length).toEqual(1);
const chart = processor.charts[0];
expect(processor.charts.length).toEqual(2);
const chart = processor.charts.find(x => !x.definition.groupingField);
expect(chart.definition.xdef.transformFunction).toEqual('date:month');
expect(chart.bucketKeysOrdered).toEqual([
'2023-10',
@@ -393,8 +393,7 @@ describe('Chart processor', () => {
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({