photoprism/internal/form/album_test.go
Michael Mayer 10d5f433aa Albums/Folders: Add category, country, year & month columns #154
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-26 09:02:19 +02:00

39 lines
855 B
Go

package form
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestNewAlbum(t *testing.T) {
t.Run("success", func(t *testing.T) {
var album = struct {
AlbumTitle string
AlbumDescription string
AlbumNotes string
AlbumOrder string
AlbumTemplate string
AlbumFavorite bool
}{
AlbumTitle: "Foo",
AlbumDescription: "bar",
AlbumNotes: "test notes",
AlbumOrder: "newest",
AlbumTemplate: "default",
AlbumFavorite: true,
}
r, err := NewAlbum(album)
if err != nil {
t.Fatal(err)
}
assert.Equal(t, "Foo", r.AlbumTitle)
assert.Equal(t, "bar", r.AlbumDescription)
assert.Equal(t, "test notes", r.AlbumNotes)
assert.Equal(t, "newest", r.AlbumOrder)
assert.Equal(t, "default", r.AlbumTemplate)
assert.Equal(t, true, r.AlbumFavorite)
})
}