feat(listing): 增加赔付方案说明配置
This commit is contained in:
@@ -150,6 +150,20 @@ func TestNormalizePublishOptionsValueDefaultsDepositTooltip(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizePublishOptionsValueDefaultsCompensationNote(t *testing.T) {
|
||||
normalized, err := normalizePublishOptionsValue(`{"schema_version":2}`)
|
||||
if err != nil {
|
||||
t.Fatalf("规范化失败: %v", err)
|
||||
}
|
||||
var options PublishOptionsDTO
|
||||
if err := json.Unmarshal([]byte(normalized), &options); err != nil {
|
||||
t.Fatalf("解析规范化结果失败: %v", err)
|
||||
}
|
||||
if !strings.Contains(options.PriceConfig.CompensationNote, "普通赔付方案如下") {
|
||||
t.Fatalf("赔付方案说明默认文案缺失: %q", options.PriceConfig.CompensationNote)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizePublishOptionsValuePreservesExplicitZeroPremiumReviewRatioMarkup(t *testing.T) {
|
||||
options := DefaultPublishOptions()
|
||||
options.RatioConfig.PremiumReviewRatioMarkup = 0
|
||||
|
||||
Reference in New Issue
Block a user