Skip to content

Commit

Permalink
fix(tests): fix broken tests for PullIsMergeable function
Browse files Browse the repository at this point in the history
  • Loading branch information
CaioAugustoo committed Dec 9, 2024
1 parent 59e921a commit f8e7748
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/events/vcs/gitlab_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ func TestGitlabClient_PullIsMergeable(t *testing.T) {
case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v", defaultMr):
w.WriteHeader(http.StatusOK)
w.Write(pipelineSuccess) // nolint: errcheck
case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v/approvals", c.mrID):
w.WriteHeader(http.StatusOK)
response := fmt.Sprintf(`{"id":%v,"name":"%s","rule_type":"regular","report_type":null,"eligible_approvers":[{"id":5,"name":"John Doe","username":"jdoe","state":"active","avatar_url":"https://www.gravatar.com/avatar/0?s=80&d=identicon","web_url":"http://localhost/jdoe"},{"id":50,"name":"Group Member 1","username":"group_member_1","state":"active","avatar_url":"https://www.gravatar.com/avatar/0?s=80&d=identicon","web_url":"http://localhost/group_member_1"}],"approvals_required":0,"users":[{"id":5,"name":"John Doe","username":"jdoe","state":"active","avatar_url":"https://www.gravatar.com/avatar/0?s=80&d=identicon","web_url":"http://localhost/jdoe"}],"contains_hidden_groups":false}`, c.mrID, c.statusName)
w.Write([]byte(response)) // nolint: errcheck
case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v", noHeadPipelineMR):
w.WriteHeader(http.StatusOK)
w.Write(headPipelineNotAvailable) // nolint: errcheck
Expand Down

0 comments on commit f8e7748

Please sign in to comment.