aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-06-24 01:45:21 +0800
committerGitHub <noreply@github.com>2024-06-23 17:45:21 +0000
commitf4921b9daaf7c735da2833542fad426ca28bb09d (patch)
treeed737f0d6822521b19135942d98b0368c369c508 /tests
parent6a96deb5898745d957ffd7860b2b6821c673e907 (diff)
downloadgitea-f4921b9daaf7c735da2833542fad426ca28bb09d.tar.gz
gitea-f4921b9daaf7c735da2833542fad426ca28bb09d.zip
Simplify 404/500 page (#31409)
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/compare_test.go5
-rw-r--r--tests/integration/links_test.go2
2 files changed, 3 insertions, 4 deletions
diff --git a/tests/integration/compare_test.go b/tests/integration/compare_test.go
index 9f73ac80e2..d960416b3a 100644
--- a/tests/integration/compare_test.go
+++ b/tests/integration/compare_test.go
@@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
+ "code.gitea.io/gitea/modules/test"
repo_service "code.gitea.io/gitea/services/repository"
"code.gitea.io/gitea/tests"
@@ -30,9 +31,9 @@ func TestCompareTag(t *testing.T) {
// A dropdown for both base and head.
assert.Lenf(t, selection.Nodes, 2, "The template has changed")
- req = NewRequest(t, "GET", "/user2/repo1/compare/invalid")
+ req = NewRequest(t, "GET", "/user2/repo1/compare/invalid").SetHeader("Accept", "text/html")
resp = session.MakeRequest(t, req, http.StatusNotFound)
- assert.False(t, strings.Contains(resp.Body.String(), "/assets/img/500.png"), "expect 404 page not 500")
+ assert.True(t, test.IsNormalPageCompleted(resp.Body.String()), "expect 404 page not 500")
}
// Compare with inferred default branch (master)
diff --git a/tests/integration/links_test.go b/tests/integration/links_test.go
index d103e2b0a9..d3b30448fc 100644
--- a/tests/integration/links_test.go
+++ b/tests/integration/links_test.go
@@ -37,8 +37,6 @@ func TestLinksNoLogin(t *testing.T) {
"/user2/repo1/projects",
"/user2/repo1/projects/1",
"/user2/repo1/releases/tag/delete-tag", // It's the only one existing record on release.yml which has is_tag: true
- "/assets/img/404.png",
- "/assets/img/500.png",
"/.well-known/security.txt",
}