@@ -498,9 +498,9 @@ describe("Event modification tests", async () => {
498498 const ourError = new Error ( "Nonexistent event." ) ;
499499 ourError . name = "ConditionalCheckFailedException" ;
500500 ddbMock
501- . on ( UpdateItemCommand , {
501+ . on ( PutItemCommand , {
502502 TableName : genericConfig . EventsDynamoTableName ,
503- Key : { id : { S : eventUuid } } ,
503+ Item : { id : { S : eventUuid } } ,
504504 } )
505505 . rejects ( ourError ) ;
506506 const testJwt = createJwt ( ) ;
@@ -509,7 +509,12 @@ describe("Event modification tests", async () => {
509509 . patch ( `/api/v1/events/${ eventUuid } ` )
510510 . set ( "authorization" , `Bearer ${ testJwt } ` )
511511 . send ( {
512- paidEventId : "sp24_semiformal_2" ,
512+ description : "First test event" ,
513+ host : "Social Committee" ,
514+ location : "Siebel Center" ,
515+ start : "2024-09-25T18:00:00" ,
516+ title : "Event 1" ,
517+ featured : false ,
513518 } ) ;
514519
515520 expect ( response . statusCode ) . toBe ( 404 ) ;
@@ -531,19 +536,16 @@ describe("Event modification tests", async () => {
531536 } ;
532537 ddbMock . reset ( ) ;
533538 ddbMock
534- . on ( UpdateItemCommand , {
539+ . on ( PutItemCommand , {
535540 TableName : genericConfig . EventsDynamoTableName ,
536- Key : { id : { S : eventUuid } } ,
537541 } )
538542 . resolves ( { Attributes : marshall ( event ) } ) ;
539543 const testJwt = createJwt ( ) ;
540544 await app . ready ( ) ;
541545 const response = await supertest ( app . server )
542546 . patch ( `/api/v1/events/${ eventUuid } ` )
543547 . set ( "authorization" , `Bearer ${ testJwt } ` )
544- . send ( {
545- paidEventId : "sp24_semiformal_2" ,
546- } ) ;
548+ . send ( event ) ;
547549
548550 expect ( response . statusCode ) . toBe ( 201 ) ;
549551 expect ( response . header [ "location" ] ) . toBeDefined ( ) ;
0 commit comments