MM-26376: Fix flaky test SearchAllChannels (#14878)
Applying the same fix done in #14840
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
938176be3e
Коммит
60b826824a
@@ -1190,7 +1190,7 @@ func TestSearchAllChannels(t *testing.T) {
|
|||||||
Client := th.Client
|
Client := th.Client
|
||||||
|
|
||||||
channel := &model.Channel{
|
channel := &model.Channel{
|
||||||
DisplayName: "FOOBAR",
|
DisplayName: "FOOBARDISPLAYNAME",
|
||||||
Name: "whatever",
|
Name: "whatever",
|
||||||
Type: model.CHANNEL_OPEN,
|
Type: model.CHANNEL_OPEN,
|
||||||
TeamId: th.BasicTeam.Id,
|
TeamId: th.BasicTeam.Id,
|
||||||
@@ -1202,7 +1202,7 @@ func TestSearchAllChannels(t *testing.T) {
|
|||||||
foobarchannel, err := th.SystemAdminClient.CreateChannel(channel)
|
foobarchannel, err := th.SystemAdminClient.CreateChannel(channel)
|
||||||
CheckNoError(t, err)
|
CheckNoError(t, err)
|
||||||
|
|
||||||
search := &model.ChannelSearch{Term: "oob"}
|
search := &model.ChannelSearch{Term: "bardisplay"}
|
||||||
|
|
||||||
channels, resp := th.SystemAdminClient.SearchAllChannels(search)
|
channels, resp := th.SystemAdminClient.SearchAllChannels(search)
|
||||||
CheckNoError(t, resp)
|
CheckNoError(t, resp)
|
||||||
@@ -1210,7 +1210,7 @@ func TestSearchAllChannels(t *testing.T) {
|
|||||||
assert.Len(t, *channels, 1)
|
assert.Len(t, *channels, 1)
|
||||||
assert.Equal(t, foobarchannel.Id, (*channels)[0].Id)
|
assert.Equal(t, foobarchannel.Id, (*channels)[0].Id)
|
||||||
|
|
||||||
search = &model.ChannelSearch{Term: "foo"}
|
search = &model.ChannelSearch{Term: "foobar"}
|
||||||
|
|
||||||
channels, resp = th.SystemAdminClient.SearchAllChannels(search)
|
channels, resp = th.SystemAdminClient.SearchAllChannels(search)
|
||||||
CheckNoError(t, resp)
|
CheckNoError(t, resp)
|
||||||
@@ -1218,7 +1218,7 @@ func TestSearchAllChannels(t *testing.T) {
|
|||||||
assert.Len(t, *channels, 1)
|
assert.Len(t, *channels, 1)
|
||||||
assert.Equal(t, foobarchannel.Id, (*channels)[0].Id)
|
assert.Equal(t, foobarchannel.Id, (*channels)[0].Id)
|
||||||
|
|
||||||
search = &model.ChannelSearch{Term: "bar"}
|
search = &model.ChannelSearch{Term: "displayname"}
|
||||||
|
|
||||||
channels, resp = th.SystemAdminClient.SearchAllChannels(search)
|
channels, resp = th.SystemAdminClient.SearchAllChannels(search)
|
||||||
CheckNoError(t, resp)
|
CheckNoError(t, resp)
|
||||||
|
|||||||
@@ -1221,7 +1221,7 @@ func TestSearchAllTeamsPaged(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foobarTeam, err := th.App.CreateTeam(&model.Team{
|
foobarTeam, err := th.App.CreateTeam(&model.Team{
|
||||||
DisplayName: "FOOBAR",
|
DisplayName: "FOOBARDISPLAYNAME",
|
||||||
Name: "whatever",
|
Name: "whatever",
|
||||||
Type: model.TEAM_OPEN,
|
Type: model.TEAM_OPEN,
|
||||||
Email: th.GenerateTestEmail(),
|
Email: th.GenerateTestEmail(),
|
||||||
@@ -1236,19 +1236,19 @@ func TestSearchAllTeamsPaged(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
Name: "Get foobar channel",
|
Name: "Get foobar channel",
|
||||||
Search: &model.TeamSearch{Term: "oob", Page: model.NewInt(0), PerPage: model.NewInt(100)},
|
Search: &model.TeamSearch{Term: "oobardisplay", Page: model.NewInt(0), PerPage: model.NewInt(100)},
|
||||||
ExpectedTeams: []string{foobarTeam.Id},
|
ExpectedTeams: []string{foobarTeam.Id},
|
||||||
ExpectedTotalCount: 1,
|
ExpectedTotalCount: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "Get foobar channel",
|
Name: "Get foobar channel",
|
||||||
Search: &model.TeamSearch{Term: "foo", Page: model.NewInt(0), PerPage: model.NewInt(100)},
|
Search: &model.TeamSearch{Term: "foobar", Page: model.NewInt(0), PerPage: model.NewInt(100)},
|
||||||
ExpectedTeams: []string{foobarTeam.Id},
|
ExpectedTeams: []string{foobarTeam.Id},
|
||||||
ExpectedTotalCount: 1,
|
ExpectedTotalCount: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "Get foobar channel",
|
Name: "Get foobar channel",
|
||||||
Search: &model.TeamSearch{Term: "bar", Page: model.NewInt(0), PerPage: model.NewInt(100)},
|
Search: &model.TeamSearch{Term: "bardisplayname", Page: model.NewInt(0), PerPage: model.NewInt(100)},
|
||||||
ExpectedTeams: []string{foobarTeam.Id},
|
ExpectedTeams: []string{foobarTeam.Id},
|
||||||
ExpectedTotalCount: 1,
|
ExpectedTotalCount: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user