summaryrefslogtreecommitdiff
path: root/go/internal/command/command_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/internal/command/command_test.go')
-rw-r--r--go/internal/command/command_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/go/internal/command/command_test.go b/go/internal/command/command_test.go
index 02fc0d0..42c5112 100644
--- a/go/internal/command/command_test.go
+++ b/go/internal/command/command_test.go
@@ -6,6 +6,7 @@ import (
"github.com/stretchr/testify/assert"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/discover"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/fallback"
+ "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/twofactorrecover"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/testhelper"
)
@@ -44,6 +45,19 @@ func TestNew(t *testing.T) {
},
expectedType: &fallback.Command{},
},
+ {
+ desc: "it returns a TwoFactorRecover command if the feature is enabled",
+ arguments: []string{},
+ config: &config.Config{
+ GitlabUrl: "http+unix://gitlab.socket",
+ Migration: config.MigrationConfig{Enabled: true, Features: []string{"2fa_recovery_codes"}},
+ },
+ environment: map[string]string{
+ "SSH_CONNECTION": "1",
+ "SSH_ORIGINAL_COMMAND": "2fa_recovery_codes",
+ },
+ expectedType: &twofactorrecover.Command{},
+ },
}
for _, tc := range testCases {