import { DOBPickerController } from './DOBPicker'; import { expect, use } from 'chai'; import { LocalDate, Month } from 'js-joda'; describe('DOBPicker Directive', () => { let controller: DOBPickerController = new DOBPickerController(); it('should accept valid dates', () => { controller.selectedDay = 1; controller.selectedMonth = 2; controller.selectedYear = 1980; controller.update(); expect(controller.dateOfBirth).to.deep.equal(LocalDate.of(1980, 2, 1)); }); it('should not accept invalid dates', () => { controller.selectedDay = 31; controller.selectedMonth = 2; controller.selectedYear = 1980; controller.update(); expect(controller.dateOfBirth.dayOfMonth()).not.to.equal(31); }); })