[MM-61762] Fix errcheck issues in server/channels/app/platform/config_test.go (#29323)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
@@ -101,7 +101,6 @@ issues:
|
||||
channels/app/permissions.go|\
|
||||
channels/app/permissions_test.go|\
|
||||
channels/app/platform/cluster_handlers.go|\
|
||||
channels/app/platform/config_test.go|\
|
||||
channels/app/platform/helper_test.go|\
|
||||
channels/app/platform/license.go|\
|
||||
channels/app/platform/link_cache.go|\
|
||||
|
||||
@@ -88,16 +88,19 @@ func TestConfigSave(t *testing.T) {
|
||||
// Change a random config setting
|
||||
cfg := th.Service.Config().Clone()
|
||||
cfg.ThemeSettings.EnableThemeSelection = model.NewPointer(!*cfg.ThemeSettings.EnableThemeSelection)
|
||||
th.Service.SaveConfig(cfg, false)
|
||||
_, _, appErr := th.Service.SaveConfig(cfg, false)
|
||||
require.Nil(t, appErr)
|
||||
metricsMock.AssertNumberOfCalls(t, "Register", 0)
|
||||
|
||||
// Disable metrics
|
||||
cfg.MetricsSettings.Enable = model.NewPointer(false)
|
||||
th.Service.SaveConfig(cfg, false)
|
||||
_, _, appErr = th.Service.SaveConfig(cfg, false)
|
||||
require.Nil(t, appErr)
|
||||
|
||||
// Change the metrics setting
|
||||
cfg.MetricsSettings.Enable = model.NewPointer(true)
|
||||
th.Service.SaveConfig(cfg, false)
|
||||
_, _, appErr = th.Service.SaveConfig(cfg, false)
|
||||
require.Nil(t, appErr)
|
||||
metricsMock.AssertNumberOfCalls(t, "Register", 1)
|
||||
})
|
||||
}
|
||||
@@ -126,7 +129,8 @@ func TestIsFirstUserAccount(t *testing.T) {
|
||||
}
|
||||
|
||||
// create a session, this should not affect IsFirstUserAccount
|
||||
th.Service.sessionCache.SetWithDefaultExpiry("mock_session", 1)
|
||||
err := th.Service.sessionCache.SetWithDefaultExpiry("mock_session", 1)
|
||||
require.NoError(t, err)
|
||||
|
||||
for _, te := range tests {
|
||||
t.Run(te.name, func(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user