mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
27 lines
517 B
Go
27 lines
517 B
Go
package models
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPermissionType_String(t *testing.T) {
|
|
testCases := []struct {
|
|
permissionType PermissionType
|
|
expected string
|
|
}{
|
|
{PERMISSION_ADMIN, "Admin"},
|
|
{PERMISSION_EDIT, "Edit"},
|
|
{PERMISSION_VIEW, "View"},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
t.Run(tc.expected, func(t *testing.T) {
|
|
assert.Equal(t, tc.expected, fmt.Sprint(tc.permissionType))
|
|
assert.Equal(t, tc.expected, tc.permissionType.String())
|
|
})
|
|
}
|
|
}
|