This commit is contained in:
greeneclipse committed 2026-10-14 20:02:42 +02:00
1 parent 3b0d692839
commit 8b540d22bc
14 files changed
+526 -82

No files matched your search

@@ -150,3 +150,19 @@ func TestRunSteps_defaultFormulaDrivesGeneration(t *testing.T) {
}
_ = company.DefaultLanguage
}
// Without a stored category prompt, fallback content must still use the target
// product's language, not default to old English HTML instructions.
func TestWithDefaultCategoryFormula_localizedFallback(t *testing.T) {
for _, lang := range []string{"en", "hr", "sl", "de", "ja"} {
input := ProductInput{CategoryUniqueID: "grohe", CategoryDisplayName: "Bathroom faucets", Language: lang}
got := withDefaultCategoryFormula(input)
expected, err := aiprompts.OfflineDefaultPrompt(lang)
if err != nil {
t.Fatal(err)
}
if got.CategoryEnhancePrompt != expected {
t.Fatalf("%s fallback uses wrong language", lang)
}
}
}