Skip to content

Commit 4c6b655

Browse files
committed
fix: TT-167 Date picker disable future dates
1 parent 056439e commit 4c6b655

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/app/modules/shared/components/details-fields/details-fields.component.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,25 @@ describe('DetailsFieldsComponent', () => {
474474

475475
expect(component.getCurrentDate()).toEqual(actualDateExpected);
476476
});
477+
478+
it('on the input with id #start_date we could get the id and max value', () => {
479+
fixture.detectChanges();
480+
const expectDate = new Date().toISOString().split('T')[0];
481+
const slectInput: HTMLInputElement = fixture.debugElement.
482+
nativeElement.querySelector(`input[id="start_date"],input[max="${component.getCurrentDate()}"]`);
483+
484+
expect(slectInput.id).toEqual('start_date');
485+
expect(slectInput.max).toEqual(expectDate);
486+
});
487+
488+
it('on the input with id #end_date we could get the current Date ', () => {
489+
fixture.detectChanges();
490+
const expectDate = new Date().toISOString().split('T')[0];
491+
const slectInput = fixture.debugElement.nativeElement.querySelector('[id=end_date]');
492+
493+
expect(slectInput.id).toEqual('end_date');
494+
expect(slectInput.max).toEqual(expectDate);
495+
});
477496
/*
478497
TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component,
479498
and now these couple of tests are failing. A solution to this error might be generate a Test Wrapper Component. More details here:

0 commit comments

Comments
 (0)