mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
4083aae162
* chore_: improve readability of `TestE2eSendingReceivingProfilePicture` * chore_: cleanup logs * chore_: remove generateKeyUID * chore_: cleanup logs * chore_: move chat message sending to switch case * chore_: remove redundant args * chore_: simplify images check * chore(testMesengerConfig)_: add createSettings option * chore_: move TestMessengerCollapsedCommunityCategoriesSuite * chore(MessengerProfilePictureHandlerSuite)_: simpler messenger creation * chore_: MessengerProfilePictureHandlerSuite test cases * chore_: lint fix * chore_: address pr comments
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
package protocol
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
"github.com/status-im/status-go/protocol/requests"
|
|
)
|
|
|
|
func TestMessengerCollapsedCommunityCategoriesSuite(t *testing.T) {
|
|
suite.Run(t, new(MessengerCollapsedCommunityCategoriesSuite))
|
|
}
|
|
|
|
type MessengerCollapsedCommunityCategoriesSuite struct {
|
|
MessengerBaseTestSuite
|
|
}
|
|
|
|
func (s *MessengerCollapsedCommunityCategoriesSuite) TestUpsertCollapsedCommunityCategories() {
|
|
communityID := "community-id"
|
|
categoryID := "category-id"
|
|
request := &requests.ToggleCollapsedCommunityCategory{
|
|
CommunityID: communityID,
|
|
CategoryID: categoryID,
|
|
Collapsed: true,
|
|
}
|
|
|
|
s.Require().NoError(s.m.ToggleCollapsedCommunityCategory(request))
|
|
|
|
categories, err := s.m.CollapsedCommunityCategories()
|
|
s.Require().NoError(err)
|
|
s.Require().Len(categories, 1)
|
|
s.Require().Equal(communityID, categories[0].CommunityID)
|
|
s.Require().Equal(categoryID, categories[0].CategoryID)
|
|
|
|
request.Collapsed = false
|
|
|
|
s.Require().NoError(s.m.ToggleCollapsedCommunityCategory(request))
|
|
|
|
categories, err = s.m.CollapsedCommunityCategories()
|
|
s.Require().NoError(err)
|
|
s.Require().Len(categories, 0)
|
|
}
|