Skip to content

Commit

Permalink
fix(iam): add 12-digits validation for AccountPrincipal -fix double q…
Browse files Browse the repository at this point in the history
…uotes strings
  • Loading branch information
duranbe committed Jun 15, 2024
1 parent bb2e20d commit 5cef145
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/aws-cdk-lib/aws-iam/test/principals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,19 @@ describe('deprecated ServicePrincipal behavior', () => {
});

test('Passing string with invalid pattern in AccountPrincipal constructor should throw error', () => {
<<<<<<< Updated upstream
expect(() => new iam.AccountPrincipal("123456")).toThrowError('accountId should be of type string and be composed of 12 digits');
});

test('Passing string with only letters in AccountPrincipal constructor should throw error', () => {
expect(() => new iam.AccountPrincipal("test")).toThrowError('accountId should be of type string and be composed of 12 digits');
=======
expect(() => new iam.AccountPrincipal('123456')).toThrowError('accountId should be of type string and be composed of 12 digits');
});

test('Passing string with only letters in AccountPrincipal constructor should throw error', () => {
expect(() => new iam.AccountPrincipal('test')).toThrowError('accountId should be of type string and be composed of 12 digits');
>>>>>>> Stashed changes
});

test('ServicePrincipal in agnostic stack generates lookup table', () => {
Expand Down

0 comments on commit 5cef145

Please sign in to comment.