fix: improve stability of `TestReevaluateMemberAdminRoleInClosedCommunity`

This commit is contained in:
Patryk Osmaczko 2023-08-21 09:20:25 +02:00 committed by osmaczko
parent 63131aebbc
commit a31dea7988
1 changed files with 9 additions and 10 deletions

View File

@ -1092,23 +1092,22 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) testReevaluateMemberPrivileg
},
}
response, err = s.owner.CreateCommunityTokenPermission(createTokenMemberPermission)
s.Require().NoError(err)
s.Require().NotNil(response)
s.Require().Len(response.Communities(), 1)
s.Require().True(response.Communities()[0].HasTokenPermissions())
waitOnCommunityPermissionCreated := waitOnCommunitiesEvent(s.owner, func(sub *communities.Subscription) bool {
return len(sub.Community.TokenPermissions()) == 2
})
response, err = s.owner.CreateCommunityTokenPermission(createTokenMemberPermission)
s.Require().NoError(err)
s.Require().NotNil(response)
s.Require().Len(response.Communities(), 1)
community = response.Communities()[0]
s.Require().True(community.HasTokenPermissions())
s.Require().Len(community.TokenPermissions(), 2)
err = <-waitOnCommunityPermissionCreated
s.Require().NoError(err)
community, err = s.owner.communitiesManager.GetByID(community.ID())
s.Require().NoError(err)
s.Require().Len(community.TokenPermissions(), 2)
s.advertiseCommunityTo(community, s.alice)
var tokenPermission *protobuf.CommunityTokenPermission