PLT-135 Showing "(Edited)" indicator if a message has been edited. (#4923)

This commit is contained in:
Debanshu Kundu
2017-01-12 21:17:29 +05:30
committed by Harrison Healey
parent 99493bc5fa
commit 739f32272f
12 changed files with 102 additions and 16 deletions

View File

@@ -47,6 +47,10 @@ func TestCreatePost(t *testing.T) {
t.Fatal("shouldn't have files")
}
if rpost1.Data.(*model.Post).EditAt != 0 {
t.Fatal("Newly craeted post shouldn't have EditAt set")
}
post2 := &model.Post{ChannelId: channel1.Id, Message: "a" + model.NewId() + "a", RootId: rpost1.Data.(*model.Post).Id}
rpost2, err := Client.CreatePost(post2)
if err != nil {
@@ -326,6 +330,10 @@ func TestUpdatePost(t *testing.T) {
t.Fatal(err)
}
if rpost2.Data.(*model.Post).EditAt != 0 {
t.Fatal("Newly craeted post shouldn't have EditAt set")
}
msg2 := "a" + model.NewId() + " update post 1"
rpost2.Data.(*model.Post).Message = msg2
if rupost2, err := Client.UpdatePost(rpost2.Data.(*model.Post)); err != nil {
@@ -334,6 +342,9 @@ func TestUpdatePost(t *testing.T) {
if rupost2.Data.(*model.Post).Message != msg2 {
t.Fatal("failed to updates")
}
if rupost2.Data.(*model.Post).EditAt == 0 {
t.Fatal("EditAt not updated for post")
}
}
msg1 := "#hashtag a" + model.NewId() + " update post 2"