aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-04-22 07:47:31 +0800
committerGitHub <noreply@github.com>2024-04-21 23:47:31 +0000
commitf4a1cf7eab674e3c1589a7ecef015ff64e441946 (patch)
tree467f4229cfae119e98536df39c80592e44ccfe47 /tests
parent1e4867730b261352d63098b85cf53ca05867c8c2 (diff)
downloadgitea-f4a1cf7eab674e3c1589a7ecef015ff64e441946.tar.gz
gitea-f4a1cf7eab674e3c1589a7ecef015ff64e441946.zip
Fix repo home UI when there is no repo description (#30552)
Fix #30502 by a new approach. ![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76)
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/repo_test.go32
1 files changed, 3 insertions, 29 deletions
diff --git a/tests/integration/repo_test.go b/tests/integration/repo_test.go
index 06c55b1e8a..b967ccad1e 100644
--- a/tests/integration/repo_test.go
+++ b/tests/integration/repo_test.go
@@ -28,11 +28,9 @@ func TestViewRepo(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
- noDescription := htmlDoc.doc.Find("#repo-desc").Children()
repoTopics := htmlDoc.doc.Find("#repo-topics").Children()
repoSummary := htmlDoc.doc.Find(".repository-summary").Children()
- assert.True(t, noDescription.HasClass("no-description"))
assert.True(t, repoTopics.HasClass("repo-topic"))
assert.True(t, repoSummary.HasClass("repository-menu"))
@@ -177,30 +175,6 @@ func TestViewRepoWithSymlinks(t *testing.T) {
assert.Equal(t, "link_link: svg octicon-file-symlink-file", items[4])
}
-// TestViewAsRepoAdmin tests PR #2167
-func TestViewAsRepoAdmin(t *testing.T) {
- for user, expectedNoDescription := range map[string]bool{
- "user2": true,
- "user4": false,
- } {
- defer tests.PrepareTestEnv(t)()
-
- session := loginUser(t, user)
-
- req := NewRequest(t, "GET", "/user2/repo1.git")
- resp := session.MakeRequest(t, req, http.StatusOK)
-
- htmlDoc := NewHTMLParser(t, resp.Body)
- noDescription := htmlDoc.doc.Find("#repo-desc").Children()
- repoTopics := htmlDoc.doc.Find("#repo-topics").Children()
- repoSummary := htmlDoc.doc.Find(".repository-summary").Children()
-
- assert.Equal(t, expectedNoDescription, noDescription.HasClass("no-description"))
- assert.True(t, repoTopics.HasClass("repo-topic"))
- assert.True(t, repoSummary.HasClass("repository-menu"))
- }
-}
-
// TestViewFileInRepo repo description, topics and summary should not be displayed when viewing a file
func TestViewFileInRepo(t *testing.T) {
defer tests.PrepareTestEnv(t)()
@@ -211,7 +185,7 @@ func TestViewFileInRepo(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
- description := htmlDoc.doc.Find("#repo-desc")
+ description := htmlDoc.doc.Find(".repo-description")
repoTopics := htmlDoc.doc.Find("#repo-topics")
repoSummary := htmlDoc.doc.Find(".repository-summary")
@@ -230,7 +204,7 @@ func TestBlameFileInRepo(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
- description := htmlDoc.doc.Find("#repo-desc")
+ description := htmlDoc.doc.Find(".repo-description")
repoTopics := htmlDoc.doc.Find("#repo-topics")
repoSummary := htmlDoc.doc.Find(".repository-summary")
@@ -249,7 +223,7 @@ func TestViewRepoDirectory(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
- description := htmlDoc.doc.Find("#repo-desc")
+ description := htmlDoc.doc.Find(".repo-description")
repoTopics := htmlDoc.doc.Find("#repo-topics")
repoSummary := htmlDoc.doc.Find(".repository-summary")