photoprism/internal/session/data_test.go
2020-12-31 12:34:06 +01:00

23 lines
505 B
Go

package session
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 := Data{Shares: []string{"abc123", "def444"}}
assert.True(t, data.HasShare("def444"))
assert.False(t, data.HasShare("xxx"))
}