2017-08-17 14:20:21 +02:00
|
|
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
2022-11-27 19:20:29 +01:00
|
|
|
// SPDX-License-Identifier: MIT
|
2017-08-17 14:20:21 +02:00
|
|
|
|
2022-09-02 21:18:23 +02:00
|
|
|
package integration
|
2017-08-17 14:20:21 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"testing"
|
2022-09-02 21:18:23 +02:00
|
|
|
|
|
|
|
"code.gitea.io/gitea/tests"
|
2024-03-15 10:45:30 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2017-08-17 14:20:21 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestExploreRepos(t *testing.T) {
|
2022-09-02 21:18:23 +02:00
|
|
|
defer tests.PrepareTestEnv(t)()
|
2017-08-17 14:20:21 +02:00
|
|
|
|
2024-03-15 10:45:30 +01: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 14:20:21 +02:00
|
|
|
}
|