Skip to content
4 changes: 2 additions & 2 deletions cmd/app/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
var runAddCommandFunc = RunAddCommand
var appInstallProdAppFunc = apps.Add
var appInstallDevAppFunc = apps.InstallLocalApp
var teamAppSelectPromptFunc = prompts.TeamAppSelectPrompt
var appSelectPromptFunc = prompts.AppSelectPrompt

// Flags

Expand Down Expand Up @@ -111,7 +111,7 @@ func preRunAddCommand(ctx context.Context, clients *shared.ClientFactory) error
// RunAddCommand executes the workspace install command, prints output, and returns any errors.
func RunAddCommand(ctx context.Context, clients *shared.ClientFactory, selection *prompts.SelectedApp, orgGrantWorkspaceID string) (context.Context, types.InstallState, types.App, error) {
if selection == nil {
selected, err := teamAppSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowAllApps)
selected, err := appSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowAllApps)
if err != nil {
return ctx, "", types.App{}, err
}
Expand Down
24 changes: 12 additions & 12 deletions cmd/app/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ func TestAppAddCommand(t *testing.T) {

// Mock TeamSelector prompt to return "team1"
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{Auth: mockAuthTeam1}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowAllApps).Return(prompts.SelectedApp{Auth: mockAuthTeam1}, nil)

// Mock valid session for team1
cm.API.On("ValidateSession", mock.Anything, mock.Anything).Return(api.AuthSession{
Expand Down Expand Up @@ -212,8 +212,8 @@ func TestAppAddCommand(t *testing.T) {

// Mock TeamSelector prompt to return "team1"
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: mockAppTeam1, Auth: mockAuthTeam1}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowAllApps).Return(prompts.SelectedApp{App: mockAppTeam1, Auth: mockAuthTeam1}, nil)

// Mock valid session for team1
cm.API.On("ValidateSession", mock.Anything, mock.Anything).Return(api.AuthSession{
Expand Down Expand Up @@ -292,8 +292,8 @@ func TestAppAddCommand(t *testing.T) {
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
prepareAddMocks(t, cf, cm)
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: mockAppTeam1}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowAllApps).Return(prompts.SelectedApp{App: mockAppTeam1}, nil)
},
},
"adds a new deployed app to an org with a workspace grant": {
Expand All @@ -303,8 +303,8 @@ func TestAppAddCommand(t *testing.T) {
prepareAddMocks(t, cf, cm)
// Select workspace
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: types.NewApp(), Auth: mockOrgAuth}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowAllApps).Return(prompts.SelectedApp{App: types.NewApp(), Auth: mockOrgAuth}, nil)
// Mock calls
cm.API.On("ValidateSession", mock.Anything, mock.Anything).Return(api.AuthSession{
UserID: &mockOrgAuth.UserID,
Expand Down Expand Up @@ -363,8 +363,8 @@ func TestAppAddCommand(t *testing.T) {
prepareAddMocks(t, cf, cm)
// Select workspace
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: types.NewApp(), Auth: mockOrgAuth}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowAllApps).Return(prompts.SelectedApp{App: types.NewApp(), Auth: mockOrgAuth}, nil)
// Mock calls
cm.API.On("ValidateSession", mock.Anything, mock.Anything).Return(api.AuthSession{
UserID: &mockOrgAuth.UserID,
Expand Down Expand Up @@ -419,8 +419,8 @@ func TestAppAddCommand(t *testing.T) {
prepareAddMocks(t, cf, cm)
// Select workspace
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: types.NewApp(), Auth: mockOrgAuth}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowAllApps).Return(prompts.SelectedApp{App: types.NewApp(), Auth: mockOrgAuth}, nil)
// Mock calls
cm.API.On("ValidateSession", mock.Anything, mock.Anything).Return(api.AuthSession{
UserID: &mockOrgAuth.UserID,
Expand Down
2 changes: 1 addition & 1 deletion cmd/app/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func RunDeleteCommand(ctx context.Context, clients *shared.ClientFactory, cmd *c
}

// Get the app auth selection from the flag or prompt
selection, err := deleteAppSelectPromptFunc(ctx, clients, prompts.ShowInstalledAndUninstalledApps)
selection, err := deleteAppSelectPromptFunc(ctx, clients, prompts.ShowAllEnvironments, prompts.ShowInstalledAndUninstalledApps)
if err != nil {
if slackerror.ToSlackError(err).Code == slackerror.ErrInstallationRequired {
return types.App{}, nil
Expand Down
8 changes: 4 additions & 4 deletions cmd/app/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestAppsDeleteCommand(t *testing.T) {
// Mock App Selection
appSelectMock := prompts.NewAppSelectMock()
deleteAppSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt").Return(prompts.SelectedApp{
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowAllEnvironments, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{
Auth: types.SlackAuth{TeamDomain: fakeDeployedApp.TeamDomain},
App: fakeDeployedApp,
}, nil)
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestAppsDeleteCommand(t *testing.T) {
// Mock App Selection
appSelectMock := prompts.NewAppSelectMock()
deleteAppSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt").Return(prompts.SelectedApp{
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowAllEnvironments, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{
Auth: types.SlackAuth{TeamDomain: fakeLocalApp.TeamDomain},
App: fakeLocalApp,
}, nil)
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestAppsDeleteCommand(t *testing.T) {
// Mock App Selection
appSelectMock := prompts.NewAppSelectMock()
deleteAppSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt").Return(prompts.SelectedApp{
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowAllEnvironments, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{
Auth: types.SlackAuth{TeamDomain: fakeDeployedApp.TeamDomain},
App: fakeDeployedApp,
}, nil)
Expand All @@ -149,7 +149,7 @@ func TestAppsDeleteCommand(t *testing.T) {
cm.API.On("ValidateSession", mock.Anything, mock.Anything).Return(api.AuthSession{}, nil)
appSelectMock := prompts.NewAppSelectMock()
deleteAppSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt").Return(prompts.SelectedApp{App: fakeDeployedApp}, nil)
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowAllEnvironments, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{App: fakeDeployedApp}, nil)
},
},
}, func(cf *shared.ClientFactory) *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion cmd/app/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func appSettingsCommandRunE(clients *shared.ClientFactory, cmd *cobra.Command, a
ctx := cmd.Context()
clients.IO.PrintTrace(ctx, slacktrace.AppSettingsStart)

app, err := settingsAppSelectPromptFunc(ctx, clients, prompts.ShowInstalledAndUninstalledApps)
app, err := settingsAppSelectPromptFunc(ctx, clients, prompts.ShowAllEnvironments, prompts.ShowInstalledAndUninstalledApps)
if err != nil {
return err
}
Expand Down
16 changes: 16 additions & 0 deletions cmd/app/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func Test_App_SettingsCommand(t *testing.T) {
appSelectMock := prompts.NewAppSelectMock()
appSelectMock.On(
"AppSelectPrompt",
mock.Anything,
mock.Anything,
prompts.ShowAllEnvironments,
prompts.ShowInstalledAndUninstalledApps,
).Return(
prompts.SelectedApp{App: types.App{AppID: "A0101010101"}},
nil,
Expand Down Expand Up @@ -124,6 +128,10 @@ func Test_App_SettingsCommand(t *testing.T) {
appSelectMock := prompts.NewAppSelectMock()
appSelectMock.On(
"AppSelectPrompt",
mock.Anything,
mock.Anything,
prompts.ShowAllEnvironments,
prompts.ShowInstalledAndUninstalledApps,
).Return(
prompts.SelectedApp{},
slackerror.New(slackerror.ErrInstallationRequired),
Expand All @@ -147,6 +155,10 @@ func Test_App_SettingsCommand(t *testing.T) {
appSelectMock := prompts.NewAppSelectMock()
appSelectMock.On(
"AppSelectPrompt",
mock.Anything,
mock.Anything,
prompts.ShowAllEnvironments,
prompts.ShowInstalledAndUninstalledApps,
).Return(
prompts.SelectedApp{App: types.App{AppID: "A0123456789"}},
nil,
Expand Down Expand Up @@ -176,6 +188,10 @@ func Test_App_SettingsCommand(t *testing.T) {
appSelectMock := prompts.NewAppSelectMock()
appSelectMock.On(
"AppSelectPrompt",
mock.Anything,
mock.Anything,
prompts.ShowAllEnvironments,
prompts.ShowInstalledAndUninstalledApps,
).Return(
prompts.SelectedApp{
App: types.App{AppID: "A0123456789"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/app/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func RunUninstallCommand(ctx context.Context, clients *shared.ClientFactory, cmd
}

// Get the workspace from the flag or prompt
selection, err := uninstallAppSelectPromptFunc(ctx, clients, prompts.ShowInstalledAppsOnly)
selection, err := uninstallAppSelectPromptFunc(ctx, clients, prompts.ShowAllEnvironments, prompts.ShowInstalledAppsOnly)
if err != nil {
if slackerror.ToSlackError(err).Code == slackerror.ErrInstallationRequired {
return types.App{}, nil
Expand Down
4 changes: 2 additions & 2 deletions cmd/app/uninstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAppsUninstall(t *testing.T) {
prepareCommonUninstallMocks(ctx, cf, cm)
appSelectMock := prompts.NewAppSelectMock()
uninstallAppSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt").Return(prompts.SelectedApp{App: fakeApp}, nil)
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowAllEnvironments, prompts.ShowInstalledAppsOnly).Return(prompts.SelectedApp{App: fakeApp}, nil)
},
},
}, func(clients *shared.ClientFactory) *cobra.Command {
Expand All @@ -99,7 +99,7 @@ func prepareCommonUninstallMocks(ctx context.Context, clients *shared.ClientFact
// Mock App Selection
appSelectMock := prompts.NewAppSelectMock()
uninstallAppSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt").Return(selectedProdApp, nil)
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowAllEnvironments, prompts.ShowInstalledAppsOnly).Return(selectedProdApp, nil)

// Mock API calls
clientsMock.Auth.On("ResolveAPIHost", mock.Anything, mock.Anything, mock.Anything).
Expand Down
2 changes: 1 addition & 1 deletion cmd/collaborators/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func runAddCommandFunc(ctx context.Context, clients *shared.ClientFactory, cmd *
defer span.Finish()

// Get the app auth selection from the flag or prompt
selection, err := teamAppSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
selection, err := appSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
if err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/collaborators/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func TestAddCommand(t *testing.T) {
cm.AddDefaultMocks()
// Mock App Selection
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: types.App{AppID: "A123"}, Auth: types.SlackAuth{}}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{App: types.App{AppID: "A123"}, Auth: types.SlackAuth{}}, nil)
// Set experiment flag
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, "read-only-collaborators")
cm.Config.LoadExperiments(ctx, cm.IO.PrintDebug)
Expand All @@ -59,8 +59,8 @@ func TestAddCommand(t *testing.T) {
cm.AddDefaultMocks()
// Mock App Selection
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: types.App{AppID: "A123"}, Auth: types.SlackAuth{}}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{App: types.App{AppID: "A123"}, Auth: types.SlackAuth{}}, nil)
// Set experiment flag
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, "read-only-collaborators")
cm.Config.LoadExperiments(ctx, cm.IO.PrintDebug)
Expand All @@ -84,8 +84,8 @@ func TestAddCommand(t *testing.T) {
cm.AddDefaultMocks()
// Mock App Selection
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: types.App{AppID: "A123"}, Auth: types.SlackAuth{}}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{App: types.App{AppID: "A123"}, Auth: types.SlackAuth{}}, nil)
// Mock API call
cm.API.On("AddCollaborator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Return(nil)
Expand Down
4 changes: 2 additions & 2 deletions cmd/collaborators/collaborators.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/spf13/cobra"
)

// teamAppSelectPromptFunc is a handle to the TeamAppSelectPrompt that can be mocked in tests
var teamAppSelectPromptFunc = prompts.TeamAppSelectPrompt
// appSelectPromptFunc is a handle to the AppSelectPrompt that can be mocked in tests
var appSelectPromptFunc = prompts.AppSelectPrompt

func NewCommand(clients *shared.ClientFactory) *cobra.Command {
cmd := &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions cmd/collaborators/collaborators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ func TestCollaboratorsCommand(t *testing.T) {
t.Run(name, func(t *testing.T) {
ctx := slackcontext.MockContext(t.Context())
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: tt.app, Auth: types.SlackAuth{}}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{App: tt.app, Auth: types.SlackAuth{}}, nil)
clientsMock := shared.NewClientsMock()
clientsMock.AddDefaultMocks()
clientsMock.API.On("ListCollaborators", mock.Anything, mock.Anything, mock.Anything).
Expand Down
2 changes: 1 addition & 1 deletion cmd/collaborators/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func runListCommand(cmd *cobra.Command, clients *shared.ClientFactory) error {
defer span.Finish()

// Get the app auth selection from the flag or prompt
selection, err := teamAppSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
selection, err := appSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/collaborators/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ func TestListCommand(t *testing.T) {
t.Run(name, func(t *testing.T) {
ctx := slackcontext.MockContext(t.Context())
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").Return(prompts.SelectedApp{App: tt.app, Auth: types.SlackAuth{}}, nil)
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).Return(prompts.SelectedApp{App: tt.app, Auth: types.SlackAuth{}}, nil)
clientsMock := shared.NewClientsMock()
clientsMock.AddDefaultMocks()
clientsMock.API.On("ListCollaborators", mock.Anything, mock.Anything, mock.Anything).
Expand Down
2 changes: 1 addition & 1 deletion cmd/collaborators/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func runRemoveCommandFunc(ctx context.Context, clients *shared.ClientFactory, cm
var span opentracing.Span
span, ctx = opentracing.StartSpanFromContext(ctx, "cmd.Collaborators.Remove")
defer span.Finish()
selection, err := teamAppSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
selection, err := appSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
if err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/collaborators/remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func TestRemoveCommand(t *testing.T) {
CmdArgs: []string{"USLACKBOT"},
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).
Return(mockSelection, nil)
cm.API.On("RemoveCollaborator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Return(nil)
Expand All @@ -72,8 +72,8 @@ func TestRemoveCommand(t *testing.T) {
CmdArgs: []string{},
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).
Return(mockSelection, nil)
cm.API.On("RemoveCollaborator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Return(nil)
Expand All @@ -93,8 +93,8 @@ func TestRemoveCommand(t *testing.T) {
CmdArgs: []string{},
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
appSelectMock := prompts.NewAppSelectMock()
teamAppSelectPromptFunc = appSelectMock.TeamAppSelectPrompt
appSelectMock.On("TeamAppSelectPrompt").
appSelectPromptFunc = appSelectMock.AppSelectPrompt
appSelectMock.On("AppSelectPrompt", mock.Anything, mock.Anything, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps).
Return(mockSelection, nil)
cm.API.On("RemoveCollaborator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Return(nil)
Expand Down
2 changes: 1 addition & 1 deletion cmd/collaborators/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func runUpdateCommand(cmd *cobra.Command, clients *shared.ClientFactory, args []
}

// Get the app auth selection from the flag or prompt
selection, err := teamAppSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
selection, err := appSelectPromptFunc(ctx, clients, prompts.ShowHostedOnly, prompts.ShowInstalledAndUninstalledApps)
if err != nil {
return err
}
Expand Down
Loading
Loading