Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion internal/provider/organization_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ This resource is only compatible with Coder version [2.16.0](https://github.com/
MarkdownDescription: "Display name of the organization. Defaults to name.",
Computed: true,
Optional: true,
Default: stringdefault.StaticString(""),
Validators: []validator.String{
codersdkvalidator.DisplayName(),
},
Expand Down
23 changes: 23 additions & 0 deletions internal/provider/organization_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,29 @@ func TestAccOrganizationResource(t *testing.T) {
},
})
})

t.Run("DefaultDisplayName", func(t *testing.T) {
cfg1 := testAccOrganizationResourceConfig{
URL: client.URL.String(),
Token: client.SessionToken(),
Name: ptr.Ref("example-org"),
Description: ptr.Ref("This is an example organization"),
Icon: ptr.Ref("/icon/coder.svg"),
}
resource.Test(t, resource.TestCase{
IsUnitTest: true,
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: cfg1.String(t),
ConfigStateChecks: []statecheck.StateCheck{
statecheck.ExpectKnownValue("coderd_organization.test", tfjsonpath.New("display_name"), knownvalue.StringExact("example-org")),
},
},
},
})
})
}

type testAccOrganizationResourceConfig struct {
Expand Down