diff options
Diffstat (limited to 'internal/api/client/notifications/notificationsget_test.go')
-rw-r--r-- | internal/api/client/notifications/notificationsget_test.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/internal/api/client/notifications/notificationsget_test.go b/internal/api/client/notifications/notificationsget_test.go index 97d0e854b..5a6f83959 100644 --- a/internal/api/client/notifications/notificationsget_test.go +++ b/internal/api/client/notifications/notificationsget_test.go @@ -248,6 +248,45 @@ func (suite *NotificationsTestSuite) TestGetNotificationsIncludeOneType() { } } +// Test including an unknown notification type, it should be ignored. +func (suite *NotificationsTestSuite) TestGetNotificationsIncludeUnknownType() { + testAccount := suite.testAccounts["local_account_1"] + testToken := suite.testTokens["local_account_1"] + testUser := suite.testUsers["local_account_1"] + + suite.addMoreNotifications(testAccount) + + maxID := "" + minID := "" + limit := 10 + types := []string{"favourite", "something.weird"} + excludeTypes := []string(nil) + expectedHTTPStatus := http.StatusOK + expectedBody := "" + + notifications, _, err := suite.getNotifications( + testAccount, + testToken, + testUser, + maxID, + minID, + limit, + types, + excludeTypes, + expectedHTTPStatus, + expectedBody, + ) + if err != nil { + suite.FailNow(err.Error()) + } + + // This should only include the fav notification. + suite.Len(notifications, 1) + for _, notification := range notifications { + suite.Equal("favourite", notification.Type) + } +} + func TestBookmarkTestSuite(t *testing.T) { suite.Run(t, new(NotificationsTestSuite)) } |