Fix tests code to prevent some runtime errors (#2381)
* Fix tests code to prevent some runtime errors * Reduce nesting
This commit is contained in:
		
							parent
							
								
									ced50e0ec1
								
							
						
					
					
						commit
						8e61823ec4
					
				
					 15 changed files with 181 additions and 150 deletions
				
			
		| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue