2026-06-10 08:18:35 -04:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"reflect"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestMetadataContentLevelsForLibraryTypeIncludesEbooks(t *testing.T) {
|
|
|
|
|
cases := []struct {
|
|
|
|
|
name string
|
|
|
|
|
libraryType string
|
|
|
|
|
want []string
|
|
|
|
|
}{
|
|
|
|
|
{name: "plural ebooks", libraryType: "ebooks", want: []string{"ebook"}},
|
|
|
|
|
{name: "singular ebook", libraryType: "ebook", want: []string{"ebook"}},
|
|
|
|
|
{name: "mixed includes ebook", libraryType: "mixed", want: []string{"movie", "series", "season", "episode", "audiobook", "ebook"}},
|
2026-06-16 20:13:10 -04:00
|
|
|
{name: "manga", libraryType: "manga", want: []string{"manga"}},
|
2026-06-10 08:18:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, tc := range cases {
|
|
|
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
|
|
|
if got := metadataContentLevelsForLibraryType(tc.libraryType); !reflect.DeepEqual(got, tc.want) {
|
|
|
|
|
t.Fatalf("metadataContentLevelsForLibraryType(%q) = %#v, want %#v", tc.libraryType, got, tc.want)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|