Sentence case 'Other' option in hostname prompt

This commit is contained in:
Tyler McGoffin 2024-09-20 13:55:20 -07:00
parent 46790977bb
commit bc587f6576
2 changed files with 6 additions and 6 deletions

View file

@ -226,7 +226,7 @@ func loginRun(opts *LoginOptions) error {
}
func promptForHostname(opts *LoginOptions) (string, error) {
options := []string{"GitHub.com", "other"}
options := []string{"GitHub.com", "Other"}
hostType, err := opts.Prompter.Select(
"What account do you want to log into?",
options[0],

View file

@ -547,7 +547,7 @@ func Test_loginRun_Survey(t *testing.T) {
wantErrOut: regexp.MustCompile("Tip: you can generate a Personal Access Token here https://rebecca.chambers/settings/tokens"),
},
{
name: "choose other",
name: "choose Other",
wantHosts: heredoc.Doc(`
brad.vickers:
users:
@ -565,7 +565,7 @@ func Test_loginRun_Survey(t *testing.T) {
pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) {
switch prompt {
case "What account do you want to log into?":
return prompter.IndexFor(opts, "other")
return prompter.IndexFor(opts, "Other")
case "What is your preferred protocol for Git operations on this host?":
return prompter.IndexFor(opts, "HTTPS")
case "How would you like to authenticate GitHub CLI?":
@ -816,15 +816,15 @@ func Test_promptForHostname(t *testing.T) {
expect string
}{
{
name: "select GitHub.com",
name: "select 'GitHub.com'",
selectedIndex: 0,
expectedSelection: "GitHub.com",
expect: "github.com",
},
{
name: "select other",
name: "select 'Other'",
selectedIndex: 1,
expectedSelection: "other",
expectedSelection: "Other",
inputHostname: "github.enterprise.com",
expect: "github.enterprise.com",
},