photoprism/internal/entity/auth_session_data_test.go
Michael Mayer f5a8c5a45d Auth: Session and ACL enhancements #98 #1746
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-28 09:01:17 +02:00

23 lines
511 B
Go

package entity
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUIDs_String(t *testing.T) {
uid := UIDs{"dghjkfd", "dfgehrih"}
assert.Equal(t, "dghjkfd,dfgehrih", uid.String())
}
func TestUIDs_Join(t *testing.T) {
uid := UIDs{"dghjkfd", "dfgehrih"}
assert.Equal(t, "dghjkfd|dfgehrih", uid.Join("|"))
}
func TestData_HasShare(t *testing.T) {
data := SessionData{Shares: []string{"abc123", "def444"}}
assert.True(t, data.HasShare("def444"))
assert.False(t, data.HasShare("xxx"))
}