From db2966b7cb3111ff1b3cadfbec1221343b0e8629 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 15 Feb 2017 18:54:24 -0500 Subject: Remove MakeDirectChannelVisible and add client handling for showing DMs (#5430) --- api/post_test.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'api/post_test.go') diff --git a/api/post_test.go b/api/post_test.go index 260a4eb2c..ddcce2e59 100644 --- a/api/post_test.go +++ b/api/post_test.go @@ -1058,42 +1058,6 @@ func TestFuzzyPosts(t *testing.T) { } } -func TestMakeDirectChannelVisible(t *testing.T) { - th := Setup().InitBasic() - Client := th.BasicClient - team := th.BasicTeam - user1 := th.BasicUser - user2 := th.BasicUser2 - - th.LoginBasic2() - - preferences := &model.Preferences{ - { - UserId: user2.Id, - Category: model.PREFERENCE_CATEGORY_DIRECT_CHANNEL_SHOW, - Name: user1.Id, - Value: "false", - }, - } - Client.Must(Client.SetPreferences(preferences)) - - Client.Must(Client.Logout()) - th.LoginBasic() - th.BasicClient.SetTeamId(team.Id) - - channel := Client.Must(Client.CreateDirectChannel(user2.Id)).Data.(*model.Channel) - - if err := app.MakeDirectChannelVisible(channel.Id); err != nil { - t.Fatal(err) - } - - if result, err := Client.GetPreference(model.PREFERENCE_CATEGORY_DIRECT_CHANNEL_SHOW, user2.Id); err != nil { - t.Fatal("Errored trying to set direct channel to be visible for user1") - } else if pref := result.Data.(*model.Preference); pref.Value != "true" { - t.Fatal("Failed to set direct channel to be visible for user1") - } -} - func TestGetFlaggedPosts(t *testing.T) { th := Setup().InitBasic() Client := th.BasicClient -- cgit v1.2.3-1-g7c22