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

Function TestHuhPrompterMarkdownEditor

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

Source from the content-addressed store, hash-verified

394}
395
396func TestHuhPrompterMarkdownEditor(t *testing.T) {
397 tests := []struct {
398 name string
399 blankAllowed bool
400 ix interaction
401 wantResult string
402 }{
403 {
404 name: "selects launch by default",
405 blankAllowed: true,
406 ix: newInteraction(enter()),
407 wantResult: "launch",
408 },
409 {
410 name: "navigate to skip",
411 blankAllowed: true,
412 ix: newInteraction(down(), enter()),
413 wantResult: "skip",
414 },
415 }
416
417 for _, tt := range tests {
418 t.Run(tt.name, func(t *testing.T) {
419 p := newTestHuhPrompter()
420 f, result := p.buildMarkdownEditorForm("Body:", tt.blankAllowed)
421 runForm(t, f, tt.ix)
422 require.Equal(t, tt.wantResult, *result)
423 })
424 }
425}
426
427func TestHuhPrompterMultiSelectWithSearch(t *testing.T) {
428 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