MCPcopy Index your code
hub / github.com/cli/cli / TestHuhPrompterMarkdownEditor

Function TestHuhPrompterMarkdownEditor

internal/prompter/huh_prompter_test.go:354–383  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

352}
353
354func 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
385func TestHuhPrompterMultiSelectWithSearch(t *testing.T) {
386 staticSearchFunc := func(query string) MultiSelectSearchResult {

Callers

nothing calls this directly

Calls 8

newInteractionFunction · 0.85
enterFunction · 0.85
downFunction · 0.85
newTestHuhPrompterFunction · 0.85
runFormFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected