preferencestore (#15018)
* Starting migration * Migration finished * Fix i18n * Fix some tests * Fix typos * Remove overwite of http status * Add i18n string * Fix i18n * fix breakages * fix tests Co-authored-by: Rodrigo Villablanca <villa061004@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8f42177870
Коммит
83974d8a8d
@@ -95,13 +95,13 @@ func TestCheckPendingNotifications(t *testing.T) {
|
||||
_, err = th.App.Srv().Store.Channel().UpdateMember(channelMember)
|
||||
require.Nil(t, err)
|
||||
|
||||
err = th.App.Srv().Store.Preference().Save(&model.Preferences{{
|
||||
nErr := th.App.Srv().Store.Preference().Save(&model.Preferences{{
|
||||
UserId: th.BasicUser.Id,
|
||||
Category: model.PREFERENCE_CATEGORY_NOTIFICATIONS,
|
||||
Name: model.PREFERENCE_NAME_EMAIL_INTERVAL,
|
||||
Value: "60",
|
||||
}})
|
||||
require.Nil(t, err)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
// test that notifications aren't sent before interval
|
||||
job.checkPendingNotifications(time.Unix(10001, 0), func(string, []*batchedNotification) {})
|
||||
@@ -117,13 +117,13 @@ func TestCheckPendingNotifications(t *testing.T) {
|
||||
require.Nil(t, err)
|
||||
|
||||
// We reset the interval to something shorter
|
||||
err = th.App.Srv().Store.Preference().Save(&model.Preferences{{
|
||||
nErr = th.App.Srv().Store.Preference().Save(&model.Preferences{{
|
||||
UserId: th.BasicUser.Id,
|
||||
Category: model.PREFERENCE_CATEGORY_NOTIFICATIONS,
|
||||
Name: model.PREFERENCE_NAME_EMAIL_INTERVAL,
|
||||
Value: "10",
|
||||
}})
|
||||
require.Nil(t, err)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
var wasCalled int32
|
||||
job.checkPendingNotifications(time.Unix(10050, 0), func(string, []*batchedNotification) {
|
||||
@@ -253,13 +253,13 @@ func TestCheckPendingNotificationsCantParseInterval(t *testing.T) {
|
||||
require.Nil(t, err)
|
||||
|
||||
// preference value is not an integer, so we'll fall back to the default 15min value
|
||||
err = th.App.Srv().Store.Preference().Save(&model.Preferences{{
|
||||
nErr := th.App.Srv().Store.Preference().Save(&model.Preferences{{
|
||||
UserId: th.BasicUser.Id,
|
||||
Category: model.PREFERENCE_CATEGORY_NOTIFICATIONS,
|
||||
Name: model.PREFERENCE_NAME_EMAIL_INTERVAL,
|
||||
Value: "notAnIntegerValue",
|
||||
}})
|
||||
require.Nil(t, err)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
job.pendingNotifications[th.BasicUser.Id] = []*batchedNotification{
|
||||
{
|
||||
|
||||
Ссылка в новой задаче
Block a user