@@ -247,7 +247,7 @@ describe('TimeEntriesComponent', () => {
247
247
uri : 'abc' ,
248
248
} , shouldRestartEntry : true
249
249
} ;
250
- component . entryId = 'new-entry ' ;
250
+ component . entryId = 'entry_1 ' ;
251
251
spyOn ( injectedToastrService , 'error' ) ;
252
252
253
253
component . saveEntry ( newEntry ) ;
@@ -257,6 +257,7 @@ describe('TimeEntriesComponent', () => {
257
257
258
258
it ( 'displays an error when end date of entry is greater than active entry start date' , async ( ) => {
259
259
component . activeTimeEntry = entry ;
260
+
260
261
const newEntry = {
261
262
entry : {
262
263
project_id : 'p-id' ,
@@ -267,7 +268,7 @@ describe('TimeEntriesComponent', () => {
267
268
uri : 'abc' ,
268
269
} , shouldRestartEntry : true
269
270
} ;
270
- component . entryId = 'new-entry ' ;
271
+ component . entryId = 'entry_1 ' ;
271
272
spyOn ( injectedToastrService , 'error' ) ;
272
273
273
274
component . saveEntry ( newEntry ) ;
@@ -349,8 +350,9 @@ describe('TimeEntriesComponent', () => {
349
350
expect ( component . doSave ) . toHaveBeenCalledWith ( entryToSave ) ;
350
351
} ) ) ;
351
352
352
- it ( 'when event contains should restart as true, then a restart Entry action should be triggered' , ( ) => {
353
+ it ( 'when event contains should update as true, then a restart Entry action should be triggered' , ( ) => {
353
354
component . entry = { start_date : new Date ( ) , id : '1234' , technologies : [ ] , project_name : 'time-tracker' } ;
355
+
354
356
const entryToSave = {
355
357
entry : {
356
358
id : '123' ,
@@ -363,12 +365,13 @@ describe('TimeEntriesComponent', () => {
363
365
364
366
} , shouldRestartEntry : false
365
367
} ;
368
+
366
369
component . entryId = '123' ;
367
370
spyOn ( store , 'dispatch' ) ;
368
371
369
372
component . doSave ( entryToSave ) ;
370
373
371
- expect ( store . dispatch ) . toHaveBeenCalledWith ( new entryActions . RestartEntry ( entryToSave . entry ) ) ;
374
+ expect ( store . dispatch ) . toHaveBeenCalledWith ( new entryActions . UpdateEntry ( entryToSave . entry ) ) ;
372
375
} ) ;
373
376
374
377
it ( 'should preload data of last entry when a project is selected while creating new entry ' , waitForAsync ( ( ) => {
0 commit comments