summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShiny Nematoda <snematoda.751k2@aleeas.com>2024-09-10 17:57:58 +0200
committer0ko <0ko@noreply.codeberg.org>2024-09-10 17:57:58 +0200
commit6178a46fe25016fbde7b853829ff481d5627ff2e (patch)
treeb0f58946e8046f7bf201dcf9078e02b045f35029 /tests
parentUpdate dependency license-checker-rseidelsohn to v4.4.2 (forgejo) (#5274) (diff)
downloadforgejo-6178a46fe25016fbde7b853829ff481d5627ff2e.tar.xz
forgejo-6178a46fe25016fbde7b853829ff481d5627ff2e.zip
feat: set fuzzy as default for issue search (#5270)
Closes #5225 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5270 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>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/issue_test.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/integration/issue_test.go b/tests/integration/issue_test.go
index 4d9d99fb5e..26ae2d45a3 100644
--- a/tests/integration/issue_test.go
+++ b/tests/integration/issue_test.go
@@ -146,17 +146,19 @@ func TestViewIssuesKeyword(t *testing.T) {
assert.EqualValues(t, 0, issuesSelection.Length())
// should match as 'first' when fuzzy seaeching is enabled
- req = NewRequestf(t, "GET", "%s/issues?q=%st&fuzzy=true", repo.Link(), keyword)
- resp = MakeRequest(t, req, http.StatusOK)
- htmlDoc = NewHTMLParser(t, resp.Body)
- issuesSelection = getIssuesSelection(t, htmlDoc)
- assert.EqualValues(t, 1, issuesSelection.Length())
- issuesSelection.Each(func(_ int, selection *goquery.Selection) {
- issue := getIssue(t, repo.ID, selection)
- assert.False(t, issue.IsClosed)
- assert.False(t, issue.IsPull)
- assertMatch(t, issue, keyword)
- })
+ for _, fmt := range []string{"%s/issues?q=%st&fuzzy=true", "%s/issues?q=%st"} {
+ req = NewRequestf(t, "GET", fmt, repo.Link(), keyword)
+ resp = MakeRequest(t, req, http.StatusOK)
+ htmlDoc = NewHTMLParser(t, resp.Body)
+ issuesSelection = getIssuesSelection(t, htmlDoc)
+ assert.EqualValues(t, 1, issuesSelection.Length())
+ issuesSelection.Each(func(_ int, selection *goquery.Selection) {
+ issue := getIssue(t, repo.ID, selection)
+ assert.False(t, issue.IsClosed)
+ assert.False(t, issue.IsPull)
+ assertMatch(t, issue, keyword)
+ })
+ }
}
func TestViewIssuesSearchOptions(t *testing.T) {