Test: Add test for query/moments_time.go
This commit is contained in:
parent
fbd5fbdf82
commit
204646babd
1 changed files with 22 additions and 0 deletions
22
internal/query/moments_time_test.go
Normal file
22
internal/query/moments_time_test.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package query
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/config"
|
||||
)
|
||||
|
||||
func TestRepo_GetMomentsTime(t *testing.T) {
|
||||
conf := config.TestConfig()
|
||||
|
||||
search := New(conf.OriginalsPath(), conf.Db())
|
||||
|
||||
t.Run("result found", func(t *testing.T) {
|
||||
result, err := search.GetMomentsTime()
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 2790, result[0].PhotoYear)
|
||||
assert.Equal(t, 2, result[0].Count)
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue