@@ -20,12 +20,15 @@ describe('stacks/main/resources.ts', () => {
2020 it ( 'getLambdaRole' , async ( ) => {
2121 const test = infra . getLambdaRole ( )
2222 const assumeRolePolicy = await promiseOf ( test . assumeRolePolicy )
23- const statement = JSON . parse ( assumeRolePolicy ) . Statement [ 0 ]
23+ const statement = JSON . parse ( assumeRolePolicy ) . statements [ 0 ]
2424
2525 expectTypeOf ( test ) . toEqualTypeOf < aws . iam . Role > ( )
26- expect ( statement . Action ) . toMatch ( 'sts:AssumeRole' )
27- expect ( statement . Effect ) . toMatch ( 'Allow' )
28- expect ( statement . Principal . Service ) . toMatch ( 'lambda.amazonaws.com' )
26+ expect ( statement . actions [ 0 ] ) . toMatch ( 'sts:AssumeRole' )
27+ expect ( statement . effect ) . toMatch ( 'Allow' )
28+ expect ( statement . principals [ 0 ] . identifiers ) . toEqual ( [
29+ 'lambda.amazonaws.com' ,
30+ 'edgelambda.amazonaws.com' ,
31+ ] )
2932 } )
3033
3134 it ( 'validateCertificate-Wrong-Domain' , async ( ) => {
@@ -118,7 +121,6 @@ describe('stacks/main/resources.ts', () => {
118121 // Need to wait for the mocks to update
119122 await new Promise ( ( r ) => setTimeout ( r , 100 ) )
120123
121- console . log ( Object . keys ( mocks . resources ) )
122124 expect ( Object . keys ( mocks . resources ) ) . toHaveLength ( 2 )
123125 const resource = Object . values ( mocks . resources ) [ 0 ]
124126
@@ -173,7 +175,7 @@ describe('stacks/main/resources.ts', () => {
173175 'aws:cloudfront/originAccessControl:OriginAccessControl'
174176 )
175177 expect ( oac . originAccessControlOriginType ) . toMatch ( 's3' )
176- expect ( oac . signingBehavior ) . toMatch ( 'always ' )
178+ expect ( oac . signingBehavior ) . toMatch ( 'no-override ' )
177179 expect ( oac . signingProtocol ) . toMatch ( 'sigv4' )
178180
179181 const distAliases = await promiseOf ( distribution . aliases )
0 commit comments