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

Function TestHuhPrompterPassword

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

Source from the content-addressed store, hash-verified

324}
325
326func TestHuhPrompterPassword(t *testing.T) {
327 tests := []struct {
328 name string
329 ix interaction
330 wantResult string
331 }{
332 {
333 name: "basic password",
334 ix: newInteraction(typeKeys("s3cret"), enter()),
335 wantResult: "s3cret",
336 },
337 {
338 name: "empty password",
339 ix: newInteraction(enter()),
340 wantResult: "",
341 },
342 }
343
344 for _, tt := range tests {
345 t.Run(tt.name, func(t *testing.T) {
346 p := newTestHuhPrompter()
347 f, result := p.buildPasswordForm("Password:")
348 runForm(t, f, tt.ix)
349 require.Equal(t, tt.wantResult, *result)
350 })
351 }
352}
353
354func TestHuhPrompterMarkdownEditor(t *testing.T) {
355 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