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

Function TestHuhPrompterPassword

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

Source from the content-addressed store, hash-verified

366}
367
368func TestHuhPrompterPassword(t *testing.T) {
369 tests := []struct {
370 name string
371 ix interaction
372 wantResult string
373 }{
374 {
375 name: "basic password",
376 ix: newInteraction(typeKeys("s3cret"), enter()),
377 wantResult: "s3cret",
378 },
379 {
380 name: "empty password",
381 ix: newInteraction(enter()),
382 wantResult: "",
383 },
384 }
385
386 for _, tt := range tests {
387 t.Run(tt.name, func(t *testing.T) {
388 p := newTestHuhPrompter()
389 f, result := p.buildPasswordForm("Password:")
390 runForm(t, f, tt.ix)
391 require.Equal(t, tt.wantResult, *result)
392 })
393 }
394}
395
396func TestHuhPrompterMarkdownEditor(t *testing.T) {
397 tests := []struct {

Callers

nothing calls this directly

Calls 8

newInteractionFunction · 0.85
typeKeysFunction · 0.85
enterFunction · 0.85
newTestHuhPrompterFunction · 0.85
runFormFunction · 0.85
buildPasswordFormMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected