Skip to content

Commit

Permalink
refactor tests for data source to use property_type
Browse files Browse the repository at this point in the history
  • Loading branch information
felixlut committed Nov 22, 2024
1 parent 10bb6f0 commit 1e3ba1d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestAccGithubRepositoryCustomPropertiesDataSource(t *testing.T) {
resource "github_repository_custom_property" "test" {
repository = github_repository.test.name
property_name = "%s"
property_type = "single_select"
property_value = ["option1"]
}
data "github_repository_custom_properties" "test" {
Expand Down Expand Up @@ -80,6 +81,7 @@ func TestAccGithubRepositoryCustomPropertiesDataSource(t *testing.T) {
resource "github_repository_custom_property" "test" {
repository = github_repository.test.name
property_name = "%s"
property_type = "multi_select"
property_value = ["option1", "option2"]
}
data "github_repository_custom_properties" "test" {
Expand Down Expand Up @@ -133,6 +135,7 @@ func TestAccGithubRepositoryCustomPropertiesDataSource(t *testing.T) {
resource "github_repository_custom_property" "test" {
repository = github_repository.test.name
property_name = "%s"
property_type = "true_false"
property_value = ["true"]
}
data "github_repository_custom_properties" "test" {
Expand Down Expand Up @@ -175,7 +178,7 @@ func TestAccGithubRepositoryCustomPropertiesDataSource(t *testing.T) {
})
})

t.Run("creates custom property of type single_select without error", func(t *testing.T) {
t.Run("creates custom property of type string without error", func(t *testing.T) {

config := fmt.Sprintf(`
resource "github_repository" "test" {
Expand All @@ -185,6 +188,7 @@ func TestAccGithubRepositoryCustomPropertiesDataSource(t *testing.T) {
resource "github_repository_custom_property" "test" {
repository = github_repository.test.name
property_name = "%s"
property_type = "string"
property_value = ["text"]
}
data "github_repository_custom_properties" "test" {
Expand Down

0 comments on commit 1e3ba1d

Please sign in to comment.