loading up the forgejo repo on tangled to test page performance
1package integration
2
3import (
4 "net/http"
5 "testing"
6
7 "forgejo.org/modules/setting"
8 "forgejo.org/modules/test"
9 "forgejo.org/tests"
10
11 "github.com/PuerkitoBio/goquery"
12 "github.com/stretchr/testify/assert"
13)
14
15func TestExploreCodeSearchIndexer(t *testing.T) {
16 defer tests.PrepareTestEnv(t)()
17 defer test.MockVariableValue(&setting.Indexer.RepoIndexerEnabled, true)()
18
19 req := NewRequest(t, "GET", "/explore/code?q=file&fuzzy=true")
20 resp := MakeRequest(t, req, http.StatusOK)
21 doc := NewHTMLParser(t, resp.Body).Find(".explore")
22
23 doc.Find(".file-body").Each(func(i int, sel *goquery.Selection) {
24 assert.Positive(t, sel.Find(".code-inner").Find(".search-highlight").Length(), 0)
25 })
26}