1
Fork 0

feat: set created_by as the default filter for /issues and /pulls (#5286)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5286
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
Shiny Nematoda 2024-09-13 12:55:39 +00:00 committed by 0ko
parent a23ba1c6ac
commit 14abf65269
4 changed files with 27 additions and 8 deletions

View file

@ -1284,3 +1284,20 @@ func TestIssueLabelList(t *testing.T) {
htmlDoc.AssertElement(t, ".labels.list .no-select."+hiddenClass, true)
})
}
func TestIssueUserDashboard(t *testing.T) {
defer tests.PrepareTestEnv(t)()
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
session := loginUser(t, user.Name)
// assert 'created_by' is the default filter
const sel = ".dashboard .ui.list-header.dropdown .ui.menu a.active.item[href^='?type=created_by']"
for _, path := range []string{"/issues", "/pulls"} {
req := NewRequest(t, "GET", path)
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
htmlDoc.AssertElement(t, sel, true)
}
}