@@ -28,6 +28,7 @@ jest.mocked(logger).child.mockReturnThis();
2828const versionId = 'template-version-id' ;
2929const templateId = 'template-id' ;
3030const userId = 'template-owner' ;
31+ const clientId = 'client-id' ;
3132
3233function setup ( ) {
3334 const mocks = {
@@ -148,8 +149,6 @@ describe('guard duty handler', () => {
148149 test ( 'validates a client-owned template' , async ( ) => {
149150 const { handler, mocks } = setup ( ) ;
150151
151- const clientId = 'clientid' ;
152-
153152 const event = makeGuardDutyMalwareScanResultNotificationEvent ( {
154153 detail : {
155154 s3ObjectDetails : {
@@ -221,7 +220,7 @@ describe('guard duty handler', () => {
221220 expect (
222221 mocks . templateRepository . setLetterValidationResult
223222 ) . toHaveBeenCalledWith (
224- { id : templateId , owner : `CLIENT# ${ clientId } ` , clientOwned : true } ,
223+ { id : templateId , owner : clientId , clientOwned : true } ,
225224 versionId ,
226225 true ,
227226 pdf . personalisationParameters ,
@@ -1018,7 +1017,7 @@ describe('guard duty handler', () => {
10181017 detail : {
10191018 s3ObjectDetails : {
10201019 bucketName : 'quarantine-bucket' ,
1021- objectKey : `pdf-template/${ userId } /${ templateId } /${ versionId } .pdf` ,
1020+ objectKey : `pdf-template/${ clientId } /${ templateId } /${ versionId } .pdf` ,
10221021 } ,
10231022 scanResultDetails : {
10241023 scanResultStatus : 'NO_THREATS_FOUND' ,
@@ -1066,7 +1065,7 @@ describe('guard duty handler', () => {
10661065 detail : {
10671066 s3ObjectDetails : {
10681067 bucketName : 'quarantine-bucket' ,
1069- objectKey : `pdf-template/${ userId } /${ templateId } /${ versionId } .pdf` ,
1068+ objectKey : `pdf-template/${ clientId } /${ templateId } /${ versionId } .pdf` ,
10701069 } ,
10711070 scanResultDetails : {
10721071 scanResultStatus : 'NO_THREATS_FOUND' ,
0 commit comments