mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 12:42:25 -05:00 
			
		
		
		
	[chore] Fix inbox iris test to use 'contains' instead of index (#529)
This commit is contained in:
		
					parent
					
						
							
								c3b6ddddc9
							
						
					
				
			
			
				commit
				
					
						b28fd7433a
					
				
			
		
					 1 changed files with 17 additions and 5 deletions
				
			
		|  | @ -36,9 +36,15 @@ func (suite *InboxTestSuite) TestInboxesForFollowersIRI() { | ||||||
| 
 | 
 | ||||||
| 	inboxIRIs, err := suite.federatingDB.InboxesForIRI(ctx, testrig.URLMustParse(testAccount.FollowersURI)) | 	inboxIRIs, err := suite.federatingDB.InboxesForIRI(ctx, testrig.URLMustParse(testAccount.FollowersURI)) | ||||||
| 	suite.NoError(err) | 	suite.NoError(err) | ||||||
| 	suite.Len(inboxIRIs, 2) | 
 | ||||||
| 	suite.Equal(inboxIRIs[0].String(), suite.testAccounts["local_account_2"].InboxURI) | 	asStrings := []string{} | ||||||
| 	suite.Equal(inboxIRIs[1].String(), suite.testAccounts["admin_account"].InboxURI) | 	for _, i := range inboxIRIs { | ||||||
|  | 		asStrings = append(asStrings, i.String()) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	suite.Len(asStrings, 2) | ||||||
|  | 	suite.Contains(asStrings, suite.testAccounts["local_account_2"].InboxURI) | ||||||
|  | 	suite.Contains(asStrings, suite.testAccounts["admin_account"].InboxURI) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (suite *InboxTestSuite) TestInboxesForAccountIRI() { | func (suite *InboxTestSuite) TestInboxesForAccountIRI() { | ||||||
|  | @ -47,8 +53,14 @@ func (suite *InboxTestSuite) TestInboxesForAccountIRI() { | ||||||
| 
 | 
 | ||||||
| 	inboxIRIs, err := suite.federatingDB.InboxesForIRI(ctx, testrig.URLMustParse(testAccount.URI)) | 	inboxIRIs, err := suite.federatingDB.InboxesForIRI(ctx, testrig.URLMustParse(testAccount.URI)) | ||||||
| 	suite.NoError(err) | 	suite.NoError(err) | ||||||
| 	suite.Len(inboxIRIs, 1) | 
 | ||||||
| 	suite.Equal(inboxIRIs[0].String(), testAccount.InboxURI) | 	asStrings := []string{} | ||||||
|  | 	for _, i := range inboxIRIs { | ||||||
|  | 		asStrings = append(asStrings, i.String()) | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	suite.Len(asStrings, 1) | ||||||
|  | 	suite.Contains(asStrings, suite.testAccounts["local_account_1"].InboxURI) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func TestInboxTestSuite(t *testing.T) { | func TestInboxTestSuite(t *testing.T) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue