mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-15 18:56:59 +00:00
[GITEA] Use correct translations for pull request
- When a commit references a pull request, the detail strings should reflect that. Add a new translation string for the pull request. - Added integration tests. - Resolves #2256
This commit is contained in:
parent
d5b57d41ac
commit
0d054cd4d9
4 changed files with 50 additions and 1 deletions
|
@ -770,3 +770,30 @@ func TestGetContentHistory(t *testing.T) {
|
|||
testCase(t, loginUser(t, "user5"), true)
|
||||
})
|
||||
}
|
||||
|
||||
func TestCommitRefComment(t *testing.T) {
|
||||
defer tests.AddFixtures("tests/integration/fixtures/TestCommitRefComment/")()
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
t.Run("Pull request", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
req := NewRequest(t, "GET", "/user2/repo1/pulls/2")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
|
||||
event := htmlDoc.Find("#issuecomment-1000 .text").Text()
|
||||
assert.Contains(t, event, "referenced this pull request")
|
||||
})
|
||||
|
||||
t.Run("Issue", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
req := NewRequest(t, "GET", "/user2/repo1/issues/1")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
|
||||
event := htmlDoc.Find("#issuecomment-1001 .text").Text()
|
||||
assert.Contains(t, event, "referenced this issue")
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue