Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,9 @@ func ExampleChannel_Query() {
// amount of messages sent when the CountMessages feature is enabled (default behaviour).
func TestChannel_MessageCount_DefaultEnabled(t *testing.T) {
c := initClient(t)
ch := initChannel(t, c)
ctx := context.Background()
// team channel type has CountMessages enabled by default
ch := initChannel(t, c)

// Send a single message to the channel
user := randomUser(t, c)
Expand All @@ -968,7 +969,7 @@ func TestChannel_MessageCount_DefaultEnabled(t *testing.T) {
// CountMessages feature is disabled via config_override.
func TestChannel_MessageCount_Disabled(t *testing.T) {
c := initClient(t)
ch := initChannel(t, c)
ch := initChannelWithType(t, c, "messaging")
ctx := context.Background()

// Disable the count_messages feature for this channel via partial update
Expand Down
6 changes: 5 additions & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ func initClient(t *testing.T) *Client {
}

func initChannel(t *testing.T, c *Client, membersID ...string) *Channel {
return initChannelWithType(t, c, "team", membersID...)
}

func initChannelWithType(t *testing.T, c *Client, channelType string, membersID ...string) *Channel {
t.Helper()

owner := randomUser(t, c)
ctx := context.Background()

resp, err := c.CreateChannelWithMembers(ctx, "team", randomString(12), owner.ID, membersID...)
resp, err := c.CreateChannelWithMembers(ctx, channelType, randomString(12), owner.ID, membersID...)
require.NoError(t, err, "create channel")

t.Cleanup(func() {
Expand Down