@aws-cdk/assert#ABSENT TypeScript Examples

The following examples show how to use @aws-cdk/assert#ABSENT. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: auth-stack.test.ts    From MDDL with MIT License 6 votes vote down vote up
test('Default Stack', () => {
  const app = new cdk.App()
  // WHEN
  const name = 'test-user-pool'
  const stack = new AuthStack(app, 'MyTestAuthStack', {
    userPoolName: name,
  })
  // THEN
  expectCDK(stack).to(
    haveResource('AWS::Cognito::UserPool', {
      UserPoolName: name,
      Schema: (arr: any[]) => arr.length == 6,
      UsernameConfiguration: {
        CaseSensitive: false,
      },
      EmailConfiguration: ABSENT,
      AutoVerifiedAttributes: ['email'],
    }),
  )
  expectCDK(stack).to(
    haveResource(
      'AWS::Cognito::UserPool',
      {
        DeletionPolicy: 'Retain',
      },
      ResourcePart.CompleteDefinition,
    ),
  )
  expectCDK(stack).to(
    haveResource('AWS::Cognito::UserPoolUICustomizationAttachment', {
      ClientId: 'ALL',
    }),
  )
  expectCDK(stack).to(countResources('AWS::Cognito::UserPoolDomain', 0))
  expectCDK(stack).to(countResources('AWS::SNS::Topic', 3))
})