diff options
author | 2024-11-25 15:33:21 +0000 | |
---|---|---|
committer | 2024-11-25 15:33:21 +0000 | |
commit | a444adee979375ed5d7af38346029a3d90bc77eb (patch) | |
tree | 8ff7fedc012bdf242451c4d2c4a22c0a714b9b8f /internal/db/bundb/notification_test.go | |
parent | [chore] Bump tooling versions, bump go -> v1.23.0 (#3258) (diff) | |
download | gotosocial-a444adee979375ed5d7af38346029a3d90bc77eb.tar.xz |
[bugfix] notification types missing from link header (#3571)
* ensure notification types get included in link header query for notifications
* fix type query keys
Diffstat (limited to 'internal/db/bundb/notification_test.go')
-rw-r--r-- | internal/db/bundb/notification_test.go | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/internal/db/bundb/notification_test.go b/internal/db/bundb/notification_test.go index eb2c02066..8e2fb8031 100644 --- a/internal/db/bundb/notification_test.go +++ b/internal/db/bundb/notification_test.go @@ -28,6 +28,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/gtscontext" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/id" + "github.com/superseriousbusiness/gotosocial/internal/paging" "github.com/superseriousbusiness/gotosocial/internal/util" ) @@ -92,10 +93,11 @@ func (suite *NotificationTestSuite) TestGetAccountNotificationsWithSpam() { notifications, err := suite.db.GetAccountNotifications( gtscontext.SetBarebones(context.Background()), testAccount.ID, - id.Highest, - id.Lowest, - "", - 20, + &paging.Page{ + Min: paging.EitherMinID("", id.Lowest), + Max: paging.MaxID(id.Highest), + Limit: 20, + }, nil, nil, ) @@ -115,10 +117,11 @@ func (suite *NotificationTestSuite) TestGetAccountNotificationsWithoutSpam() { notifications, err := suite.db.GetAccountNotifications( gtscontext.SetBarebones(context.Background()), testAccount.ID, - id.Highest, - id.Lowest, - "", - 20, + &paging.Page{ + Min: paging.EitherMinID("", id.Lowest), + Max: paging.MaxID(id.Highest), + Limit: 20, + }, nil, nil, ) @@ -140,10 +143,11 @@ func (suite *NotificationTestSuite) TestDeleteNotificationsWithSpam() { notifications, err := suite.db.GetAccountNotifications( gtscontext.SetBarebones(context.Background()), testAccount.ID, - id.Highest, - id.Lowest, - "", - 20, + &paging.Page{ + Min: paging.EitherMinID("", id.Lowest), + Max: paging.MaxID(id.Highest), + Limit: 20, + }, nil, nil, ) @@ -161,10 +165,11 @@ func (suite *NotificationTestSuite) TestDeleteNotificationsWithSpam() { notifications, err = suite.db.GetAccountNotifications( gtscontext.SetBarebones(context.Background()), testAccount.ID, - id.Highest, - id.Lowest, - "", - 20, + &paging.Page{ + Min: paging.EitherMinID("", id.Lowest), + Max: paging.MaxID(id.Highest), + Limit: 20, + }, nil, nil, ) @@ -183,10 +188,11 @@ func (suite *NotificationTestSuite) TestDeleteNotificationsWithTwoAccounts() { notifications, err := suite.db.GetAccountNotifications( gtscontext.SetBarebones(context.Background()), testAccount.ID, - id.Highest, - id.Lowest, - "", - 20, + &paging.Page{ + Min: paging.EitherMinID("", id.Lowest), + Max: paging.MaxID(id.Highest), + Limit: 20, + }, nil, nil, ) |