mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 18:17:19 +00:00
Fix tests code to prevent some runtime errors (#2381)
* Fix tests code to prevent some runtime errors * Reduce nesting
This commit is contained in:
@ -29,9 +29,10 @@ func TestNotificationsForUser(t *testing.T) {
|
||||
statuses := []NotificationStatus{NotificationStatusRead, NotificationStatusUnread}
|
||||
notfs, err := NotificationsForUser(user, statuses, 1, 10)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, notfs, 1)
|
||||
assert.EqualValues(t, 2, notfs[0].ID)
|
||||
assert.EqualValues(t, user.ID, notfs[0].UserID)
|
||||
if assert.Len(t, notfs, 1) {
|
||||
assert.EqualValues(t, 2, notfs[0].ID)
|
||||
assert.EqualValues(t, user.ID, notfs[0].UserID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNotification_GetRepo(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user