From 19ff532d4234e2063c1fc15547422b0b5337829b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 4 Mar 2024 08:16:04 +0100 Subject: [PATCH] Test that tags without a release display properly Update the `TestTagViewWithoutRelease` test case with another assert: one that checks that the release title is properly displayed. Signed-off-by: Gergely Nagy --- tests/integration/repo_tag_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/integration/repo_tag_test.go b/tests/integration/repo_tag_test.go index 60c73ae63..5a9945365 100644 --- a/tests/integration/repo_tag_test.go +++ b/tests/integration/repo_tag_test.go @@ -7,6 +7,7 @@ package integration import ( "net/http" "net/url" + "strings" "testing" "code.gitea.io/gitea/models" @@ -56,6 +57,13 @@ func TestTagViewWithoutRelease(t *testing.T) { // Test that the release sub-menu isn't active releaseLink := htmlDoc.Find(".small-menu-items .item[href*='/releases']") assert.False(t, releaseLink.HasClass("active")) + + // Test that the title is displayed + releaseTitle := strings.TrimSpace(htmlDoc.Find("h4.release-list-title").Text()) + assert.Equal(t, "no-release", releaseTitle) + + // Test that there is no "Stable" link + htmlDoc.AssertElement(t, "h4.release-list-title > span.ui.green.label", false) } func TestCreateNewTagProtected(t *testing.T) {