Skip to content

Commit

Permalink
add test for moving group by removing parent_group_id
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 committed Nov 6, 2024
1 parent a90bf25 commit 3fabd7e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/live/resources/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,35 @@ func TestGroupResource(t *testing.T) {
),
),
},
// Update non root node group back to the root node by removing parent_group_id
{
Config: provider.ProviderConfig + `
resource "uxi_group" "parent" {
name = "tf_provider_acceptance_test_parent_name_updated"
}
resource "uxi_group" "child" {
name = "tf_provider_acceptance_test_child"
parent_group_id = uxi_group.parent.id
}
# move grandchild from parent to root
resource "uxi_group" "grandchild" {
name = "tf_provider_acceptance_test_grandchild_moved_to_root"
}`,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr(
"uxi_group.grandchild",
"name",
"tf_provider_acceptance_test_grandchild_moved_to_root",
),
resource.TestCheckResourceAttr(
"uxi_group.grandchild",
"parent_group_id",
rootGroup.Id,
),
),
},
// Deletes happen automatically
},
})
Expand Down

0 comments on commit 3fabd7e

Please sign in to comment.