update
This commit is contained in:
@@ -2,6 +2,7 @@ package processing
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -76,7 +77,7 @@ func TestProjectV1ProcessJobItemsPartial(t *testing.T) {
|
||||
"raw_product_id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
|
||||
"status": "processed",
|
||||
"title": "T", "meta_title": "MT",
|
||||
"description": []string{"D"}, "attributes": map[string]any{"brand": "X"},
|
||||
"description": "D", "attributes": map[string]any{"brand": "X"},
|
||||
"main_image": "https://example.com/a.jpg", "more_images": []string{"https://example.com/b.jpg"},
|
||||
"eprel": nil, "category": "cat", "category_name": "Cat",
|
||||
}}
|
||||
@@ -107,6 +108,16 @@ func TestProjectV1ProcessJobItemsPartial(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestV1PlainDescriptionStandalone(t *testing.T) {
|
||||
got := v1PlainDescription("Line1<br>Line2 & ok")
|
||||
if strings.Contains(got, "<") {
|
||||
t.Fatalf("html left: %q", got)
|
||||
}
|
||||
if !strings.Contains(got, "Line1") || !strings.Contains(got, "Line2") || !strings.Contains(got, "& ok") {
|
||||
t.Fatalf("got=%q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyV1ProcessItemIDsDualMode(t *testing.T) {
|
||||
processed := mustParseTestUUID(t, "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb")
|
||||
raw := mustParseTestUUID(t, "cccccccc-cccc-cccc-cccc-cccccccccccc")
|
||||
|
||||
Reference in New Issue
Block a user