Skip to content

Commit 221d8d1

Browse files
committed
chore: fix tests
1 parent d33f800 commit 221d8d1

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

packages/cubejs-schema-compiler/test/integration/mssql/mssql-pre-aggregations.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,22 +278,22 @@ describe('MSSqlPreAggregations', () => {
278278
expect(res)
279279
.toEqual([
280280
{
281-
visitors__created_at_day: new Date('2017-01-03T00:00:00.000Z'),
281+
visitors__created_at_day: new Date('2017-01-02T00:00:00.000Z'),
282282
visitors__checkins_total: 3,
283283
visitors__source: 'some',
284284
},
285285
{
286-
visitors__created_at_day: new Date('2017-01-05T00:00:00.000Z'),
286+
visitors__created_at_day: new Date('2017-01-04T00:00:00.000Z'),
287287
visitors__checkins_total: 2,
288288
visitors__source: 'some',
289289
},
290290
{
291-
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z'),
291+
visitors__created_at_day: new Date('2017-01-05T00:00:00.000Z'),
292292
visitors__checkins_total: 1,
293293
visitors__source: 'google',
294294
},
295295
{
296-
visitors__created_at_day: new Date('2017-01-07T00:00:00.000Z'),
296+
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z'),
297297
visitors__checkins_total: 0,
298298
visitors__source: null
299299
}

packages/cubejs-schema-compiler/test/integration/mssql/mssql-ungrouped.test.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,12 @@ describe('MSSqlUngrouped', () => {
366366
ungrouped: true,
367367
allowUngroupedWithoutPrimaryKey: true,
368368
}, [
369+
{ visitor_checkins__created_at_day: new Date('2017-01-02T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
369370
{ visitor_checkins__created_at_day: new Date('2017-01-03T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
370371
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
371-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
372-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
373-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
374-
{ visitor_checkins__created_at_day: new Date('2017-01-06T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: 1 },
372+
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
373+
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: null },
374+
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__google_sourced_checkins: 1 },
375375
]));
376376

377377
it('ungrouped filtered distinct count', () => runQueryTest({
@@ -390,12 +390,12 @@ describe('MSSqlUngrouped', () => {
390390
ungrouped: true,
391391
allowUngroupedWithoutPrimaryKey: true,
392392
}, [
393+
{ visitor_checkins__created_at_day: new Date('2017-01-02T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
393394
{ visitor_checkins__created_at_day: new Date('2017-01-03T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
394395
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
395-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
396-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
397-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
398-
{ visitor_checkins__created_at_day: new Date('2017-01-06T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: 1 },
396+
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
397+
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: null },
398+
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__unique_google_sourced_checkins: 1 },
399399
]));
400400

401401
it('ungrouped ratio measure', () => runQueryTest({
@@ -414,12 +414,12 @@ describe('MSSqlUngrouped', () => {
414414
ungrouped: true,
415415
allowUngroupedWithoutPrimaryKey: true,
416416
}, [
417+
{ visitor_checkins__created_at_day: new Date('2017-01-02T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
417418
{ visitor_checkins__created_at_day: new Date('2017-01-03T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
418419
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
420+
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
421+
{ visitor_checkins__created_at_day: new Date('2017-01-04T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
419422
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
420-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
421-
{ visitor_checkins__created_at_day: new Date('2017-01-05T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
422-
{ visitor_checkins__created_at_day: new Date('2017-01-06T00:00:00.000Z'), visitor_checkins__unique_sources_per_checking: 1 },
423423
]));
424424

425425
it('ungrouped', () => runQueryTest({
@@ -439,22 +439,22 @@ describe('MSSqlUngrouped', () => {
439439
ungrouped: true
440440
}, [{
441441
visitors__id: 6,
442-
visitors__created_at_day: new Date('2016-09-07T00:00:00.000Z')
442+
visitors__created_at_day: new Date('2016-09-06T00:00:00.000Z')
443443
}, {
444444
visitors__id: 1,
445-
visitors__created_at_day: new Date('2017-01-03T00:00:00.000Z')
445+
visitors__created_at_day: new Date('2017-01-02T00:00:00.000Z')
446446
}, {
447447
visitors__id: 2,
448-
visitors__created_at_day: new Date('2017-01-05T00:00:00.000Z')
448+
visitors__created_at_day: new Date('2017-01-04T00:00:00.000Z')
449449
}, {
450450
visitors__id: 3,
451-
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z')
451+
visitors__created_at_day: new Date('2017-01-05T00:00:00.000Z')
452452
}, {
453453
visitors__id: 4,
454-
visitors__created_at_day: new Date('2017-01-07T00:00:00.000Z')
454+
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z')
455455
}, {
456456
visitors__id: 5,
457-
visitors__created_at_day: new Date('2017-01-07T00:00:00.000Z')
457+
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z')
458458
}]));
459459

460460
it('offset cache', () => runQueryTest({
@@ -475,7 +475,7 @@ describe('MSSqlUngrouped', () => {
475475
offset: 5
476476
}, [{
477477
visitors__id: 5,
478-
visitors__created_at_day: new Date('2017-01-07T00:00:00.000Z')
478+
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z')
479479
}]));
480480

481481
it('ungrouped without id', () => runQueryTest({
@@ -493,17 +493,17 @@ describe('MSSqlUngrouped', () => {
493493
ungrouped: true,
494494
allowUngroupedWithoutPrimaryKey: true
495495
}, [{
496-
visitors__created_at_day: new Date('2016-09-07T00:00:00.000Z')
496+
visitors__created_at_day: new Date('2016-09-06T00:00:00.000Z')
497+
}, {
498+
visitors__created_at_day: new Date('2017-01-02T00:00:00.000Z')
497499
}, {
498-
visitors__created_at_day: new Date('2017-01-03T00:00:00.000Z')
500+
visitors__created_at_day: new Date('2017-01-04T00:00:00.000Z')
499501
}, {
500502
visitors__created_at_day: new Date('2017-01-05T00:00:00.000Z')
501503
}, {
502504
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z')
503505
}, {
504-
visitors__created_at_day: new Date('2017-01-07T00:00:00.000Z')
505-
}, {
506-
visitors__created_at_day: new Date('2017-01-07T00:00:00.000Z')
506+
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z')
507507
}]));
508508

509509
it('ungrouped false without id', () => runQueryTest({
@@ -520,14 +520,14 @@ describe('MSSqlUngrouped', () => {
520520
timezone: 'America/Los_Angeles',
521521
ungrouped: false
522522
}, [{
523-
visitors__created_at_day: new Date('2016-09-07T00:00:00.000Z')
523+
visitors__created_at_day: new Date('2016-09-06T00:00:00.000Z')
524524
}, {
525-
visitors__created_at_day: new Date('2017-01-03T00:00:00.000Z')
525+
visitors__created_at_day: new Date('2017-01-02T00:00:00.000Z')
526+
}, {
527+
visitors__created_at_day: new Date('2017-01-04T00:00:00.000Z')
526528
}, {
527529
visitors__created_at_day: new Date('2017-01-05T00:00:00.000Z')
528530
}, {
529531
visitors__created_at_day: new Date('2017-01-06T00:00:00.000Z')
530-
}, {
531-
visitors__created_at_day: new Date('2017-01-07T00:00:00.000Z')
532532
}]));
533533
});

0 commit comments

Comments
 (0)