Add an trailing slash to dashboard links (#29555)

Fix #29533, and add some tests for "base/paginate.tmpl"

(cherry picked from commit 8553b4600e3035b6f6ad6907c37cebd013fa4d64)

Conflicts:
	services/contexttest/context_tests.go
	trivial conflict because
	"Improve user experience for outdated comments" was skipped
This commit is contained in:
wxiaoguang 2024-03-04 09:02:51 +08:00 committed by Earl Warren
parent cfce4e089e
commit de6768ed54
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
5 changed files with 33 additions and 10 deletions

View file

@ -12,6 +12,7 @@ import (
"net/url"
"strings"
"testing"
"time"
access_model "code.gitea.io/gitea/models/perm/access"
repo_model "code.gitea.io/gitea/models/repo"
@ -60,8 +61,9 @@ func MockContext(t *testing.T, reqPath string, opts ...MockContextOption) (*cont
base.Data = middleware.GetContextData(req.Context())
base.Locale = &translation.MockLocale{}
ctx := context.NewWebContext(base, &MockRender{}, nil)
ctx := context.NewWebContext(base, opt.Render, nil)
ctx.PageData = map[string]any{}
ctx.Data["PageStartTime"] = time.Now()
chiCtx := chi.NewRouteContext()
ctx.Base.AppendContextValue(chi.RouteCtxKey, chiCtx)
return ctx, resp