From c477658eaf252fdea67ea931450ae161a90fba38 Mon Sep 17 00:00:00 2001 From: Danielle Adams Date: Tue, 26 Apr 2022 15:51:31 -0400 Subject: [PATCH] fix: update snapshots to match double colon --- .../src/__tests__/__snapshots__/api_2.test.ts.snap | 14 ++------------ .../amplify-e2e-tests/src/__tests__/api_2.test.ts | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/amplify-e2e-tests/src/__tests__/__snapshots__/api_2.test.ts.snap b/packages/amplify-e2e-tests/src/__tests__/__snapshots__/api_2.test.ts.snap index df843fff449..46f22685788 100644 --- a/packages/amplify-e2e-tests/src/__tests__/__snapshots__/api_2.test.ts.snap +++ b/packages/amplify-e2e-tests/src/__tests__/__snapshots__/api_2.test.ts.snap @@ -12,12 +12,8 @@ $util.unauthorized() #if( $util.authType() == \\"User Pool Authorization\\" ) #if( !$isAuthorized ) #set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.owner, null) ) - #set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") ) - #set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) ) - #set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" ) + #set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) ) #set( $ownerClaimsList0 = [] ) - $util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\"))) - $util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")))) #set( $ownerAllowedFields0 = [\\"id\\",\\"content\\"] ) #set( $isAuthorizedOnAllFields0 = true ) #if( $ownerClaim0 == $ownerEntity0 || $ownerClaimsList0.contains($ownerEntity0) ) @@ -68,12 +64,8 @@ $util.unauthorized() #if( $util.authType() == \\"User Pool Authorization\\" ) #if( !$isAuthorized ) #set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.owner, null) ) - #set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\") ) - #set( $currentClaim1 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) ) - #set( $ownerClaim0 = \\"$ownerClaim0:$currentClaim1\\" ) + #set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) ) #set( $ownerClaimsList0 = [] ) - $util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"sub\\"), \\"___xamznone____\\"))) - $util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")))) #set( $ownerAllowedFields0 = [\\"id\\",\\"content\\"] ) #set( $isAuthorizedOnAllFields0 = true ) #if( $ownerClaim0 == $ownerEntity0 || $ownerClaimsList0.contains($ownerEntity0) ) @@ -120,7 +112,6 @@ $util.unauthorized() #set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.owner, null) ) #set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) ) #set( $ownerClaimsList0 = [] ) - $util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")))) #set( $ownerAllowedFields0 = [\\"id\\",\\"content\\"] ) #set( $isAuthorizedOnAllFields0 = true ) #if( $ownerClaim0 == $ownerEntity0 || $ownerClaimsList0.contains($ownerEntity0) ) @@ -173,7 +164,6 @@ $util.unauthorized() #set( $ownerEntity0 = $util.defaultIfNull($ctx.args.input.owner, null) ) #set( $ownerClaim0 = $util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")) ) #set( $ownerClaimsList0 = [] ) - $util.qr($ownerClaimsList0.add($util.defaultIfNull($ctx.identity.claims.get(\\"username\\"), $util.defaultIfNull($ctx.identity.claims.get(\\"cognito:username\\"), \\"___xamznone____\\")))) #set( $ownerAllowedFields0 = [\\"id\\",\\"content\\"] ) #set( $isAuthorizedOnAllFields0 = true ) #if( $ownerClaim0 == $ownerEntity0 || $ownerClaimsList0.contains($ownerEntity0) ) diff --git a/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts b/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts index 36f5530cd4e..8b350996a83 100644 --- a/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts +++ b/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts @@ -308,7 +308,7 @@ describe('amplify add api (GraphQL)', () => { expect(beforeAdminConfig).not.toEqual(afterAdminConfig); }); - it.only('init a project and add custom iam roles - local test with gql v2 w/ identity claim feature flag disabled', async () => { + it('init a project and add custom iam roles - local test with gql v2 w/ identity claim feature flag disabled', async () => { const name = 'customadminroles'; await initJSProjectWithProfile(projRoot, { name }); await addFeatureFlag(projRoot, 'graphqltransformer', 'useSubUsernameForDefaultIdentityClaim', false);