mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-01 17:38:33 +00:00
feat: wiki search using git-grep
+ add release note
This commit is contained in:
parent
d6915f4d5f
commit
ec4f5495ba
10 changed files with 107 additions and 0 deletions
|
@ -15,9 +15,26 @@ import (
|
|||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestWikiSearchContent(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
req := NewRequest(t, "GET", "/user2/repo1/wiki/search?q=This")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
doc := NewHTMLParser(t, resp.Body)
|
||||
res := doc.Find(".item > b").Map(func(_ int, el *goquery.Selection) string {
|
||||
return el.Text()
|
||||
})
|
||||
assert.Equal(t, []string{
|
||||
"Home.md",
|
||||
"Page-With-Spaced-Name.md",
|
||||
"Unescaped File.md",
|
||||
}, res)
|
||||
}
|
||||
|
||||
func TestWikiBranchNormalize(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue