summaryrefslogtreecommitdiff
path: root/internal/db/bundb/notification_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-05-04 12:27:24 +0200
committerLibravatar GitHub <noreply@github.com>2023-05-04 12:27:24 +0200
commit4a012acd5255585045babfb38202e9df4bb1fdee (patch)
treecb8ed7d3fba01751de44fd96bdf905b967f93c7a /internal/db/bundb/notification_test.go
parent[bugfix] Fix invalid og:description on account w/ empty note (#1733) (diff)
downloadgotosocial-4a012acd5255585045babfb38202e9df4bb1fdee.tar.xz
[bugfix] Rework notifs to use min_id for paging up (#1734)
Diffstat (limited to 'internal/db/bundb/notification_test.go')
-rw-r--r--internal/db/bundb/notification_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/db/bundb/notification_test.go b/internal/db/bundb/notification_test.go
index bdee911b3..8bbea78ad 100644
--- a/internal/db/bundb/notification_test.go
+++ b/internal/db/bundb/notification_test.go
@@ -89,7 +89,7 @@ func (suite *NotificationTestSuite) TestGetAccountNotificationsWithSpam() {
suite.spamNotifs()
testAccount := suite.testAccounts["local_account_1"]
before := time.Now()
- notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, []string{}, 20, id.Highest, id.Lowest)
+ notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, id.Highest, id.Lowest, "", 20, nil)
suite.NoError(err)
timeTaken := time.Since(before)
fmt.Printf("\n\n\n withSpam: got %d notifications in %s\n\n\n", len(notifications), timeTaken)
@@ -103,7 +103,7 @@ func (suite *NotificationTestSuite) TestGetAccountNotificationsWithSpam() {
func (suite *NotificationTestSuite) TestGetAccountNotificationsWithoutSpam() {
testAccount := suite.testAccounts["local_account_1"]
before := time.Now()
- notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, []string{}, 20, id.Highest, id.Lowest)
+ notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, id.Highest, id.Lowest, "", 20, nil)
suite.NoError(err)
timeTaken := time.Since(before)
fmt.Printf("\n\n\n withoutSpam: got %d notifications in %s\n\n\n", len(notifications), timeTaken)
@@ -120,9 +120,9 @@ func (suite *NotificationTestSuite) TestDeleteNotificationsWithSpam() {
err := suite.db.DeleteNotifications(context.Background(), nil, testAccount.ID, "")
suite.NoError(err)
- notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, []string{}, 20, id.Highest, id.Lowest)
+ notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, id.Highest, id.Lowest, "", 20, nil)
suite.NoError(err)
- suite.NotNil(notifications)
+ suite.Nil(notifications)
suite.Empty(notifications)
}
@@ -132,9 +132,9 @@ func (suite *NotificationTestSuite) TestDeleteNotificationsWithTwoAccounts() {
err := suite.db.DeleteNotifications(context.Background(), nil, testAccount.ID, "")
suite.NoError(err)
- notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, []string{}, 20, id.Highest, id.Lowest)
+ notifications, err := suite.db.GetAccountNotifications(context.Background(), testAccount.ID, id.Highest, id.Lowest, "", 20, nil)
suite.NoError(err)
- suite.NotNil(notifications)
+ suite.Nil(notifications)
suite.Empty(notifications)
notif := []*gtsmodel.Notification{}