Skip to content

Commit 042b561

Browse files
committed
fix tests
1 parent 645cc1f commit 042b561

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ exports[`CubeSchemaConverter adds a pre-aggregation to JS model (w/o pre-agg) us
6969
count: {
7070
type: 'count'
7171
},
72+
count_shifted_year: {
73+
type: 'count',
74+
multiStage: true,
75+
timeShift: [{
76+
timeDimension: \`createdAt\`,
77+
interval: '1 year',
78+
type: 'prior'
79+
}]
80+
},
7281
rollingCountByTrailing2Day: {
7382
type: 'count',
7483
rollingWindow: {
@@ -675,6 +684,15 @@ exports[`CubeSchemaConverter converts all schema repository models (no changes,
675684
count: {
676685
type: 'count'
677686
},
687+
count_shifted_year: {
688+
type: 'count',
689+
multiStage: true,
690+
timeShift: [{
691+
timeDimension: \`createdAt\`,
692+
interval: '1 year',
693+
type: 'prior'
694+
}]
695+
},
678696
rollingCountByTrailing2Day: {
679697
type: 'count',
680698
rollingWindow: {
@@ -810,6 +828,15 @@ exports[`CubeSchemaConverter converts all schema repository models (no changes,
810828
count: {
811829
type: 'count'
812830
},
831+
count_shifted_year: {
832+
type: 'count',
833+
multiStage: true,
834+
timeShift: [{
835+
timeDimension: \`createdAt\`,
836+
interval: '1 year',
837+
type: 'prior'
838+
}]
839+
},
813840
rollingCountByTrailing2Day: {
814841
type: 'count',
815842
rollingWindow: {

packages/cubejs-schema-compiler/test/unit/cube-schema-converter.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { CubePreAggregationConverter, CubeSchemaConverter } from '../../src';
22
import {
33
createCubeSchema,
4-
createCubeSchemaWithCustomGranularities,
5-
createCubeSchemaYaml, createECommerceSchema,
4+
createCubeSchemaWithCustomGranularitiesAndTimeShift,
5+
createCubeSchemaYaml,
6+
createECommerceSchema,
67
createSchemaYaml
78
} from './utils';
89

@@ -16,7 +17,7 @@ const repo = {
1617
preAggregations: 'existing_pre_agg: {\n measures: [\n single_preagg_cube.count\n ],\n timeDimension: single_preagg_cube.createdAt,\n granularity: `month`\n}'
1718
})
1819
},
19-
{ fileName: 'orders_and_users.js', content: createCubeSchemaWithCustomGranularities('js_orders') },
20+
{ fileName: 'orders_and_users.js', content: createCubeSchemaWithCustomGranularitiesAndTimeShift('js_orders') },
2021
{ fileName: 'single_cube.yaml', content: createCubeSchemaYaml({ name: 'yml_orders', sqlTable: 'yml_orders' }) },
2122
{ fileName: 'multi_ecom.yaml', content: createSchemaYaml(createECommerceSchema()) },
2223
{ fileName: 'empty1.yaml', content: ' ' },

0 commit comments

Comments
 (0)