mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-06 02:23:16 -06:00
[bugfix] Delete mutual follow (requests) when receiving block from remote (#1960)
* [bugfix] Delete mutual follow (requests) on block * fix test
This commit is contained in:
parent
747ea584bd
commit
f40bb02f31
5 changed files with 112 additions and 24 deletions
|
|
@ -734,7 +734,7 @@ func (suite *RelationshipTestSuite) TestRejectFollowRequestNotExisting() {
|
|||
targetAccount := suite.testAccounts["local_account_2"]
|
||||
|
||||
err := suite.db.RejectFollowRequest(ctx, account.ID, targetAccount.ID)
|
||||
suite.ErrorIs(err, db.ErrNoEntries)
|
||||
suite.NoError(err)
|
||||
}
|
||||
|
||||
func (suite *RelationshipTestSuite) TestGetAccountFollowRequests() {
|
||||
|
|
@ -836,6 +836,19 @@ func (suite *RelationshipTestSuite) TestGetFollowNotExisting() {
|
|||
suite.Nil(follow)
|
||||
}
|
||||
|
||||
func (suite *RelationshipTestSuite) TestDeleteFollow() {
|
||||
ctx := context.Background()
|
||||
originAccount := suite.testAccounts["local_account_1"]
|
||||
targetAccount := suite.testAccounts["admin_account"]
|
||||
|
||||
err := suite.db.DeleteFollow(ctx, originAccount.ID, targetAccount.ID)
|
||||
suite.NoError(err)
|
||||
|
||||
follow, err := suite.db.GetFollow(ctx, originAccount.ID, targetAccount.ID)
|
||||
suite.EqualError(err, db.ErrNoEntries.Error())
|
||||
suite.Nil(follow)
|
||||
}
|
||||
|
||||
func (suite *RelationshipTestSuite) TestUnfollowRequestExisting() {
|
||||
ctx := context.Background()
|
||||
originAccount := suite.testAccounts["admin_account"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue