-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add unit test to project resource #1694
Conversation
@@ -24,7 +24,7 @@ func TestAccSTSAssumeRole_basic(t *testing.T) { | |||
Steps: []resource.TestStep{ | |||
{ | |||
Config: acc.ConfigProject(projectName, orgID, | |||
[]*matlas.ProjectTeam{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing references to the old SDK still in the tests of project resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some suggestions and feedback
testObject.On("RemoveProjectTeam", mock.Anything, mock.Anything, mock.Anything).Return(ProjectResponse{Err: nil}) | ||
testObject.On("UpdateTeamRoles", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(ProjectResponse{Err: nil}) | ||
|
||
err := project.UpdateProjectTeams(context.Background(), testObject, &testCases[i].projectState, &testCases[i].projectPlan) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: testing this function limits to verifying if there are errors, but not which teams have actually been updated. Looking into the implemenation getChangesInTeamsSet
could be tested to see which teams are actually being removed, created, and updated.
|
Description
Add unit test to
project
resource. Also move model methods to new model_project.go fileLink to any related issue(s):
Type of change:
Required Checklist:
Further comments