Skip to content

Commit

Permalink
as: Add test for default pagination in packages
Browse files Browse the repository at this point in the history
  • Loading branch information
halimi committed Dec 3, 2024
1 parent dec23f1 commit 2e8fc9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/applicationserver/io/packages/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"go.thethings.network/lorawan-stack/v3/pkg/config"
"go.thethings.network/lorawan-stack/v3/pkg/errors"
mockis "go.thethings.network/lorawan-stack/v3/pkg/identityserver/mock"
ttnredis "go.thethings.network/lorawan-stack/v3/pkg/redis"
"go.thethings.network/lorawan-stack/v3/pkg/rpcmetadata"
"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
"go.thethings.network/lorawan-stack/v3/pkg/unique"
Expand Down Expand Up @@ -371,6 +372,8 @@ func TestAssociations(t *testing.T) {
t.Run("Pagination", func(t *testing.T) {
a := assertions.New(t)

ttnredis.SetPaginationDefaults(ttnredis.PaginationDefaults{DefaultLimit: 10})

for i := 1; i < 21; i++ {
association := &ttnpb.ApplicationPackageAssociation{
Ids: &ttnpb.ApplicationPackageAssociationIdentifiers{
Expand Down Expand Up @@ -424,8 +427,8 @@ func TestAssociations(t *testing.T) {
limit: 0,
page: 0,
portLow: 1,
portHigh: 20,
length: 20,
portHigh: 10,
length: 10,
},
} {
t.Run(fmt.Sprintf("limit:%v_page:%v", tc.limit, tc.page),
Expand Down

0 comments on commit 2e8fc9d

Please sign in to comment.