[MM-18323] Migrate tests from "app/authorization_test.go" to use testify (#12078)
* updated test case to use testify * change test from require to assert * Update app/authorization_test.go Co-Authored-By: Jesús Espino <jespinog@gmail.com>
Этот коммит содержится в:
коммит произвёл
Miguel de la Cruz
родитель
2b18ebe2cf
Коммит
8a27ec5749
@@ -4,6 +4,7 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
@@ -28,10 +29,8 @@ func TestCheckIfRolesGrantPermission(t *testing.T) {
|
||||
{[]string{model.TEAM_ADMIN_ROLE_ID, model.TEAM_USER_ROLE_ID}, model.PERMISSION_MANAGE_SLASH_COMMANDS.Id, true},
|
||||
}
|
||||
|
||||
for testnum, testcase := range cases {
|
||||
if th.App.RolesGrantPermission(testcase.roles, testcase.permissionId) != testcase.shouldGrant {
|
||||
t.Fatal("Failed test case ", testnum)
|
||||
}
|
||||
for _, testcase := range cases {
|
||||
assert.Equal(t, th.App.RolesGrantPermission(testcase.roles, testcase.permissionId), testcase.shouldGrant)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user