Skip to content

Commit

Permalink
Fixed test recording
Browse files Browse the repository at this point in the history
  • Loading branch information
duedares-rvj committed Jan 14, 2025
1 parent 4585438 commit a84c35c
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 233 deletions.
31 changes: 11 additions & 20 deletions internal/auth0/client/data_source_clients_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ data "auth0_clients" "test" {
auth0_client.my_client_1,
auth0_client.my_client_2
]
name_filter = "{{.testName}}"
name_filter = "1 - {{.testName}}"
}
`

Expand All @@ -44,7 +43,7 @@ data "auth0_clients" "test" {
auth0_client.my_client_2
]
name_filter = "{{.testName}}"
name_filter = "{{.testName}}"
app_types = ["non_interactive"]
}
`
Expand All @@ -56,7 +55,7 @@ data "auth0_clients" "test" {
auth0_client.my_client_2
]
name_filter = "{{.testName}}"
name_filter = "{{.testName}}"
is_first_party = true
}
`
Expand All @@ -76,25 +75,17 @@ func TestAccDataClients(t *testing.T) {
`expected app_types\.0 to be one of \["native" "spa" "regular_web" "non_interactive" "rms" "box" "cloudbees" "concur" "dropbox" "mscrm" "echosign" "egnyte" "newrelic" "office365" "salesforce" "sentry" "sharepoint" "slack" "springcm" "sso_integration" "zendesk" "zoom"\], got invalid`,
),
},
{
Config: acctest.ParseTestName(testAccGivenSomeClients, t.Name()),
},
//{
// Config: acctest.ParseTestName(testAccGivenSomeClients, t.Name()),
//},
{
Config: acctest.ParseTestName(testAccGivenSomeClients+testAccDataClientsWithNameFilter, t.Name()),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckTypeSetElemNestedAttrs("data.auth0_clients.test", "clients.*", map[string]string{
"name": fmt.Sprintf("Acceptance Test 1 - %s", t.Name()),
"app_type": "non_interactive",
"is_first_party": "true",
"description": fmt.Sprintf("Description for client 1 %s", t.Name()),
}),
resource.TestCheckTypeSetElemNestedAttrs("data.auth0_clients.test", "clients.*", map[string]string{
"name": fmt.Sprintf("Acceptance Test 2 - %s", t.Name()),
"app_type": "spa",
"is_first_party": "false",
"description": fmt.Sprintf("Description for client 2 %s", t.Name()),
}),
),
resource.TestCheckResourceAttr("data.auth0_clients.test", "clients.#", "1"),
resource.TestCheckResourceAttr("data.auth0_clients.test", "clients.0.name", fmt.Sprintf("Acceptance Test 1 - %v", t.Name())),
resource.TestCheckResourceAttr("data.auth0_clients.test", "clients.0.app_type", "non_interactive"),
resource.TestCheckResourceAttr("data.auth0_clients.test", "clients.0.is_first_party", "true"),
resource.TestCheckResourceAttr("data.auth0_clients.test", "clients.0.description", fmt.Sprintf("Description for client 1 %s", t.Name()))),
},
{
Config: acctest.ParseTestName(testAccGivenSomeClients+testAccDataClientsWithAppTypeFilter, t.Name()),
Expand Down
Loading

0 comments on commit a84c35c

Please sign in to comment.