Refactor pull request view (7) (#37524)
Almost done `pull_merge_box.tmpl` only has about 80 lines now, and (almost) all variable accesses are strictly typed. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: Nicolas <bircni@icloud.com>
This commit is contained in:
@@ -31,8 +31,7 @@ func TestPullCreate_CommitStatus(t *testing.T) {
|
||||
testRepoFork(t, session, "user2", "repo1", "user1", "repo1", "")
|
||||
testEditFileToNewBranch(t, session, "user1", "repo1", "master", "status1", "README.md", "status1")
|
||||
|
||||
url := "/" + path.Join("user1", "repo1", "compare", "master...status1")
|
||||
req := NewRequestWithValues(t, "POST", url,
|
||||
req := NewRequestWithValues(t, "POST", "/user1/repo1/compare/master...status1",
|
||||
map[string]string{
|
||||
"title": "pull request from status1",
|
||||
},
|
||||
@@ -121,8 +120,7 @@ func TestPullCreate_EmptyChangesWithDifferentCommits(t *testing.T) {
|
||||
testEditFileToNewBranch(t, session, "user1", "repo1", "master", "status1", "README.md", "status1")
|
||||
testEditFile(t, session, "user1", "repo1", "status1", "README.md", "# repo1\n\nDescription for repo1")
|
||||
|
||||
url := "/" + path.Join("user1", "repo1", "compare", "master...status1")
|
||||
req := NewRequestWithValues(t, "POST", url,
|
||||
req := NewRequestWithValues(t, "POST", "/user1/repo1/compare/master...status1",
|
||||
map[string]string{
|
||||
"title": "pull request from status1",
|
||||
},
|
||||
@@ -134,6 +132,7 @@ func TestPullCreate_EmptyChangesWithDifferentCommits(t *testing.T) {
|
||||
doc := NewHTMLParser(t, resp.Body)
|
||||
|
||||
text := strings.TrimSpace(doc.doc.Find(".merge-section").Text())
|
||||
assert.Contains(t, text, "The changes on this branch are already on the target branch. This will be an empty commit.")
|
||||
assert.Contains(t, text, "This pull request can be merged automatically.")
|
||||
})
|
||||
}
|
||||
@@ -143,8 +142,7 @@ func TestPullCreate_EmptyChangesWithSameCommits(t *testing.T) {
|
||||
session := loginUser(t, "user1")
|
||||
testRepoFork(t, session, "user2", "repo1", "user1", "repo1", "")
|
||||
testCreateBranch(t, session, "user1", "repo1", "branch/master", "status1", http.StatusSeeOther)
|
||||
url := "/" + path.Join("user1", "repo1", "compare", "master...status1")
|
||||
req := NewRequestWithValues(t, "POST", url,
|
||||
req := NewRequestWithValues(t, "POST", "/user1/repo1/compare/master...status1",
|
||||
map[string]string{
|
||||
"title": "pull request from status1",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user