Skip to content

Commit

Permalink
+ Group Lookup test
Browse files Browse the repository at this point in the history
  • Loading branch information
kgibson-spotnana committed Mar 19, 2024
1 parent bbfe6ec commit 19b03c8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions internal/provider/groups_lookup_data_source_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package provider

import (
"regexp"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccDataSourceGroupLookup(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
// Create a new user group and verify that aspects of it are correct
Config: providerConfig + `data "jumpcloud_group_lookup" "g" {
name = "a"
}`,
// Compose multiple test checks to verify the resource
Check: resource.ComposeTestCheckFunc(
resource.TestMatchResourceAttr(
"data.jumpcloud_group_lookup.g",
"groups.#",
regexp.MustCompile(`^0*[1-9]\d*$`)), // regex for a positive integer
),
},
},
})
}

0 comments on commit 19b03c8

Please sign in to comment.