@@ -81,14 +81,14 @@ describe('index', () => {
8181 } ] ;
8282 } ) ;
8383
84- test ( 'should not post previously existing objective ' , async ( ) => {
84+ test ( 'should not post previously existing objectives ' , async ( ) => {
8585 secretsClient . getSecret . mockResolvedValue ( secrets ) ;
8686 smallImprovementsClient . GetObjectives . mockResolvedValue ( activities ) ;
8787 dynamodbClient . getRecord . mockResolvedValue ( dynamoRecords ) ;
8888
8989 const result = await index . handler ( event ) ;
9090
91- expect ( result ) . toBe ( 'Finished 0 successfully. Failed 0' ) ;
91+ expect ( result ) . toBe ( 'Finished 0 successfully. Failed 0. 2 already existed (skipped) ' ) ;
9292 expect ( dynamodbClient . getRecord ) . toHaveBeenCalledWith ( objectiveId ) ;
9393 expect ( dynamodbClient . insertRecord ) . not . toHaveBeenCalled ( ) ;
9494 } ) ;
@@ -105,7 +105,7 @@ describe('index', () => {
105105
106106 const result = await index . handler ( event ) ;
107107
108- expect ( result ) . toBe ( 'Finished 2 successfully. Failed 0' ) ;
108+ expect ( result ) . toBe ( 'Finished 2 successfully. Failed 0. 0 already existed (skipped) ' ) ;
109109 expect ( dynamodbClient . getRecord ) . toHaveBeenCalledWith ( objectiveId ) ;
110110 expect ( dynamodbClient . getRecord ) . toHaveBeenCalledWith ( objectiveId + 'CREATED' ) ;
111111 expect ( dynamodbClient . insertRecord ) . toHaveBeenCalledWith ( activities . items [ 0 ] . items [ 0 ] . activities [ 0 ] , '' ) ;
@@ -139,7 +139,7 @@ describe('index', () => {
139139
140140 const result = await index . handler ( event ) ;
141141
142- expect ( result ) . toBe ( 'Finished 2 successfully. Failed 1' ) ;
142+ expect ( result ) . toBe ( 'Finished 2 successfully. Failed 1. 0 already existed (skipped) ' ) ;
143143 expect ( dynamodbClient . getRecord ) . toHaveBeenCalledWith ( objectiveId ) ;
144144 expect ( dynamodbClient . getRecord ) . toHaveBeenCalledWith ( secondObjectiveId ) ;
145145 expect ( dynamodbClient . getRecord ) . toHaveBeenCalledWith ( objectiveId + 'CREATED' ) ;
0 commit comments