1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor pull-request compare&create page (#33071)

The old code is unnecessarily complex.
This commit is contained in:
wxiaoguang
2025-01-02 01:16:09 +08:00
committed by GitHub
parent d030cace1a
commit 85c756e279
5 changed files with 217 additions and 275 deletions

View File

@@ -27,7 +27,7 @@ func TestCompareTag(t *testing.T) {
req := NewRequest(t, "GET", "/user2/repo1/compare/v1.1...master")
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
selection := htmlDoc.doc.Find(".choose.branch .filter.dropdown")
selection := htmlDoc.doc.Find(".ui.dropdown.select-branch")
// A dropdown for both base and head.
assert.Lenf(t, selection.Nodes, 2, "The template has changed")
@@ -44,7 +44,7 @@ func TestCompareDefault(t *testing.T) {
req := NewRequest(t, "GET", "/user2/repo1/compare/v1.1")
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
selection := htmlDoc.doc.Find(".choose.branch .filter.dropdown")
selection := htmlDoc.doc.Find(".ui.dropdown.select-branch")
assert.Lenf(t, selection.Nodes, 2, "The template has changed")
}