import { DatePickerComponent } from '@shared/components/date-picker/date-picker.component'; import { DateTimeService} from '@shared/services/date-time/date-time.service'; import { TranslateService } from '@ngx-translate/core'; export const ui = 70; export const accessibility = null; describe('Cart 2.0', () => { describe('DatePickerComponent', () => { let dateTimeSvcMock: jasmine.SpyObj; let translateSvcMock: jasmine.SpyObj; let datePickerComponent: DatePickerComponent; beforeEach(() => { translateSvcMock = jasmine.createSpyObj('TranslateService', ['get']); dateTimeSvcMock = jasmine.createSpyObj('DateTimeService', ['isDate', 'isToday', 'isEqual', 'startOfMonth', 'differenceInMonths', 'getPrevMonth', 'getNextMonth']); datePickerComponent = new DatePickerComponent(dateTimeSvcMock, translateSvcMock); }); it('should have DatePickerComponent defined', () => { expect(datePickerComponent).toBeTruthy(); }); it('should have input `selectedDate` value as `Undefined`', () => { expect(datePickerComponent.selectedDate).toBeUndefined(); }); it('should have input `availableDates` value as `Undefined`', () => { expect(datePickerComponent.availableDates).toBeUndefined(); }); it('should have input `displayMonth` value as `Undefined`', () => { expect(datePickerComponent.displayMonth).toBeUndefined(); }); it('should have output `doneClicked` value as `Undefined`', () => { expect(datePickerComponent.doneClicked).toBeTruthy(); }); it('should have `prevButtonDisabled` value as `false`', () => { expect(datePickerComponent.prevButtonDisabled).toEqual(false); }); it('should have `nextButtonDisabled` value as `false`', () => { expect(datePickerComponent.nextButtonDisabled).toEqual(false); }); it('should have `weeks` value as `Undefined`', () => { expect(datePickerComponent.weeks).toBeUndefined(); }); it('should have `monthHeader` value as `Undefined`', () => { expect(datePickerComponent.monthHeader).toBeUndefined(); }); it('should have ngOnChanges method created', () => { expect(datePickerComponent.ngOnChanges).toBeTruthy(); }); it('should have renderCalendar method created', () => { expect(datePickerComponent.renderCalendar).toBeTruthy(); }); it('should have isDateToday method created', () => { expect(datePickerComponent.isDateToday).toBeTruthy(); }); it('should have isDateSelected method created', () => { expect(datePickerComponent.isDateSelected).toBeTruthy(); }); it('should have disablePrevButton method created', () => { expect(datePickerComponent.disablePrevButton).toBeTruthy(); }); it('should have disableNextButton method created', () => { expect(datePickerComponent.disableNextButton).toBeTruthy(); }); it('should have showPrevMonth method created', () => { expect(datePickerComponent.showPrevMonth).toBeTruthy(); }); it('should have showNextMonth method created', () => { expect(datePickerComponent.showNextMonth).toBeTruthy(); }); it('should have onDateClick method created', () => { expect(datePickerComponent.onDateClick).toBeTruthy(); }); it('should have handleDoneClicked method created', () => { expect(datePickerComponent.handleDoneClicked).toBeTruthy(); }); it('should have createCalendarMonth method created', () => { expect(datePickerComponent.createCalendarMonth).toBeTruthy(); }); it('should have getDatesToRender method created', () => { expect(datePickerComponent.getDatesToRender).toBeTruthy(); }); it('should have isDateDisabled method created', () => { expect(datePickerComponent.isDateDisabled).toBeTruthy(); }); }); });