From fa166f13bf60e745d2e4bcc504fc9d194dd87146 Mon Sep 17 00:00:00 2001 From: Ogundele Olumide Date: Fri, 4 Oct 2019 15:43:29 +0100 Subject: [PATCH] chore: migrate test to testify (#12507) - replace calls to t.fatal with require assertion of testify toolkit --- cmd/mattermost/commands/channel_test.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/cmd/mattermost/commands/channel_test.go b/cmd/mattermost/commands/channel_test.go index ada50baf7a..e6109a7d7a 100644 --- a/cmd/mattermost/commands/channel_test.go +++ b/cmd/mattermost/commands/channel_test.go @@ -86,25 +86,17 @@ func TestListChannels(t *testing.T) { output := th.CheckCommand(t, "channel", "list", th.BasicTeam.Name) - if !strings.Contains(string(output), "town-square") { - t.Fatal("should have channels") - } + require.True(t, strings.Contains(string(output), "town-square"), "should have channels") - if !strings.Contains(string(output), channel.Name+" (archived)") { - t.Fatal("should have archived channel") - } + require.True(t, strings.Contains(string(output), channel.Name+" (archived)"), "should have archived channel") - if !strings.Contains(string(output), privateChannel.Name+" (private)") { - t.Fatal("should have private channel") - } + require.True(t, strings.Contains(string(output), privateChannel.Name+" (private)"), "should have private channel") th.Client.Must(th.Client.DeleteChannel(privateChannel.Id)) output = th.CheckCommand(t, "channel", "list", th.BasicTeam.Name) - if !strings.Contains(string(output), privateChannel.Name+" (archived) (private)") { - t.Fatal("should have a channel both archived and private") - } + require.True(t, strings.Contains(string(output), privateChannel.Name+" (archived) (private)"), "should have a channel both archived and private") } func TestRestoreChannel(t *testing.T) {