Skip to content

Commit e4fdf0e

Browse files
authored
[CHA-1300] Update channel type instead of relying on FF (#355)
* Update channel type * Sleep * Sleep less * less sleep * Cleanup * Back to 500 ms * Using specific channel type * Lets try this * Added comment
1 parent e3213ab commit e4fdf0e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

channel_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,9 @@ func ExampleChannel_Query() {
948948
// amount of messages sent when the CountMessages feature is enabled (default behaviour).
949949
func TestChannel_MessageCount_DefaultEnabled(t *testing.T) {
950950
c := initClient(t)
951-
ch := initChannel(t, c)
952951
ctx := context.Background()
952+
// team channel type has CountMessages enabled by default
953+
ch := initChannel(t, c)
953954

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

974975
// Disable the count_messages feature for this channel via partial update

client_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ func initClient(t *testing.T) *Client {
2020
}
2121

2222
func initChannel(t *testing.T, c *Client, membersID ...string) *Channel {
23+
return initChannelWithType(t, c, "team", membersID...)
24+
}
25+
26+
func initChannelWithType(t *testing.T, c *Client, channelType string, membersID ...string) *Channel {
2327
t.Helper()
2428

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

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

3135
t.Cleanup(func() {

0 commit comments

Comments
 (0)