(t *testing.T)
| 352 | } |
| 353 | |
| 354 | func TestHuhPrompterMarkdownEditor(t *testing.T) { |
| 355 | tests := []struct { |
| 356 | name string |
| 357 | blankAllowed bool |
| 358 | ix interaction |
| 359 | wantResult string |
| 360 | }{ |
| 361 | { |
| 362 | name: "selects launch by default", |
| 363 | blankAllowed: true, |
| 364 | ix: newInteraction(enter()), |
| 365 | wantResult: "launch", |
| 366 | }, |
| 367 | { |
| 368 | name: "navigate to skip", |
| 369 | blankAllowed: true, |
| 370 | ix: newInteraction(down(), enter()), |
| 371 | wantResult: "skip", |
| 372 | }, |
| 373 | } |
| 374 | |
| 375 | for _, tt := range tests { |
| 376 | t.Run(tt.name, func(t *testing.T) { |
| 377 | p := newTestHuhPrompter() |
| 378 | f, result := p.buildMarkdownEditorForm("Body:", tt.blankAllowed) |
| 379 | runForm(t, f, tt.ix) |
| 380 | require.Equal(t, tt.wantResult, *result) |
| 381 | }) |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | func TestHuhPrompterMultiSelectWithSearch(t *testing.T) { |
| 386 | staticSearchFunc := func(query string) MultiSelectSearchResult { |
nothing calls this directly
no test coverage detected