MCPcopy Index your code
hub / github.com/coder/coder / TestRichSelect

Function TestRichSelect

cli/cliui/select_test.go:46–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestRichSelect(t *testing.T) {
47 t.Parallel()
48 t.Run("RichSelect", func(t *testing.T) {
49 t.Parallel()
50 ptty := ptytest.New(t)
51 msgChan := make(chan string)
52 go func() {
53 resp, err := newRichSelect(ptty, cliui.RichSelectOptions{
54 Options: []codersdk.TemplateVersionParameterOption{
55 {Name: "A-Name", Value: "A-Value", Description: "A-Description."},
56 {Name: "B-Name", Value: "B-Value", Description: "B-Description."},
57 },
58 })
59 assert.NoError(t, err)
60 msgChan <- resp
61 }()
62 require.Equal(t, "A-Value", <-msgChan)
63 })
64}
65
66func newRichSelect(ptty *ptytest.PTY, opts cliui.RichSelectOptions) (string, error) {
67 value := ""

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
newRichSelectFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected