mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 10:26:03 +00:00
33 lines
610 B
Go
33 lines
610 B
Go
package query
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// TODO test non empty case
|
|
func TestErrors(t *testing.T) {
|
|
t.Run("NotExisting", func(t *testing.T) {
|
|
errors, err := Errors(1000, 0, "notexistingErrorString")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
assert.Empty(t, errors)
|
|
})
|
|
t.Run("Error", func(t *testing.T) {
|
|
errors, err := Errors(1000, 0, "errors")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
assert.Empty(t, errors)
|
|
})
|
|
t.Run("Warning", func(t *testing.T) {
|
|
errors, err := Errors(1000, 0, "warnings")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
assert.Empty(t, errors)
|
|
})
|
|
|
|
}
|