Skip to content

Commit 4c4bbc3

Browse files
committed
fix for tests
1 parent 7293c83 commit 4c4bbc3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/ngx-calendar/src/lib/components/calendar/calendar.component.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
22
import { Component } from '@angular/core';
3-
import { DateRange } from '@acpaas-ui/ngx-utils';
3+
import { DateRange, DateHelper } from '@acpaas-ui/ngx-utils';
44

55
import { CalendarModule } from '../../calendar.module';
66
import { CalendarComponent } from './calendar.component';
@@ -216,11 +216,15 @@ describe('The Calendar Component', () => {
216216

217217
it('emits the picked date and the completion status', () => {
218218
const date = new Date();
219+
const year = date.getFullYear();
220+
const month = date.getMonth();
221+
const day = date.getDate();
222+
const expectedDate = new Date(DateHelper.toUtcMidnightInBrussels(year, month, day));
219223

220224
calendar.pickDate(date);
221225

222226
expect(calendar.selectDate.emit).toHaveBeenCalledWith({
223-
date,
227+
date: expectedDate,
224228
complete: true,
225229
});
226230
expect(calendar.switchView).not.toHaveBeenCalled();

0 commit comments

Comments
 (0)