Unit test fixes (#10117)
* eliminate redundant Client/AdminClient declarations * harden TestUpdateChannelScheme to API failures * eliminate unnecessary config restoration * minor cleanup * make TestGenerateMfaSecret config dependency explicit * Update api4/user_test.go Co-Authored-By: lieut-data <jesse.hallam@gmail.com> * Update api4/user_test.go Co-Authored-By: lieut-data <jesse.hallam@gmail.com> * fix fix for TestUpdateChannelScheme...
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
ba5566d1a0
Коммит
8af05aa43a
@@ -2347,7 +2347,7 @@ func TestUpdateChannelScheme(t *testing.T) {
|
|||||||
|
|
||||||
th.App.SetPhase2PermissionsMigrationStatus(true)
|
th.App.SetPhase2PermissionsMigrationStatus(true)
|
||||||
|
|
||||||
team := &model.Team{
|
team, resp := th.SystemAdminClient.CreateTeam(&model.Team{
|
||||||
DisplayName: "Name",
|
DisplayName: "Name",
|
||||||
Description: "Some description",
|
Description: "Some description",
|
||||||
CompanyName: "Some company name",
|
CompanyName: "Some company name",
|
||||||
@@ -2356,34 +2356,35 @@ func TestUpdateChannelScheme(t *testing.T) {
|
|||||||
Name: "z-z-" + model.NewId() + "a",
|
Name: "z-z-" + model.NewId() + "a",
|
||||||
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
||||||
Type: model.TEAM_OPEN,
|
Type: model.TEAM_OPEN,
|
||||||
}
|
})
|
||||||
team, _ = th.SystemAdminClient.CreateTeam(team)
|
CheckNoError(t, resp)
|
||||||
|
|
||||||
channel := &model.Channel{
|
channel, resp := th.SystemAdminClient.CreateChannel(&model.Channel{
|
||||||
DisplayName: "Name",
|
DisplayName: "Name",
|
||||||
Name: "z-z-" + model.NewId() + "a",
|
Name: "z-z-" + model.NewId() + "a",
|
||||||
Type: model.CHANNEL_OPEN,
|
Type: model.CHANNEL_OPEN,
|
||||||
TeamId: team.Id,
|
TeamId: team.Id,
|
||||||
}
|
})
|
||||||
channel, _ = th.SystemAdminClient.CreateChannel(channel)
|
CheckNoError(t, resp)
|
||||||
|
|
||||||
channelScheme := &model.Scheme{
|
channelScheme, resp := th.SystemAdminClient.CreateScheme(&model.Scheme{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
Name: model.NewId(),
|
Name: model.NewId(),
|
||||||
Description: "Some description",
|
Description: "Some description",
|
||||||
Scope: model.SCHEME_SCOPE_CHANNEL,
|
Scope: model.SCHEME_SCOPE_CHANNEL,
|
||||||
}
|
})
|
||||||
channelScheme, _ = th.SystemAdminClient.CreateScheme(channelScheme)
|
CheckNoError(t, resp)
|
||||||
teamScheme := &model.Scheme{
|
|
||||||
|
teamScheme, resp := th.SystemAdminClient.CreateScheme(&model.Scheme{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
Name: model.NewId(),
|
Name: model.NewId(),
|
||||||
Description: "Some description",
|
Description: "Some description",
|
||||||
Scope: model.SCHEME_SCOPE_TEAM,
|
Scope: model.SCHEME_SCOPE_TEAM,
|
||||||
}
|
})
|
||||||
teamScheme, _ = th.SystemAdminClient.CreateScheme(teamScheme)
|
CheckNoError(t, resp)
|
||||||
|
|
||||||
// Test the setup/base case.
|
// Test the setup/base case.
|
||||||
_, resp := th.SystemAdminClient.UpdateChannelScheme(channel.Id, channelScheme.Id)
|
_, resp = th.SystemAdminClient.UpdateChannelScheme(channel.Id, channelScheme.Id)
|
||||||
CheckNoError(t, resp)
|
CheckNoError(t, resp)
|
||||||
|
|
||||||
// Test various invalid channel and scheme id combinations.
|
// Test various invalid channel and scheme id combinations.
|
||||||
|
|||||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Ссылка в новой задаче
Block a user