2017-08-17 20:20:21 +08:00
|
|
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
2022-11-27 13:20:29 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2017-08-17 20:20:21 +08:00
|
|
|
|
2022-09-02 15:18:23 -04:00
|
|
|
package integration
|
2017-08-17 20:20:21 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"testing"
|
2022-09-02 15:18:23 -04:00
|
|
|
|
|
|
|
"code.gitea.io/gitea/tests"
|
2024-03-15 17:45:30 +08:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2017-08-17 20:20:21 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestExploreRepos(t *testing.T) {
|
2022-09-02 15:18:23 -04:00
|
|
|
defer tests.PrepareTestEnv(t)()
|
2017-08-17 20:20:21 +08:00
|
|
|
|
2024-03-15 17:45:30 +08:00
|
|
|
req := NewRequest(t, "GET", "/explore/repos?q=TheKeyword&topic=1&language=TheLang")
|
|
|
|
resp := MakeRequest(t, req, http.StatusOK)
|
|
|
|
respStr := resp.Body.String()
|
|
|
|
|
|
|
|
assert.Contains(t, respStr, `<input type="hidden" name="topic" value="true">`)
|
|
|
|
assert.Contains(t, respStr, `<input type="hidden" name="language" value="TheLang">`)
|
|
|
|
assert.Contains(t, respStr, `<input type="search" name="q" value="TheKeyword"`)
|
2017-08-17 20:20:21 +08:00
|
|
|
}
|