mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Migrate tests from app/command_test.go to use testify (#12659)
* Migrate tests from app/command_test.go to use testify * minor fix * minor fix * minor fix
This commit is contained in:
committed by
Miguel de la Cruz
parent
78c2780bc7
commit
cf6496bb8f
@@ -119,13 +119,11 @@ func TestCreateCommand(t *testing.T) {
|
||||
require.Nil(t, response.Error, "Failed to list commands")
|
||||
|
||||
if testCase.ExpectedErr == "" {
|
||||
require.NotEmpty(t, cmds, "Failed to create command")
|
||||
require.Equal(t, "testcmd", cmds[0].Trigger)
|
||||
assert.NotZero(t, len(cmds), "Failed to create command")
|
||||
assert.Equal(t, cmds[0].Trigger, "testcmd", "Failed to create command")
|
||||
assert.Contains(t, string(actual), "PASS")
|
||||
} else {
|
||||
if len(cmds) > 1 {
|
||||
require.Fail(t, "Created command that shouldn't have been created")
|
||||
}
|
||||
assert.LessOrEqual(t, len(cmds), 1, "Created command that shouldn't have been created")
|
||||
assert.Contains(t, string(actual), testCase.ExpectedErr)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user