package savedrecipe_test import ( "testing" "github.com/food-ai/backend/internal/domain/savedrecipe" ) func TestMapCuisineSlug_KnownCuisines(t *testing.T) { tests := []struct { input string want string }{ {"italian", "italian"}, {"french", "french"}, {"russian", "russian"}, {"chinese", "chinese"}, {"japanese", "japanese"}, {"korean", "korean"}, {"mexican", "mexican"}, {"mediterranean", "mediterranean"}, {"indian", "indian"}, {"thai", "thai"}, {"american", "american"}, {"georgian", "georgian"}, {"spanish", "spanish"}, {"german", "german"}, {"middle_eastern", "middle_eastern"}, {"turkish", "turkish"}, {"greek", "greek"}, {"vietnamese", "vietnamese"}, } for _, tc := range tests { result := savedrecipe.MapCuisineSlug(tc.input) if result != tc.want { t.Errorf("MapCuisineSlug(%q) = %q, want %q", tc.input, result, tc.want) } } } func TestMapCuisineSlug_GenericFallsToOther(t *testing.T) { for _, input := range []string{"asian", "european"} { result := savedrecipe.MapCuisineSlug(input) if result != "other" { t.Errorf("MapCuisineSlug(%q) = %q, want %q", input, result, "other") } } } func TestMapCuisineSlug_Unknown(t *testing.T) { result := savedrecipe.MapCuisineSlug("peruvian") if result != "other" { t.Errorf("MapCuisineSlug(peruvian) = %q, want %q", result, "other") } } func TestMapCuisineSlug_Empty(t *testing.T) { result := savedrecipe.MapCuisineSlug("") if result != "other" { t.Errorf("MapCuisineSlug() = %q, want %q", result, "other") } } func TestMapCuisineSlug_CaseSensitive(t *testing.T) { // The function does NOT lowercase — "ITALIAN" is unknown and falls back to "other". result := savedrecipe.MapCuisineSlug("ITALIAN") if result != "other" { t.Errorf("MapCuisineSlug(ITALIAN) = %q, want %q", result, "other") } }