Skip to content

Commit

Permalink
add another disappears test
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 committed Sep 1, 2020
1 parent 7e4520c commit cdc0315
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions aws/resource_aws_cognito_user_pool_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,29 @@ func TestAccAWSCognitoUserPoolClient_disappears(t *testing.T) {
})
}

func TestAccAWSCognitoUserPoolClient_disappears_userPool(t *testing.T) {
var client cognitoidentityprovider.UserPoolClientType
userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", acctest.RandString(7))
clientName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
resourceName := "aws_cognito_user_pool_client.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSCognitoUserPoolClientConfig_basic(userPoolName, clientName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSCognitoUserPoolClientExists(resourceName, &client),
testAccCheckResourceDisappears(testAccProvider, resourceAwsCognitoUserPool(), "aws_cognito_user_pool.test"),
),
ExpectNonEmptyPlan: true,
},
},
})
}

func testAccAWSCognitoUserPoolClientImportStateIDFunc(resourceName string) resource.ImportStateIdFunc {
return func(s *terraform.State) (string, error) {
rs, ok := s.RootModule().Resources[resourceName]
Expand Down

0 comments on commit cdc0315

Please sign in to comment.