@@ -443,47 +443,31 @@ describe('DetailsFieldsComponent', () => {
443443 expect ( component . projectSelected . emit ) . toHaveBeenCalledWith ( data ) ;
444444 } ) ;
445445
446- it ( 'on Selected Initial Date should change end date ' , ( ) => {
447- const expectedInitialDate = '2020-02-05' ;
446+ it ( 'on Selected Start Date should change End Date ' , ( ) => {
447+ const expectedStartDate = '2020-02-05' ;
448448
449- component . onInitialDatepickerUpdated ( expectedInitialDate ) ;
449+ component . onStartDateChange ( expectedStartDate ) ;
450450 fixture . detectChanges ( ) ;
451451 const endDateInput : HTMLInputElement = fixture . debugElement . nativeElement . querySelector ( '#end_date' ) ;
452452
453- expect ( endDateInput . value ) . toEqual ( expectedInitialDate ) ;
453+ expect ( endDateInput . value ) . toEqual ( expectedStartDate ) ;
454454 } ) ;
455455
456- it ( 'on Selected End Date should not change initial date ' , ( ) => {
457- const expectedInitialDate = '2020-02-05' ;
456+ it ( 'on Selected End Date should not change Start Date ' , ( ) => {
457+ const expectedStartDate = '2020-02-05' ;
458458 const expectedEndDate = '2020-02-06' ;
459459
460460 component . ngOnInit ( ) ;
461461 fixture . detectChanges ( ) ;
462462 const startDateInput : HTMLInputElement = fixture . debugElement . nativeElement . querySelector ( '#start_date' ) ;
463463 const endDateInput : HTMLInputElement = fixture . debugElement . nativeElement . querySelector ( '#end_date' ) ;
464- startDateInput . value = expectedInitialDate ;
464+ startDateInput . value = expectedStartDate ;
465465 endDateInput . value = expectedEndDate ;
466466 endDateInput . dispatchEvent ( new Event ( '#end_date' ) ) ;
467467
468468 expect ( endDateInput . value ) . not . toEqual ( startDateInput . value ) ;
469469 } ) ;
470470
471- /*
472- fit('should be ok', () => {
473- const expectedInitialDate = '2020-02-05';
474- const expectedEndDate = '2020-02-06';
475-
476- component.ngOnInit();
477- fixture.detectChanges();
478- const startDateInput: HTMLInputElement = fixture.debugElement.nativeElement.querySelector('#start_date');
479- const endDateInput: HTMLInputElement = fixture.debugElement.nativeElement.querySelector('#end_date');
480- startDateInput.value = expectedInitialDate;
481- endDateInput.value = expectedEndDate;
482- endDateInput.dispatchEvent(new Event('#end_date'));
483-
484- expect(endDateInput.value).not.toEqual(expectedInitialDate);
485- });
486- */
487471
488472 /*
489473 TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component,
0 commit comments