2021-08-13 20:31:41 +02:00
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-08-13 20:50:49 +02:00
|
|
|
"github.com/photoprism/photoprism/internal/entity"
|
|
|
|
|
2021-08-13 20:31:41 +02:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2021-08-16 00:29:36 +02:00
|
|
|
func TestSubjects(t *testing.T) {
|
|
|
|
results, err := Subjects(3, 0)
|
2021-08-13 20:31:41 +02:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2021-08-14 18:13:03 +02:00
|
|
|
assert.GreaterOrEqual(t, len(results), 1)
|
2021-08-13 20:31:41 +02:00
|
|
|
|
|
|
|
for _, val := range results {
|
2021-08-16 00:29:36 +02:00
|
|
|
assert.IsType(t, entity.Subject{}, val)
|
2021-08-13 20:31:41 +02:00
|
|
|
}
|
|
|
|
}
|