@@ -213,7 +213,6 @@ describe('DetailsFieldsComponent', () => {
213
213
214
214
it ( 'should emit saveEntry event' , ( ) => {
215
215
spyOn ( component . saveEntry , 'emit' ) ;
216
- component . entryToEdit = { ...entryToEdit } ;
217
216
component . entryForm . setValue ( {
218
217
project_id : 'p1' ,
219
218
project_name : 'p-name' ,
@@ -311,7 +310,6 @@ describe('DetailsFieldsComponent', () => {
311
310
component . goingToWorkOnThis = true ;
312
311
spyOn ( component . saveEntry , 'emit' ) ;
313
312
314
- component . entryToEdit = { ...entryToEdit } ;
315
313
component . entryForm . setValue ( { ...formValues , start_date : '2020-06-11' , end_date : '2020-06-11' } ) ;
316
314
317
315
component . onSubmit ( ) ;
@@ -392,7 +390,6 @@ describe('DetailsFieldsComponent', () => {
392
390
it ( 'displays error message when the date selected is in the future' , ( ) => {
393
391
spyOn ( toastrServiceStub , 'error' ) ;
394
392
395
- component . entryToEdit = { ...entryToEdit } ;
396
393
const futureDate = moment ( ) . add ( 1 , 'days' ) . format ( DATE_FORMAT_YEAR ) ;
397
394
component . entryForm . setValue ( { ...formValues , start_date : futureDate , end_date : futureDate } ) ;
398
395
component . onSubmit ( ) ;
@@ -403,7 +400,6 @@ describe('DetailsFieldsComponent', () => {
403
400
it ( 'when start_date is in the future and end_date is OK then throws an error' , ( ) => {
404
401
spyOn ( toastrServiceStub , 'error' ) ;
405
402
406
- component . entryToEdit = { ...entryToEdit } ;
407
403
const futureDate = moment ( ) . add ( 1 , 'days' ) . format ( DATE_FORMAT_YEAR ) ;
408
404
const currentDate = moment ( ) . format ( DATE_FORMAT_YEAR ) ;
409
405
component . entryForm . setValue ( { ...formValues , start_date : futureDate , end_date : currentDate } ) ;
@@ -415,7 +411,6 @@ describe('DetailsFieldsComponent', () => {
415
411
it ( 'when start_date is OK and end_date is in the future then throws an error future' , ( ) => {
416
412
spyOn ( toastrServiceStub , 'error' ) ;
417
413
418
- component . entryToEdit = { ...entryToEdit } ;
419
414
const futureDate = moment ( ) . add ( 1 , 'days' ) . format ( DATE_FORMAT_YEAR ) ;
420
415
const currentDate = moment ( ) . format ( DATE_FORMAT_YEAR ) ;
421
416
component . entryForm . setValue ( { ...formValues , start_date : currentDate , end_date : futureDate } ) ;
0 commit comments