chore(tests)_: createCommunityConfigurable creates only one chat (#5204)

This commit is contained in:
Mykhailo Prakhov 2024-05-22 15:08:44 +02:00 committed by GitHub
parent 133ad0946b
commit 6fbf2cf17f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 20 deletions

View File

@ -328,28 +328,13 @@ func createCommunityConfigurable(s *suite.Suite, owner *Messenger, permission pr
community := response.Communities()[0]
s.Require().True(community.Joined())
s.Require().True(community.IsControlNode())
s.Require().Len(community.Chats(), 1)
s.Require().Len(response.CommunitiesSettings(), 1)
communitySettings := response.CommunitiesSettings()[0]
s.Require().Equal(communitySettings.CommunityID, community.IDString())
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]
}

View File

@ -2172,7 +2172,7 @@ func (s *MessengerCommunitiesSuite) TestLeaveAndRejoinCommunity() {
numberInactiveChats++
}
}
s.Require().Equal(3, numberInactiveChats)
s.Require().Equal(2, numberInactiveChats)
// alice can rejoin
s.joinCommunity(community, s.owner, s.alice)

View File

@ -2030,7 +2030,7 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestReevaluateMemberPermissi
community, err := s.owner.communitiesManager.GetByID(community.ID())
s.Require().NoError(err)
s.Require().Len(community.Chats(), 2)
s.Require().Len(community.Chats(), 1)
requestToJoin := &communities.RequestToJoin{
Clock: uint64(time.Now().Unix()),
@ -2070,7 +2070,7 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestReevaluateMemberPermissi
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++ {
newChat := &protobuf.CommunityChat{
@ -2088,7 +2088,7 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestReevaluateMemberPermissi
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)
s.Require().NoError(err)