From 204646babd3f7476a78c4a7879d3ff73827b4799 Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Tue, 28 Jan 2020 21:02:52 +0100 Subject: [PATCH] Test: Add test for query/moments_time.go --- internal/query/moments_time_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 internal/query/moments_time_test.go diff --git a/internal/query/moments_time_test.go b/internal/query/moments_time_test.go new file mode 100644 index 000000000..65c5733f6 --- /dev/null +++ b/internal/query/moments_time_test.go @@ -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) + }) +}