photoprism/internal/form/json_test.go

19 lines
419 B
Go
Raw Permalink Normal View History

2023-06-28 16:12:11 +02:00
package form
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestAsJson(t *testing.T) {
form := &SearchAlbums{Query: "slug:album1 favorite:true", Year: "2020"}
assert.Contains(t, AsJson(form), "{\"Query\":\"slug:album1")
}
func TestAsReader(t *testing.T) {
form := &SearchAlbums{Query: "slug:album1 favorite:true", Year: "2020"}
assert.IsType(t, AsReader(form), &strings.Reader{})
}