mirror of
https://github.com/status-im/status-go.git
synced 2025-02-08 04:43:52 +00:00
chore(tests)_: createCommunityConfigurable creates only one chat (#5204)
This commit is contained in:
parent
133ad0946b
commit
6fbf2cf17f
@ -328,28 +328,13 @@ func createCommunityConfigurable(s *suite.Suite, owner *Messenger, permission pr
|
|||||||
community := response.Communities()[0]
|
community := response.Communities()[0]
|
||||||
s.Require().True(community.Joined())
|
s.Require().True(community.Joined())
|
||||||
s.Require().True(community.IsControlNode())
|
s.Require().True(community.IsControlNode())
|
||||||
|
s.Require().Len(community.Chats(), 1)
|
||||||
|
|
||||||
s.Require().Len(response.CommunitiesSettings(), 1)
|
s.Require().Len(response.CommunitiesSettings(), 1)
|
||||||
communitySettings := response.CommunitiesSettings()[0]
|
communitySettings := response.CommunitiesSettings()[0]
|
||||||
s.Require().Equal(communitySettings.CommunityID, community.IDString())
|
s.Require().Equal(communitySettings.CommunityID, community.IDString())
|
||||||
s.Require().Equal(communitySettings.HistoryArchiveSupportEnabled, false)
|
s.Require().Equal(communitySettings.HistoryArchiveSupportEnabled, false)
|
||||||
|
|
||||||
orgChat := &protobuf.CommunityChat{
|
|
||||||
Permissions: &protobuf.CommunityPermissions{
|
|
||||||
Access: protobuf.CommunityPermissions_AUTO_ACCEPT,
|
|
||||||
},
|
|
||||||
Identity: &protobuf.ChatIdentity{
|
|
||||||
DisplayName: "status-core",
|
|
||||||
Emoji: "😎",
|
|
||||||
Description: "status-core community chat",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
response, err = owner.CreateCommunityChat(community.ID(), orgChat)
|
|
||||||
s.Require().NoError(err)
|
|
||||||
s.Require().NotNil(response)
|
|
||||||
s.Require().Len(response.Chats(), 1)
|
|
||||||
|
|
||||||
return community, response.Chats()[0]
|
return community, response.Chats()[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2172,7 +2172,7 @@ func (s *MessengerCommunitiesSuite) TestLeaveAndRejoinCommunity() {
|
|||||||
numberInactiveChats++
|
numberInactiveChats++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.Require().Equal(3, numberInactiveChats)
|
s.Require().Equal(2, numberInactiveChats)
|
||||||
|
|
||||||
// alice can rejoin
|
// alice can rejoin
|
||||||
s.joinCommunity(community, s.owner, s.alice)
|
s.joinCommunity(community, s.owner, s.alice)
|
||||||
|
@ -2030,7 +2030,7 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestReevaluateMemberPermissi
|
|||||||
|
|
||||||
community, err := s.owner.communitiesManager.GetByID(community.ID())
|
community, err := s.owner.communitiesManager.GetByID(community.ID())
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
s.Require().Len(community.Chats(), 2)
|
s.Require().Len(community.Chats(), 1)
|
||||||
|
|
||||||
requestToJoin := &communities.RequestToJoin{
|
requestToJoin := &communities.RequestToJoin{
|
||||||
Clock: uint64(time.Now().Unix()),
|
Clock: uint64(time.Now().Unix()),
|
||||||
@ -2070,7 +2070,7 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestReevaluateMemberPermissi
|
|||||||
|
|
||||||
s.Require().Equal(community.MembersCount(), keysCount+1) // 1 is owner
|
s.Require().Equal(community.MembersCount(), keysCount+1) // 1 is owner
|
||||||
|
|
||||||
chatsCount := 8 // in total will be 10, 2 channels were created during creating the community
|
chatsCount := 9 // in total will be 10, 1 channel were created during creating the community
|
||||||
|
|
||||||
for i := 0; i < chatsCount; i++ {
|
for i := 0; i < chatsCount; i++ {
|
||||||
newChat := &protobuf.CommunityChat{
|
newChat := &protobuf.CommunityChat{
|
||||||
@ -2088,7 +2088,7 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestReevaluateMemberPermissi
|
|||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Require().Len(community.Chats(), chatsCount+2) // 2 chats were created during community creation
|
s.Require().Len(community.Chats(), chatsCount+1) // 1 chat were created during community creation
|
||||||
|
|
||||||
err = s.owner.communitiesManager.SaveCommunity(community)
|
err = s.owner.communitiesManager.SaveCommunity(community)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user