fix: improve stability of `TestReevaluateMemberAdminRoleInClosedCommunity`
This commit is contained in:
parent
63131aebbc
commit
a31dea7988
|
@ -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 {
|
waitOnCommunityPermissionCreated := waitOnCommunitiesEvent(s.owner, func(sub *communities.Subscription) bool {
|
||||||
return len(sub.Community.TokenPermissions()) == 2
|
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
|
err = <-waitOnCommunityPermissionCreated
|
||||||
s.Require().NoError(err)
|
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)
|
s.advertiseCommunityTo(community, s.alice)
|
||||||
|
|
||||||
var tokenPermission *protobuf.CommunityTokenPermission
|
var tokenPermission *protobuf.CommunityTokenPermission
|
||||||
|
|
Loading…
Reference in New Issue