[bugfix] notification types missing from link header (#3571)

* ensure notification types get included in link header query for notifications

* fix type query keys
This commit is contained in:
kim 2024-11-25 15:33:21 +00:00 committed by GitHub
commit a444adee97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 87 additions and 103 deletions

View file

@ -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,
)