Skip to content

Commit 3e5591e

Browse files
committed
chore: extra checks
1 parent 1776ca4 commit 3e5591e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

internal/services/argo_smart_routing/resource_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ package argo_smart_routing_test
22

33
import (
44
"fmt"
5+
"github.com/hashicorp/terraform-plugin-testing/knownvalue"
6+
"github.com/hashicorp/terraform-plugin-testing/plancheck"
7+
"github.com/hashicorp/terraform-plugin-testing/tfjsonpath"
58
"os"
69
"regexp"
710
"testing"
@@ -31,13 +34,33 @@ func TestAccCloudflareArgoSmartRouting_Basic(t *testing.T) {
3134
resource.TestCheckResourceAttr(name, "value", "on"),
3235
),
3336
},
37+
{
38+
Config: testAccCheckCloudflareArgoSmartRoutingEnable(zoneID, rnd),
39+
Check: resource.ComposeTestCheckFunc(
40+
resource.TestCheckResourceAttr(name, "id", zoneID),
41+
resource.TestCheckResourceAttr(name, "zone_id", zoneID),
42+
resource.TestCheckResourceAttr(name, "value", "on"),
43+
),
44+
PlanOnly: true,
45+
ExpectNonEmptyPlan: false,
46+
},
3447
{
3548
Config: testAccCheckCloudflareArgoSmartRoutingDisable(zoneID, rnd),
3649
Check: resource.ComposeTestCheckFunc(
3750
resource.TestCheckResourceAttr(name, "id", zoneID),
3851
resource.TestCheckResourceAttr(name, "zone_id", zoneID),
3952
resource.TestCheckResourceAttr(name, "value", "off"),
4053
),
54+
ConfigPlanChecks: resource.ConfigPlanChecks{
55+
PreApply: []plancheck.PlanCheck{
56+
plancheck.ExpectResourceAction(name, plancheck.ResourceActionUpdate),
57+
plancheck.ExpectKnownValue(
58+
name,
59+
tfjsonpath.New("value"),
60+
knownvalue.StringExact("off"),
61+
),
62+
},
63+
},
4164
},
4265
{
4366
ResourceName: name,

0 commit comments

Comments
 (0)