From 8684cac33e8a858d56f5d57b8150f281eba9280c Mon Sep 17 00:00:00 2001 From: DXTimer Date: Wed, 17 Jan 2024 14:08:25 +0200 Subject: [PATCH] extend domain delegation tests --- .../domain_delegation_resource_test.go | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/internal/framework/resources/domain_delegation_resource_test.go b/internal/framework/resources/domain_delegation_resource_test.go index 42edfc9..8bbbde5 100644 --- a/internal/framework/resources/domain_delegation_resource_test.go +++ b/internal/framework/resources/domain_delegation_resource_test.go @@ -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), @@ -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) +}