diff --git a/pkg/cmd/codespace/create_test.go b/pkg/cmd/codespace/create_test.go index 910c73495..631cda849 100644 --- a/pkg/cmd/codespace/create_test.go +++ b/pkg/cmd/codespace/create_test.go @@ -29,6 +29,12 @@ func TestApp_Create(t *testing.T) { name: "create codespace with default branch and 30m idle timeout", fields: fields{ apiClient: &apiClientMock{ + GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) { + return &api.User{ + Login: "monalisa", + Type: "User", + }, nil + }, GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) { return &api.Repository{ ID: 1234, @@ -83,6 +89,12 @@ func TestApp_Create(t *testing.T) { GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) { return "EUROPE", nil }, + GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) { + return &api.User{ + Login: "monalisa", + Type: "User", + }, nil + }, GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) { return &api.Repository{ ID: 1234, @@ -134,6 +146,12 @@ func TestApp_Create(t *testing.T) { GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) { return "EUROPE", nil }, + GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) { + return &api.User{ + Login: "monalisa", + Type: "User", + }, nil + }, GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) { return &api.Repository{ ID: 1234, @@ -190,6 +208,12 @@ func TestApp_Create(t *testing.T) { GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) { return "EUROPE", nil }, + GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) { + return &api.User{ + Login: "monalisa", + Type: "User", + }, nil + }, GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) { return &api.Repository{ ID: 1234, @@ -218,6 +242,12 @@ func TestApp_Create(t *testing.T) { GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) { return "EUROPE", nil }, + GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) { + return &api.User{ + Login: "monalisa", + Type: "User", + }, nil + }, GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) { return &api.Repository{ ID: 1234, @@ -268,6 +298,12 @@ func TestApp_Create(t *testing.T) { name: "create codespace that requires accepting additional permissions", fields: fields{ apiClient: &apiClientMock{ + GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) { + return &api.User{ + Login: "monalisa", + Type: "User", + }, nil + }, GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) { return &api.Repository{ ID: 1234,