fix
This commit is contained in:
@@ -65,12 +65,13 @@ func TestAppendDescriptionFormulaSystemOverride(t *testing.T) {
|
||||
EnhanceUserTemplate: "Name: {{name}}",
|
||||
DescriptionTemplate: desc,
|
||||
})
|
||||
// Structured description_template uses A1 GPT-predloga path (legacy generator.php).
|
||||
if !strings.Contains(user, "GPT predloga:") || !strings.Contains(user, "<H1>{Heading}</H1>") {
|
||||
t.Fatalf("missing A1 description predloga: %s", user)
|
||||
// Structured description_template uses the A1 template path (legacy generator.php).
|
||||
// Fixture instructions are English, so the scaffolding renders in English.
|
||||
if !strings.Contains(user, "Product template:") || !strings.Contains(user, "<H1>{Heading}</H1>") {
|
||||
t.Fatalf("missing description template: %s", user)
|
||||
}
|
||||
if !strings.Contains(sys, "Si tekstopisec") {
|
||||
t.Fatalf("system should be A1 copywriter when formula set: %s", sys)
|
||||
if !strings.Contains(sys, "You are a copywriter") {
|
||||
t.Fatalf("system should be the formula copywriter when formula set: %s", sys)
|
||||
}
|
||||
if AppendDescriptionFormulaSystemOverride("plain", nil) != "plain" {
|
||||
t.Fatal("empty formula must be no-op")
|
||||
@@ -91,14 +92,14 @@ func TestAppendTitleFormulaSystemOverride(t *testing.T) {
|
||||
EnhanceUserTemplate: "Name: {{name}}",
|
||||
TitleTemplate: title,
|
||||
})
|
||||
if !strings.Contains(user, "GPT predloga:") || !strings.Contains(user, "<name>{") {
|
||||
t.Fatalf("missing A1 title predloga: %s", user)
|
||||
if !strings.Contains(user, "Product template:") || !strings.Contains(user, "<name>{") {
|
||||
t.Fatalf("missing title template: %s", user)
|
||||
}
|
||||
if !strings.Contains(user, "brand") {
|
||||
t.Fatalf("missing brand in title formula: %s", user)
|
||||
}
|
||||
if !strings.Contains(sys, "Si tekstopisec") {
|
||||
t.Fatalf("system should be A1 copywriter when title formula set: %s", sys)
|
||||
if !strings.Contains(sys, "You are a copywriter") {
|
||||
t.Fatalf("system should be the formula copywriter when title formula set: %s", sys)
|
||||
}
|
||||
if AppendTitleFormulaSystemOverride("plain", nil) != "plain" {
|
||||
t.Fatal("empty title formula must be no-op")
|
||||
@@ -246,8 +247,8 @@ func TestAppendFormulaConstraints_injectedIntoResolve(t *testing.T) {
|
||||
TitleTemplate: title,
|
||||
DescriptionTemplate: desc,
|
||||
})
|
||||
if !strings.Contains(user, "GPT predloga:") {
|
||||
t.Fatalf("expected A1 GPT predloga: %s", user)
|
||||
if !strings.Contains(user, "Product template:") {
|
||||
t.Fatalf("expected formula template: %s", user)
|
||||
}
|
||||
if !strings.Contains(user, "<name>{") || !strings.Contains(user, "brand") {
|
||||
t.Fatalf("missing title formula in predloga: %s", user)
|
||||
@@ -258,8 +259,8 @@ func TestAppendFormulaConstraints_injectedIntoResolve(t *testing.T) {
|
||||
if !strings.Contains(user, "<metaDescription>{") || !strings.Contains(user, "120-155") {
|
||||
t.Fatalf("missing SEO meta in predloga: %s", user)
|
||||
}
|
||||
if !strings.Contains(sys, "Si tekstopisec") {
|
||||
t.Fatalf("system missing A1 copywriter: %s", sys)
|
||||
if !strings.Contains(sys, "You are a copywriter") {
|
||||
t.Fatalf("system missing formula copywriter: %s", sys)
|
||||
}
|
||||
// Render substitutes {{language}} in formula blocks.
|
||||
_, rendered := RenderProductEnhancePrompts(
|
||||
|
||||
Reference in New Issue
Block a user