Tests: Add unit test #3493

This commit is contained in:
graciousgrey 2023-07-14 11:51:28 +02:00
parent 0e93bd8aa2
commit 5fb9e95217

View file

@ -23,8 +23,34 @@ func TestPhotosQueryGeo(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
assert.GreaterOrEqual(t, len(photos0), 13) assert.GreaterOrEqual(t, len(photos0), 13)
for _, r0 := range photos0 {
assert.IsType(t, Photo{}, r0)
assert.NotEqual(t, "zz", r0.CellID)
}
t.Run("geo:false", func(t *testing.T) {
var f form.SearchPhotos
f.Query = "geo:false"
f.Merged = true
photos, _, err := Photos(f)
if err != nil {
t.Fatal(err)
}
assert.LessOrEqual(t, len(photos), 13)
for _, r := range photos {
assert.IsType(t, Photo{}, r)
assert.Equal(t, "zz", r.CellID)
}
})
t.Run("StartsWithPercent", func(t *testing.T) { t.Run("StartsWithPercent", func(t *testing.T) {
var f form.SearchPhotos var f form.SearchPhotos