(t *testing.T)
| 366 | } |
| 367 | |
| 368 | func 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 | |
| 396 | func TestHuhPrompterMarkdownEditor(t *testing.T) { |
| 397 | tests := []struct { |
nothing calls this directly
no test coverage detected