1
0
Fork 0
forked from forgejo/forgejo

[BUG] Render correct label link

- Render the correct label for pull requests, it should link to the pull
requests list and not the issue list.
- Add unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/3183
This commit is contained in:
Gusted 2024-04-12 14:31:44 +02:00
parent c3aed7cb69
commit 7a97c05206
No known key found for this signature in database
GPG key ID: FD821B732837125F
4 changed files with 50 additions and 23 deletions

View file

@ -0,0 +1,24 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package templates_test
import (
"context"
"testing"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/markup"
_ "code.gitea.io/gitea/models"
_ "code.gitea.io/gitea/models/issues"
)
func TestMain(m *testing.M) {
markup.Init(&markup.ProcessorHelper{
IsUsernameMentionable: func(ctx context.Context, username string) bool {
return username == "mention-user"
},
})
unittest.MainTest(m)
}