mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-28 12:09:56 +00:00
chore: sort blocked users list for determistic results (#8320)
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Has been skipped
testing-integration / test-sqlite (push) Has been skipped
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Has been skipped
testing-integration / test-sqlite (push) Has been skipped
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
- Ref https://codeberg.org/forgejo/forgejo/issues/8221#issuecomment-5515478 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8320 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
69d374435b
commit
6b27fa66b9
1 changed files with 3 additions and 0 deletions
|
@ -4,8 +4,10 @@
|
|||
package integration
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
auth_model "forgejo.org/models/auth"
|
||||
|
@ -46,6 +48,7 @@ func TestAPIUserBlock(t *testing.T) {
|
|||
var blockedUsers []api.BlockedUser
|
||||
DecodeJSON(t, resp, &blockedUsers)
|
||||
assert.Len(t, blockedUsers, 2)
|
||||
slices.SortFunc(blockedUsers, func(a, b api.BlockedUser) int { return cmp.Compare(a.BlockID, b.BlockID) })
|
||||
assert.EqualValues(t, 1, blockedUsers[0].BlockID)
|
||||
assert.EqualValues(t, 2, blockedUsers[1].BlockID)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue