Skip to content

Commit

Permalink
extend domain delegation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DXTimer committed Jan 17, 2024
1 parent f36ae09 commit 8684cac
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions internal/framework/resources/domain_delegation_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ func TestAccDomainDelegationResource(t *testing.T) {
resource.TestCheckTypeSetElemAttr(resourceName, "name_servers.*", "ns-1556.awsdns-02.co.uk"),
),
},
{
Config: testAccDomainDelegationResourceConfigReversed(domainId),
ExpectNonEmptyPlan: false,
PlanOnly: true,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttrSet(resourceName, "id"),
resource.TestCheckResourceAttr(resourceName, "domain", domainId),
resource.TestCheckResourceAttr(resourceName, "name_servers.#", "2"),
resource.TestCheckTypeSetElemAttr(resourceName, "name_servers.*", "ns-998.awsdns-60.net"),
resource.TestCheckTypeSetElemAttr(resourceName, "name_servers.*", "ns-1556.awsdns-02.co.uk"),
),
},
{
ResourceName: resourceName,
ImportStateIdFunc: testAccDomainDelegationImportStateIDFunc(resourceName),
Expand Down Expand Up @@ -69,3 +81,11 @@ resource "dnsimple_domain_delegation" "test" {
name_servers = ["ns-998.awsdns-60.net", "ns-1556.awsdns-02.co.uk"]
}`, domainId)
}

func testAccDomainDelegationResourceConfigReversed(domainId string) string {
return fmt.Sprintf(`
resource "dnsimple_domain_delegation" "test" {
domain = %[1]q
name_servers = ["ns-1556.awsdns-02.co.uk", "ns-998.awsdns-60.net"]
}`, domainId)
}

0 comments on commit 8684cac

Please sign in to comment.