From 8839ee7ddf99651dec2e0cca5468c3e617fa41c4 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Sat, 6 Apr 2024 13:11:02 +0100 Subject: [PATCH] Test `--skip-ssh-key` is captured correctly Signed-off-by: Babak K. Shandiz --- pkg/cmd/auth/login/login_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/cmd/auth/login/login_test.go b/pkg/cmd/auth/login/login_test.go index c5f5f8480..73aec604f 100644 --- a/pkg/cmd/auth/login/login_test.go +++ b/pkg/cmd/auth/login/login_test.go @@ -204,6 +204,23 @@ func Test_NewCmdLogin(t *testing.T) { InsecureStorage: true, }, }, + { + name: "tty skip-ssh-key", + stdinTTY: true, + cli: "--skip-ssh-key", + wants: LoginOptions{ + SkipSSHKeyPrompt: true, + Interactive: true, + }, + }, + { + name: "nontty skip-ssh-key", + cli: "--skip-ssh-key", + wants: LoginOptions{ + Hostname: "github.com", + SkipSSHKeyPrompt: true, + }, + }, } for _, tt := range tests {