mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
27 lines
521 B
Go
27 lines
521 B
Go
package dashboards
|
|
|
|
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())
|
|
})
|
|
}
|
|
}
|