PLT-3506 Added flagged posts functionality (#3679)

* Added flagged posts functionality

* UI Improvements to flags (#3697)

* Added flag functionality for mobile

* Updating flagged text (#3699)

* Add back button to RHS thread when coming from flagged posts

* Updating position of flags (#3708)

* Plt 3506 - Reverting flag position (#3724)

* Revert "Updating position of flags (#3708)"

This reverts commit aaa05632c5d9eda35a048300a5bd7e99584c5b58.

* Fixing the icon in search

* Help text and white space improvements (#3730)

* Updatng help text and some white spacing.

* Updating help text
Этот коммит содержится в:
Joram Wilander
2016-08-04 11:38:09 -04:00
коммит произвёл enahum
родитель 9b50b50283
Коммит 0184d6059b
38 изменённых файлов: 1078 добавлений и 104 удалений

Просмотреть файл

@@ -905,3 +905,67 @@ func TestPostCountsByDay(t *testing.T) {
}
}
}
func TestPostStoreGetFlaggedPosts(t *testing.T) {
Setup()
o1 := &model.Post{}
o1.ChannelId = model.NewId()
o1.UserId = model.NewId()
o1.Message = "a" + model.NewId() + "b"
o1 = (<-store.Post().Save(o1)).Data.(*model.Post)
time.Sleep(2 * time.Millisecond)
o2 := &model.Post{}
o2.ChannelId = o1.ChannelId
o2.UserId = model.NewId()
o2.Message = "a" + model.NewId() + "b"
o2 = (<-store.Post().Save(o2)).Data.(*model.Post)
time.Sleep(2 * time.Millisecond)
r1 := (<-store.Post().GetFlaggedPosts(o1.ChannelId, 0, 2)).Data.(*model.PostList)
if len(r1.Order) != 0 {
t.Fatal("should be empty")
}
preferences := model.Preferences{
{
UserId: o1.UserId,
Category: model.PREFERENCE_CATEGORY_FLAGGED_POST,
Name: o1.Id,
Value: "true",
},
}
Must(store.Preference().Save(&preferences))
r2 := (<-store.Post().GetFlaggedPosts(o1.UserId, 0, 2)).Data.(*model.PostList)
if len(r2.Order) != 1 {
t.Fatal("should have 1 post")
}
preferences = model.Preferences{
{
UserId: o1.UserId,
Category: model.PREFERENCE_CATEGORY_FLAGGED_POST,
Name: o2.Id,
Value: "true",
},
}
Must(store.Preference().Save(&preferences))
r3 := (<-store.Post().GetFlaggedPosts(o1.UserId, 0, 1)).Data.(*model.PostList)
if len(r3.Order) != 1 {
t.Fatal("should have 1 post")
}
r4 := (<-store.Post().GetFlaggedPosts(o1.UserId, 0, 2)).Data.(*model.PostList)
if len(r4.Order) != 2 {
t.Fatal("should have 2 posts")
}
}