fix: return empty array if no option multi-selected (#19224)

Related: https://github.com/coder/coder/issues/19145
This commit is contained in:
Marcin Tojek
2025-08-07 11:37:58 +00:00
committed by GitHub
parent 91780db1fe
commit 2851d9f3ea
2 changed files with 16 additions and 1 deletions
+11
View File
@@ -111,6 +111,17 @@ func TestRichMultiSelect(t *testing.T) {
allowCustom: true,
want: []string{"aaa", "bbb"},
},
{
name: "NoOptionSelected",
options: []codersdk.TemplateVersionParameterOption{
{Name: "AAA", Description: "This is AAA", Value: "aaa"},
{Name: "BBB", Description: "This is BBB", Value: "bbb"},
{Name: "CCC", Description: "This is CCC", Value: "ccc"},
},
defaults: []string{},
allowCustom: false,
want: []string{},
},
}
for _, tt := range tests {