1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-26 18:20:57 +00:00

[GITEA] Make pagination test more robust (squash)

- Backport #1882
- Be more specific of which element we want and also don't include the
href into the selector, so if the value changes, it will show the value
that was rendered.
- Ensure stable order of passed repository IDs.
- Resolves codeberg.org/forgejo/forgejo/issues/1880

(cherry picked from commit 79bc4cffe5)
This commit is contained in:
Gusted 2023-12-04 19:27:57 +01:00
parent 1263d0d416
commit 114f18f105
No known key found for this signature in database
GPG key ID: FD821B732837125F
2 changed files with 20 additions and 19 deletions

View file

@ -295,6 +295,10 @@ func Milestones(ctx *context.Context) {
return !showRepoIds.Contains(v)
})
// This is to ensure that testing the expected pagination link is stable.
// As there's no guarantee of order.
slices.Sort(repoIDs)
var pagerCount int
if isShowClosed {
ctx.Data["State"] = "closed"