mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Remove unnecessary ".Link" usages (#29909)
In HTML, `?key=val` already means "use the current link with new query parameters"
This commit is contained in:
@ -16,17 +16,17 @@ func TestExploreUser(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
cases := []struct{ sortOrder, expected string }{
|
||||
{"", "/explore/users?sort=newest&q="},
|
||||
{"newest", "/explore/users?sort=newest&q="},
|
||||
{"oldest", "/explore/users?sort=oldest&q="},
|
||||
{"alphabetically", "/explore/users?sort=alphabetically&q="},
|
||||
{"reversealphabetically", "/explore/users?sort=reversealphabetically&q="},
|
||||
{"", "?sort=newest&q="},
|
||||
{"newest", "?sort=newest&q="},
|
||||
{"oldest", "?sort=oldest&q="},
|
||||
{"alphabetically", "?sort=alphabetically&q="},
|
||||
{"reversealphabetically", "?sort=reversealphabetically&q="},
|
||||
}
|
||||
for _, c := range cases {
|
||||
req := NewRequest(t, "GET", "/explore/users?sort="+c.sortOrder)
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
h := NewHTMLParser(t, resp.Body)
|
||||
href, _ := h.Find(`.ui.dropdown .menu a.active.item[href^="/explore/users"]`).Attr("href")
|
||||
href, _ := h.Find(`.ui.dropdown .menu a.active.item[href^="?sort="]`).Attr("href")
|
||||
assert.Equal(t, c.expected, href)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user