Skip to content

Commit 91c05cb

Browse files
authored
fix(tests): fix broken tests for PullIsMergeable function
1 parent 302c7c5 commit 91c05cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/events/vcs/gitlab_client_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,10 @@ func TestGitlabClient_PullIsMergeable(t *testing.T) {
816816
case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v", defaultMr):
817817
w.WriteHeader(http.StatusOK)
818818
w.Write(pipelineSuccess) // nolint: errcheck
819+
case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v/approvals", c.mrID):
820+
w.WriteHeader(http.StatusOK)
821+
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)
822+
w.Write([]byte(response)) // nolint: errcheck
819823
case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v", noHeadPipelineMR):
820824
w.WriteHeader(http.StatusOK)
821825
w.Write(headPipelineNotAvailable) // nolint: errcheck

0 commit comments

Comments
 (0)