summaryrefslogtreecommitdiffstats
path: root/store/storetest
diff options
context:
space:
mode:
Diffstat (limited to 'store/storetest')
-rw-r--r--store/storetest/mocks/PostStore.go15
-rw-r--r--store/storetest/post_store.go6
2 files changed, 21 insertions, 0 deletions
diff --git a/store/storetest/mocks/PostStore.go b/store/storetest/mocks/PostStore.go
index c405d5030..bdd0d1d16 100644
--- a/store/storetest/mocks/PostStore.go
+++ b/store/storetest/mocks/PostStore.go
@@ -422,3 +422,18 @@ func (_m *PostStore) Update(newPost *model.Post, oldPost *model.Post) store.Stor
return r0
}
+
+func (_m *PostStore) GetMaxPostSize() store.StoreChannel {
+ ret := _m.Called()
+
+ var r0 store.StoreChannel
+ if rf, ok := ret.Get(0).(func() store.StoreChannel); ok {
+ r0 = rf()
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(store.StoreChannel)
+ }
+ }
+
+ return r0
+}
diff --git a/store/storetest/post_store.go b/store/storetest/post_store.go
index 91fc40213..44ce47d9d 100644
--- a/store/storetest/post_store.go
+++ b/store/storetest/post_store.go
@@ -43,6 +43,7 @@ func TestPostStore(t *testing.T, ss store.Store) {
t.Run("GetPostsBatchForIndexing", func(t *testing.T) { testPostStoreGetPostsBatchForIndexing(t, ss) })
t.Run("PermanentDeleteBatch", func(t *testing.T) { testPostStorePermanentDeleteBatch(t, ss) })
t.Run("GetOldest", func(t *testing.T) { testPostStoreGetOldest(t, ss) })
+ t.Run("TestGetMaxPostSize", func(t *testing.T) { testGetMaxPostSize(t, ss) })
}
func testPostStoreSave(t *testing.T, ss store.Store) {
@@ -1783,3 +1784,8 @@ func testPostStoreGetOldest(t *testing.T, ss store.Store) {
assert.EqualValues(t, o2.Id, r1.Id)
}
+
+func testGetMaxPostSize(t *testing.T, ss store.Store) {
+ assert.Equal(t, model.POST_MESSAGE_MAX_RUNES_V2, (<-ss.Post().GetMaxPostSize()).Data.(int))
+ assert.Equal(t, model.POST_MESSAGE_MAX_RUNES_V2, (<-ss.Post().GetMaxPostSize()).Data.(int))
+}