photoprism/internal/acl/permission_test.go
Michael Mayer 0e93bd8aa2 Auth: Ensure clipboard is cleared on logout and privilege change #3512
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-07-14 09:14:57 +02:00

22 lines
532 B
Go

package acl
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPermissions_String(t *testing.T) {
t.Run("Empty", func(t *testing.T) {
perms := Permissions{}
assert.Equal(t, "", perms.String())
})
t.Run("FullAccess", func(t *testing.T) {
perms := Permissions{FullAccess}
assert.Equal(t, "full access", perms.String())
})
t.Run("ManageUploadAll", func(t *testing.T) {
perms := Permissions{ActionManage, ActionUpload, AccessAll}
assert.Equal(t, "manage, upload, access all", perms.String())
})
}