Files
ai-disclosure-standard/internal/marketing/content_test.go
T
2026-07-20 21:03:05 +02:00

26 lines
1.3 KiB
Go

package marketing
import "testing"
func TestBuildAllLanguages(t *testing.T) {
for _, lang := range []string{"de", "en", "fr", "es", "it", "nl", "pt", "pl"} {
page := Build(lang, "Test Product", "https://example.org", "https://example.org/sales", "https://example.org/about", Prices{})
if page.HeroTitle == "" || page.PricingTitle == "" || page.InstallTitle == "" {
t.Fatalf("%s has incomplete primary copy", lang)
}
if len(page.Features) != 7 || len(page.Comparison) != 10 || len(page.Plans) != 5 || len(page.InstallMethods) != 5 || len(page.Config) != 8 || len(page.FAQs) != 2 {
t.Fatalf("%s has incomplete marketing data: features=%d comparison=%d plans=%d install=%d config=%d faq=%d", lang, len(page.Features), len(page.Comparison), len(page.Plans), len(page.InstallMethods), len(page.Config), len(page.FAQs))
}
if page.Plans[1].Price != "19 €" || page.Plans[4].Period != "" {
t.Fatalf("%s has unexpected default pricing", lang)
}
}
}
func TestBuildPriceOverrides(t *testing.T) {
page := Build("en", "Test", "https://example.org", "https://example.org/sales", "", Prices{Pro: "$29", Publisher: "$99", Agency: "$249"})
if page.Plans[1].Price != "$29" || page.Plans[2].Price != "$99" || page.Plans[3].Price != "$249" {
t.Fatalf("price overrides not applied: %#v", page.Plans)
}
}