Skip to content

Commit

Permalink
fix test for pre-agg with allowNonStrictDateRangeMatch: true
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Jan 29, 2025
1 parent 4382d9c commit aabc5ab
Showing 1 changed file with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,15 @@ describe('PreAggregations', () => {
});
}));

it('simple pre-aggregation (with no granularity in query)', () => compiler.compile().then(() => {
it('simple pre-aggregation (allowNonStrictDateRangeMatch: true)', () => compiler.compile().then(() => {
const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
measures: [
'visitors.count'
],
timeDimensions: [{
dimension: 'visitors.createdAt',
dateRange: ['2017-01-01 00:00:00.000', '2017-01-29 22:59:59.999']
dateRange: ['2017-01-01 00:10:00.000', '2017-01-29 22:59:59.999'],
granularity: 'hour',
}],
timezone: 'America/Los_Angeles',
preAggregationsSchema: ''
Expand All @@ -567,9 +568,24 @@ describe('PreAggregations', () => {

return dbRunner.evaluateQueryWithPreAggregations(query).then(res => {
expect(res).toEqual(
[{
visitors__count: '5'
}]
[
{
visitors__count: '1',
visitors__created_at_hour: '2017-01-02T16:00:00.000Z',
},
{
visitors__count: '1',
visitors__created_at_hour: '2017-01-04T16:00:00.000Z',
},
{
visitors__count: '1',
visitors__created_at_hour: '2017-01-05T16:00:00.000Z',
},
{
visitors__count: '2',
visitors__created_at_hour: '2017-01-06T16:00:00.000Z',
},
]
);
});
}));
Expand Down

0 comments on commit aabc5ab

Please sign in to comment.