From 0685afd1d197584e78a111934754d7111bb2dbe8 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Tue, 17 Jan 2017 20:45:18 +0000 Subject: PLT-2978: Add channel purpose change system message. (#5094) Completes original patch by David Lu. --- api/channel_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'api/channel_test.go') diff --git a/api/channel_test.go b/api/channel_test.go index 1bce8b9fd..119578e8b 100644 --- a/api/channel_test.go +++ b/api/channel_test.go @@ -630,6 +630,17 @@ func TestUpdateChannelPurpose(t *testing.T) { upChannel1 = result.Data.(*model.Channel) } + time.Sleep(100 * time.Millisecond) + + r1 := Client.Must(Client.GetPosts(channel1.Id, 0, 1, "")).Data.(*model.PostList) + if len(r1.Order) != 1 { + t.Fatal("Purpose update system message was not found") + } else if val, ok := r1.Posts[r1.Order[0]].Props["old_purpose"]; !ok || val != "" { + t.Fatal("Props should contain old_header with old purpose value") + } else if val, ok := r1.Posts[r1.Order[0]].Props["new_purpose"]; !ok || val != "new purpose" { + t.Fatal("Props should contain new_header with new purpose value") + } + if upChannel1.Purpose != data["channel_purpose"] { t.Fatal("Failed to update purpose") } -- cgit v1.2.3-1-g7c22