Fix MM-42270 (#19692)
* [MM-42270] - Fix MM-42270 * clean test code Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a2fc602bc2
Коммит
f6fef9362b
@@ -208,6 +208,20 @@ func TestGenerateSupportPacket(t *testing.T) {
|
||||
require.NotZero(t, len(file))
|
||||
})
|
||||
|
||||
t.Run("As a System Administrator but with RestrictSystemAdmin true", func(t *testing.T) {
|
||||
originalRestrictSystemAdminVal := *th.App.Config().ExperimentalSettings.RestrictSystemAdmin
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ExperimentalSettings.RestrictSystemAdmin = true })
|
||||
defer func() {
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.ExperimentalSettings.RestrictSystemAdmin = originalRestrictSystemAdminVal
|
||||
})
|
||||
}()
|
||||
|
||||
_, resp, err := th.SystemAdminClient.GenerateSupportPacket()
|
||||
require.Error(t, err)
|
||||
CheckForbiddenStatus(t, resp)
|
||||
})
|
||||
|
||||
t.Run("As a Regular User", func(t *testing.T) {
|
||||
_, resp, err := th.Client.GenerateSupportPacket()
|
||||
require.Error(t, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user