mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
[MM-61762] Fix errcheck issues in server/channels/app/platform/config_test.go (#29323)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
This commit is contained in:
parent
297aab56a0
commit
82bd3b6df1
2 changed files with 8 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue