Skip to content

Commit

Permalink
Teardown partials in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Christenson II committed Feb 2, 2024
1 parent c75370e commit bf26f60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions internal/auth0/prompt/resource_partials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func TestAccPromptPartials(t *testing.T) {
_ = givenACustomDomain(t)
_ = givenAUniversalLogin(t)

t.Cleanup(func() {
cleanupPartialsPrompt(t, management.PartialsPromptSegment("login"))
})

acctest.Test(t, resource.TestCase{
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -95,6 +99,13 @@ func cleanupUniversalLogin(t *testing.T) {
assert.NoError(t, err)
}

func cleanupPartialsPrompt(t *testing.T, prompt management.PartialsPromptSegment) {
t.Helper()

err := manager.Prompt.DeletePartials(context.Background(), &management.PartialsPrompt{Segment: prompt})
assert.NoError(t, err)
}

const testAccPromptPartialsCreate = `
resource "auth0_prompt_partials" "prompt_partials" {
prompt = "login"
Expand Down
4 changes: 2 additions & 2 deletions test/data/recordings/TestAccPromptPartials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 222.968333ms
duration: 221.101125ms
- id: 1
request:
proto: HTTP/1.1
Expand Down Expand Up @@ -72,4 +72,4 @@ interactions:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 203.252792ms
duration: 235.378875ms

0 comments on commit bf26f60

Please sign in to comment.