Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-25 11:16:11 +01:00

Update instance title in tests

This commit is contained in:
0ko 2024-06-08 23:33:55 +05:00
parent 8e33f82a85
commit 2599737033
6 changed files with 25 additions and 25 deletions

View file

@ -9,7 +9,7 @@ test.beforeAll(async ({browser}, workerInfo) => {
test('Load Homepage', async ({page}) => { test('Load Homepage', async ({page}) => {
const response = await page.goto('/'); const response = await page.goto('/');
await expect(response?.status()).toBe(200); // Status OK await expect(response?.status()).toBe(200); // Status OK
await expect(page).toHaveTitle(/^Gitea: Git with a cup of tea\s*$/); await expect(page).toHaveTitle(/^Forgejo: Beyond coding. We Forge.\s*$/);
await expect(page.locator('.logo')).toHaveAttribute('src', '/assets/img/logo.svg'); await expect(page.locator('.logo')).toHaveAttribute('src', '/assets/img/logo.svg');
}); });

View file

@ -217,13 +217,13 @@ func TestRepoHTMLTitle(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1")
assert.EqualValues(t, "user2/repo1 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "user2/repo1 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("With description", func(t *testing.T) { t.Run("With description", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user27/repo49") htmlTitle := GetHTMLTitle(t, nil, "/user27/repo49")
assert.EqualValues(t, "user27/repo49: A wonderful repository with more than just a README.md - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "user27/repo49: A wonderful repository with more than just a README.md - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
}) })
@ -233,25 +233,25 @@ func TestRepoHTMLTitle(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/master/deep/nesting") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/master/deep/nesting")
assert.EqualValues(t, "repo59/deep/nesting at master - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting at master - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("Non-default branch", func(t *testing.T) { t.Run("Non-default branch", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/cake-recipe/deep/nesting") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/cake-recipe/deep/nesting")
assert.EqualValues(t, "repo59/deep/nesting at cake-recipe - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting at cake-recipe - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("Commit", func(t *testing.T) { t.Run("Commit", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/commit/d8f53dfb33f6ccf4169c34970b5e747511c18beb/deep/nesting/") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/commit/d8f53dfb33f6ccf4169c34970b5e747511c18beb/deep/nesting/")
assert.EqualValues(t, "repo59/deep/nesting at d8f53dfb33f6ccf4169c34970b5e747511c18beb - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting at d8f53dfb33f6ccf4169c34970b5e747511c18beb - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("Tag", func(t *testing.T) { t.Run("Tag", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/tag/v1.0/deep/nesting/") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/tag/v1.0/deep/nesting/")
assert.EqualValues(t, "repo59/deep/nesting at v1.0 - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting at v1.0 - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
}) })
t.Run("File", func(t *testing.T) { t.Run("File", func(t *testing.T) {
@ -259,25 +259,25 @@ func TestRepoHTMLTitle(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/master/deep/nesting/folder/secret_sauce_recipe.txt") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/master/deep/nesting/folder/secret_sauce_recipe.txt")
assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at master - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at master - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("Non-default branch", func(t *testing.T) { t.Run("Non-default branch", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/cake-recipe/deep/nesting/folder/secret_sauce_recipe.txt") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/branch/cake-recipe/deep/nesting/folder/secret_sauce_recipe.txt")
assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at cake-recipe - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at cake-recipe - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("Commit", func(t *testing.T) { t.Run("Commit", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/commit/d8f53dfb33f6ccf4169c34970b5e747511c18beb/deep/nesting/folder/secret_sauce_recipe.txt") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/commit/d8f53dfb33f6ccf4169c34970b5e747511c18beb/deep/nesting/folder/secret_sauce_recipe.txt")
assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at d8f53dfb33f6ccf4169c34970b5e747511c18beb - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at d8f53dfb33f6ccf4169c34970b5e747511c18beb - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("Tag", func(t *testing.T) { t.Run("Tag", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/tag/v1.0/deep/nesting/folder/secret_sauce_recipe.txt") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo59/src/tag/v1.0/deep/nesting/folder/secret_sauce_recipe.txt")
assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at v1.0 - user2/repo59 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "repo59/deep/nesting/folder/secret_sauce_recipe.txt at v1.0 - user2/repo59 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
}) })
}) })
@ -287,13 +287,13 @@ func TestRepoHTMLTitle(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/issues") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/issues")
assert.EqualValues(t, "Issues - user2/repo1 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "Issues - user2/repo1 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("View issue page", func(t *testing.T) { t.Run("View issue page", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/issues/1") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/issues/1")
assert.EqualValues(t, "#1 - issue1 - user2/repo1 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "#1 - issue1 - user2/repo1 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
}) })
@ -302,13 +302,13 @@ func TestRepoHTMLTitle(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/pulls") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/pulls")
assert.EqualValues(t, "Pull requests - user2/repo1 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "Pull requests - user2/repo1 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
t.Run("View pull request", func(t *testing.T) { t.Run("View pull request", func(t *testing.T) {
defer tests.PrintCurrentTest(t)() defer tests.PrintCurrentTest(t)()
htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/pulls/2") htmlTitle := GetHTMLTitle(t, nil, "/user2/repo1/pulls/2")
assert.EqualValues(t, "#2 - issue2 - user2/repo1 - Gitea: Git with a cup of tea", htmlTitle) assert.EqualValues(t, "#2 - issue2 - user2/repo1 - Forgejo: Beyond coding. We Forge.", htmlTitle)
}) })
}) })
} }

View file

@ -189,7 +189,7 @@ func TestInHistoryButton(t *testing.T) {
func TestTitleDisplayName(t *testing.T) { func TestTitleDisplayName(t *testing.T) {
session := emptyTestSession(t) session := emptyTestSession(t)
title := GetHTMLTitle(t, session, "/") title := GetHTMLTitle(t, session, "/")
assert.Equal(t, "Gitea: Git with a cup of tea", title) assert.Equal(t, "Forgejo: Beyond coding. We Forge.", title)
} }
func TestHomeDisplayName(t *testing.T) { func TestHomeDisplayName(t *testing.T) {
@ -197,7 +197,7 @@ func TestHomeDisplayName(t *testing.T) {
req := NewRequest(t, "GET", "/") req := NewRequest(t, "GET", "/")
resp := session.MakeRequest(t, req, http.StatusOK) resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
assert.Equal(t, "Gitea: Git with a cup of tea", strings.TrimSpace(htmlDoc.Find("h1.title").Text())) assert.Equal(t, "Forgejo: Beyond coding. We Forge.", strings.TrimSpace(htmlDoc.Find("h1.title").Text()))
} }
func TestOpenGraphDisplayName(t *testing.T) { func TestOpenGraphDisplayName(t *testing.T) {
@ -206,7 +206,7 @@ func TestOpenGraphDisplayName(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK) resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
ogTitle, _ := htmlDoc.Find("meta[property='og:title']").Attr("content") ogTitle, _ := htmlDoc.Find("meta[property='og:title']").Attr("content")
assert.Equal(t, "Gitea: Git with a cup of tea", ogTitle) assert.Equal(t, "Forgejo: Beyond coding. We Forge.", ogTitle)
ogSiteName, _ := htmlDoc.Find("meta[property='og:site_name']").Attr("content") ogSiteName, _ := htmlDoc.Find("meta[property='og:site_name']").Attr("content")
assert.Equal(t, "Gitea: Git with a cup of tea", ogSiteName) assert.Equal(t, "Forgejo: Beyond coding. We Forge.", ogSiteName)
} }

View file

@ -1,5 +1,5 @@
APP_NAME = Gitea APP_NAME = Forgejo
APP_SLOGAN = Git with a cup of tea APP_SLOGAN = Beyond coding. We Forge.
RUN_MODE = prod RUN_MODE = prod
[database] [database]

View file

@ -1,5 +1,5 @@
APP_NAME = Gitea APP_NAME = Forgejo
APP_SLOGAN = Git with a cup of tea APP_SLOGAN = Beyond coding. We Forge.
RUN_MODE = prod RUN_MODE = prod
[database] [database]

View file

@ -1,5 +1,5 @@
APP_NAME = Gitea APP_NAME = Forgejo
APP_SLOGAN = Git with a cup of tea APP_SLOGAN = Beyond coding. We Forge.
RUN_MODE = prod RUN_MODE = prod
[database] [database]