-
Notifications
You must be signed in to change notification settings - Fork 1
fix: TT-167 Date picker disable future dates #642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
62d540e
36a3b9b
056439e
4c6b655
4045b4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -474,6 +474,25 @@ describe('DetailsFieldsComponent', () => { | |
|
||
expect(component.getCurrentDate()).toEqual(actualDateExpected); | ||
}); | ||
|
||
it('on the input with id #start_date we could get the id and max value', () => { | ||
fixture.detectChanges(); | ||
const expectDate = new Date().toISOString().split('T')[0]; | ||
const slectInput: HTMLInputElement = fixture.debugElement. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if you want to retrieve the selecInput. You only need to queryselector by the id. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, the name |
||
nativeElement.querySelector(`input[id="start_date"],input[max="${component.getCurrentDate()}"]`); | ||
|
||
expect(slectInput.id).toEqual('start_date'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why it is neccesary to assert the value of id? |
||
expect(slectInput.max).toEqual(expectDate); | ||
}); | ||
|
||
it('on the input with id #end_date we could get the current Date ', () => { | ||
fixture.detectChanges(); | ||
const expectDate = new Date().toISOString().split('T')[0]; | ||
const slectInput = fixture.debugElement.nativeElement.querySelector('[id=end_date]'); | ||
|
||
expect(slectInput.id).toEqual('end_date'); | ||
expect(slectInput.max).toEqual(expectDate); | ||
}); | ||
/* | ||
TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component, | ||
and now these couple of tests are failing. A solution to this error might be generate a Test Wrapper Component. More details here: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expectDate
toexpectedDate