Skip to content

Commit 66d82c9

Browse files
authored
test: parameter description contains Markdown (coder#94)
* feat: Add description_markdown property to rich parameter * EOT * test: parameter description contains Markdown
1 parent 22f160d commit 66d82c9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

examples/resources/coder_parameter/resource.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ data "coder_parameter" "example" {
1717

1818
data "coder_parameter" "ami" {
1919
name = "Machine Image"
20+
description = <<-EOT
21+
# Provide the machine image
22+
See the [registry](https://container.registry.blah/namespace) for options.
23+
EOT
2024
option {
2125
value = "ami-xxxxxxxx"
2226
name = "Ubuntu"
@@ -26,14 +30,15 @@ data "coder_parameter" "ami" {
2630

2731
data "coder_parameter" "is_public_instance" {
2832
name = "Is public instance?"
29-
icon = "/icon/docker.svg"
3033
type = "bool"
34+
icon = "/icon/docker.svg"
3135
default = false
3236
}
3337

3438
data "coder_parameter" "cores" {
3539
name = "CPU Cores"
36-
icon = "/icon/"
40+
type = "number"
41+
icon = "/icon/cpu.svg"
3742
default = 3
3843
}
3944

@@ -50,7 +55,7 @@ data "coder_parameter" "disk_size" {
5055
}
5156

5257
data "coder_parameter" "cat_lives" {
53-
name = "Cat Live"
58+
name = "Cat Lives"
5459
type = "number"
5560
default = "9"
5661
validation {

provider/parameter_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ func TestParameter(t *testing.T) {
2424
data "coder_parameter" "region" {
2525
name = "Region"
2626
type = "string"
27-
description = "Some option!"
27+
description = <<-EOT
28+
# Select the machine image
29+
See the [registry](https://container.registry.blah/namespace) for options.
30+
EOT
2831
mutable = true
2932
icon = "/icon/region.svg"
3033
option {
@@ -46,7 +49,7 @@ data "coder_parameter" "region" {
4649
for key, value := range map[string]interface{}{
4750
"name": "Region",
4851
"type": "string",
49-
"description": "Some option!",
52+
"description": "# Select the machine image\nSee the [registry](https://container.registry.blah/namespace) for options.\n",
5053
"mutable": "true",
5154
"icon": "/icon/region.svg",
5255
"option.0.name": "US Central",

0 commit comments

Comments
 (0)