(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func 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 | |
| 66 | func newRichSelect(ptty *ptytest.PTY, opts cliui.RichSelectOptions) (string, error) { |
| 67 | value := "" |
nothing calls this directly
no test coverage detected