0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-12 03:51:16 +01:00
gitea/tests/integration/explore_repos_test.go
wxiaoguang 7a6260f889
Improve repo search UI (#29767)
1. Introduce a special "flex-items-block" for menu items, to align the
dropdown menu items
2. Simplify the "repo search" form
3. Add missing "TopicOnly" search option

Screenshots:

The old UI items don't align:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/b965ac00-bad6-4d2f-9103-8841bd940aa5)

</details>


New UI (doesn't change much, but the items align)

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/a1add892-21dc-423b-90d5-5569faa3dced)


![image](https://github.com/go-gitea/gitea/assets/2114189/fb4040b2-96d8-4fb2-a0ed-760b9881fd86)

</details>

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-03-15 09:45:30 +00:00

26 lines
698 B
Go

// Copyright 2017 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package integration
import (
"net/http"
"testing"
"code.gitea.io/gitea/tests"
"github.com/stretchr/testify/assert"
)
func TestExploreRepos(t *testing.T) {
defer tests.PrepareTestEnv(t)()
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"`)
}