(t *testing.T)
| 556 | } |
| 557 | |
| 558 | func TestHuhPrompterInputHostname(t *testing.T) { |
| 559 | tests := []struct { |
| 560 | name string |
| 561 | ix interaction |
| 562 | wantResult string |
| 563 | }{ |
| 564 | { |
| 565 | name: "accepts valid hostname", |
| 566 | ix: newInteraction(typeKeys("github.example.com"), enter()), |
| 567 | wantResult: "github.example.com", |
| 568 | }, |
| 569 | { |
| 570 | name: "rejects blank then accepts valid hostname", |
| 571 | ix: newInteraction(enter(), typeKeys("github.example.com"), enter()), |
| 572 | wantResult: "github.example.com", |
| 573 | }, |
| 574 | } |
| 575 | |
| 576 | for _, tt := range tests { |
| 577 | t.Run(tt.name, func(t *testing.T) { |
| 578 | p := newTestHuhPrompter() |
| 579 | f, result := p.buildInputHostnameForm() |
| 580 | runForm(t, f, tt.ix) |
| 581 | require.Equal(t, tt.wantResult, *result) |
| 582 | }) |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | func TestHuhPrompterMultiSelectWithSearchBackspace(t *testing.T) { |
| 587 | // Simulate real API latency and non-overlapping results. |
nothing calls this directly
no test coverage detected