Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed Apr 16, 2024
1 parent 3ebdfc4 commit 677855e
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion client/team_role_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var _ = Describe("TeamRoleAssignment", func() {
mockTeamRoleAssignments := []TeamRoleAssignmentPayload{mockTeamRoleAssignment}

Describe("CreateOrUpdate", func() {
Describe("Success", func() {
Describe("ProjectId", func() {
var assignment *TeamRoleAssignmentPayload
BeforeEach(func() {
createPayload := TeamRoleAssignmentCreateOrUpdatePayload{
Expand All @@ -47,6 +47,53 @@ var _ = Describe("TeamRoleAssignment", func() {
Expect(*assignment).To(Equal(mockTeamRoleAssignment))
})
})

Describe("EnvironmentId", func() {
var assignment *TeamRoleAssignmentPayload
BeforeEach(func() {
createPayload := TeamRoleAssignmentCreateOrUpdatePayload{
TeamId: dummyTeamId,
EnvironmentId: dummyEnvironmentId,
Role: dummyProjectRole,
}
httpCall = mockHttpClient.EXPECT().
Put("/roles/assignments/teams", &createPayload, gomock.Any()).
Do(func(path string, request interface{}, response *TeamRoleAssignmentPayload) {
*response = mockTeamRoleAssignment
}).Times(1)
assignment, _ = apiClient.TeamRoleAssignmentCreateOrUpdate(&createPayload)

})

It("Should send PUT request with params", func() {})

It("Should return a new resource with id", func() {
Expect(*assignment).To(Equal(mockTeamRoleAssignment))
})
})

Describe("OrganizationId", func() {
var assignment *TeamRoleAssignmentPayload
BeforeEach(func() {
createPayload := TeamRoleAssignmentCreateOrUpdatePayload{
TeamId: dummyTeamId,
OrganizationId: dummyOrganizationId,
Role: dummyProjectRole,
}
httpCall = mockHttpClient.EXPECT().
Put("/roles/assignments/teams", &createPayload, gomock.Any()).
Do(func(path string, request interface{}, response *TeamRoleAssignmentPayload) {
*response = mockTeamRoleAssignment
}).Times(1)
assignment, _ = apiClient.TeamRoleAssignmentCreateOrUpdate(&createPayload)
})

It("Should send PUT request with params", func() {})

It("Should return a new resource with id", func() {
Expect(*assignment).To(Equal(mockTeamRoleAssignment))
})
})
})

Describe("Get Project Assignments", func() {
Expand Down

0 comments on commit 677855e

Please sign in to comment.