autogits/workflow-pr/pr_processor_reviewed_test.go
2025-02-04 17:44:49 +01:00

64 lines
1.2 KiB
Go

package main
import (
)
/*
func TestPRReviewed(t *testing.T) {
testData := []struct {
title string
error error
}{
{
title: "forward project review",
},
}
event := &common.PullRequestWebhookEvent{
Action: "reviewed",
Number: 1,
Pull_Request: &common.PullRequest{
Id: 1,
Base: common.Head{
Ref: "branch",
Sha: "testing",
Repo: &common.Repository{
Name: "testRepo",
Default_Branch: "main1",
},
},
Head: common.Head{
Ref: "branch",
Sha: "testing",
Repo: &common.Repository{
Name: "testRepo",
Default_Branch: "main1",
},
},
},
Repository: &common.Repository{
Name: "testRepo",
Owner: &common.Organization{
Username: "test",
},
},
}
for _, test := range testData {
t.Run(test.title, func(t *testing.T) {
ctl := gomock.NewController(t)
mock := mock_common.NewMockGitea(ctl)
s := PullRequestReviewed{
gitea: mock,
}
mock.EXPECT().GetPullRequest("test", "testRepo", int64(1)).Return(nil, nil)
if err := s.Process(event, nil, nil); err != test.error {
t.Error("unexected error:", err, "Expected:", test.error)
}
})
}
}
*/