Skip to content

Commit 5f8b1d6

Browse files
committed
fix tests
1 parent 6b1e4d9 commit 5f8b1d6

File tree

2 files changed

+63
-18
lines changed

2 files changed

+63
-18
lines changed

packages/cubejs-schema-compiler/test/integration/postgres/calendars.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,11 @@ cubes:
697697
calendar_orders__count_shifted_calendar_m: '3',
698698
custom_calendar__retail_date_month: '2025-12-01T00:00:00.000Z',
699699
},
700+
{
701+
calendar_orders__count: null,
702+
calendar_orders__count_shifted_calendar_m: '3',
703+
custom_calendar__retail_date_month: '2026-01-01T00:00:00.000Z',
704+
},
700705
]));
701706

702707
it('Count shifted by retail week (common shift + custom granularity)', async () => runQueryTest({
@@ -708,6 +713,11 @@ cubes:
708713
}],
709714
order: [{ id: 'custom_calendar.retail_date' }]
710715
}, [
716+
{
717+
calendar_orders__count: '1',
718+
calendar_orders__count_shifted_calendar_w: null,
719+
custom_calendar__retail_date_week: '2025-02-02T00:00:00.000Z',
720+
},
711721
{
712722
calendar_orders__count: '1',
713723
calendar_orders__count_shifted_calendar_w: '1',
@@ -723,11 +733,31 @@ cubes:
723733
calendar_orders__count_shifted_calendar_w: '1',
724734
custom_calendar__retail_date_week: '2025-02-23T00:00:00.000Z',
725735
},
736+
{
737+
calendar_orders__count: null,
738+
calendar_orders__count_shifted_calendar_w: '1',
739+
custom_calendar__retail_date_week: '2025-03-02T00:00:00.000Z',
740+
},
741+
{
742+
calendar_orders__count: '1',
743+
calendar_orders__count_shifted_calendar_w: null,
744+
custom_calendar__retail_date_week: '2025-03-09T00:00:00.000Z',
745+
},
726746
{
727747
calendar_orders__count: '1',
728748
calendar_orders__count_shifted_calendar_w: '1',
729749
custom_calendar__retail_date_week: '2025-03-16T00:00:00.000Z',
730750
},
751+
{
752+
calendar_orders__count: null,
753+
calendar_orders__count_shifted_calendar_w: '1',
754+
custom_calendar__retail_date_week: '2025-03-23T00:00:00.000Z',
755+
},
756+
{
757+
calendar_orders__count: '1',
758+
calendar_orders__count_shifted_calendar_w: null,
759+
custom_calendar__retail_date_week: '2025-03-30T00:00:00.000Z',
760+
},
731761
{
732762
calendar_orders__count: '1',
733763
calendar_orders__count_shifted_calendar_w: '1',

packages/cubejs-schema-compiler/test/integration/postgres/multi-stage.test.ts

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -198,24 +198,39 @@ views:
198198
}
199199
],
200200
timezone: 'UTC'
201-
}, [{
202-
orders__date_year: '2023-01-01T00:00:00.000Z',
203-
orders__revenue: '15',
204-
orders__revenue_1_y_ago: '5',
205-
orders__cagr_1_y: '2.0000000000000000'
206-
},
207-
{
208-
orders__date_year: '2024-01-01T00:00:00.000Z',
209-
orders__revenue: '30',
210-
orders__revenue_1_y_ago: '15',
211-
orders__cagr_1_y: '1.0000000000000000'
212-
},
213-
{
214-
orders__date_year: '2025-01-01T00:00:00.000Z',
215-
orders__revenue: '5',
216-
orders__revenue_1_y_ago: '30',
217-
orders__cagr_1_y: '-0.83333333333333333333'
218-
}],
201+
}, [
202+
{
203+
orders__cagr_1_y: null,
204+
orders__date_year: '2022-01-01T00:00:00.000Z',
205+
orders__revenue: '5',
206+
orders__revenue_1_y_ago: null,
207+
},
208+
{
209+
orders__date_year: '2023-01-01T00:00:00.000Z',
210+
orders__revenue: '15',
211+
orders__revenue_1_y_ago: '5',
212+
orders__cagr_1_y: '2.0000000000000000'
213+
},
214+
{
215+
orders__date_year: '2024-01-01T00:00:00.000Z',
216+
orders__revenue: '30',
217+
orders__revenue_1_y_ago: '15',
218+
orders__cagr_1_y: '1.0000000000000000'
219+
},
220+
{
221+
orders__date_year: '2025-01-01T00:00:00.000Z',
222+
orders__revenue: '5',
223+
orders__revenue_1_y_ago: '30',
224+
orders__cagr_1_y: '-0.83333333333333333333'
225+
},
226+
227+
{
228+
orders__cagr_1_y: null,
229+
orders__date_year: '2026-01-01T00:00:00.000Z',
230+
orders__revenue: null,
231+
orders__revenue_1_y_ago: '5',
232+
},
233+
],
219234
{ joinGraph, cubeEvaluator, compiler }));
220235
} else {
221236
// This test is working only in tesseract

0 commit comments

Comments
 (0)