Skip to content

Commit a58b8eb

Browse files
committed
refactor: update organization ID handling in team commands
Signed-off-by: Maximilian <burr.maximilian97@gmail.com>
1 parent 91ec2a2 commit a58b8eb

5 files changed

Lines changed: 7 additions & 20 deletions

File tree

api/organization.go

Lines changed: 0 additions & 13 deletions
This file was deleted.

cli/cmd/team_add_member_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ var _ = Describe("AddTeamMember", func() {
101101
Expect(err.Error()).To(Equal("email cannot be empty"))
102102
})
103103
})
104-
104+
105105
})

cli/cmd/team_create_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var _ = Describe("CreateTeam", func() {
6363

6464
Context("RunE execution flow", func() {
6565
It("should successfully create a team when organization ID is provided via environment", func() {
66-
c.Opts.GlobalOptions.OrgId = "" // Ensure flag is empty
66+
c.Opts.OrgId = "" // Ensure flag is empty
6767
mockEnv.EXPECT().GetOrgId().Return(orgId).Once()
6868

6969
expectedTeam := api.Team{
@@ -81,7 +81,7 @@ var _ = Describe("CreateTeam", func() {
8181

8282
Context("when creating a team with an organization ID", func() {
8383
BeforeEach(func() {
84-
c.Opts.GlobalOptions.OrgId = orgId // Set OrgId via GlobalOptions (flag equivalent)
84+
c.Opts.OrgId = orgId // Set OrgId via GlobalOptions (flag equivalent)
8585
})
8686

8787
It("should successfully create the team and return the correct object", func() {
@@ -112,7 +112,7 @@ var _ = Describe("CreateTeam", func() {
112112

113113
Context("when creating a team without an organization ID", func() {
114114
BeforeEach(func() {
115-
c.Opts.GlobalOptions.OrgId = "" // Ensure OrgId is empty from flag
115+
c.Opts.OrgId = "" // Ensure OrgId is empty from flag
116116
})
117117

118118
It("should create the team without orgID ", func() {
@@ -132,7 +132,7 @@ var _ = Describe("CreateTeam", func() {
132132

133133
Context("when an invalid organization ID format is provided via flag", func() {
134134
BeforeEach(func() {
135-
c.Opts.GlobalOptions.OrgId = "invalid-uuid-format" // Set an invalid UUID in GlobalOptions
135+
c.Opts.OrgId = "invalid-uuid-format" // Set an invalid UUID in GlobalOptions
136136
})
137137

138138
It("should return an error due to invalid organization ID format", func() {

cli/cmd/team_remove_member_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var _ = Describe("RemoveTeamMember", func() {
8080
})
8181

8282
It("should fail when team ID is unavailable", func() {
83-
c.Opts.GlobalOptions.TeamId = -1
83+
c.Opts.TeamId = -1
8484
mockEnv.EXPECT().GetTeamId().Return(-1, errors.New("CS_TEAM_ID env var required, but not set")).Once()
8585

8686
err := c.RunE(nil, []string{})

cli/cmd/team_remove_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var _ = Describe("RemoveTeam", func() {
7070
})
7171

7272
It("should fail when team ID is unavailable", func() {
73-
c.Opts.GlobalOptions.TeamId = -1
73+
c.Opts.TeamId = -1
7474
mockEnv.EXPECT().GetOrgId().Return("").Once()
7575
mockEnv.EXPECT().GetTeamId().Return(-1, errors.New("CS_TEAM_ID env var required, but not set")).Once()
7676

0 commit comments

Comments
 (0)