Files
digital-psychology/apps/api/internal/rhythm/engine_test.go
T
jackyu66gitandCursor 89756f65b4 feat(ECR-012–016): 合规、题库、时辰刷新、头像、MBTI OEJTS 与埋点
落地输入合规、探索题库、报告日/时辰刷新、账号头像、OEJTS 量表,并补齐 H5 埋点与 Admin 漏斗;同步 ESS 工件、切至自建 Git、清理 GitHub Actions。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 01:27:58 +08:00

37 lines
1002 B
Go

package rhythm
import (
"strings"
"testing"
"time"
)
func TestBuildIncludesWuxingBars(t *testing.T) {
birth := time.Date(1992, 6, 8, 0, 0, 0, 0, time.UTC)
out := BuildWith(birth, "测", time.Date(2026, 8, 12, 12, 0, 0, 0, time.FixedZone("CST", 8*3600)))
wx, ok := out.Summary["wuxing"].(map[string]any)
if !ok {
t.Fatal("missing wuxing")
}
bars, ok := wx["bars"].([]map[string]any)
if !ok || len(bars) != 5 {
t.Fatalf("bars=%#v", wx["bars"])
}
if wx["strong_el"] == nil || wx["care_dir"] == nil {
t.Fatalf("incomplete wuxing: %#v", wx)
}
prev, ok := out.Summary["blind_spots_preview"].([]string)
if !ok || len(prev) == 0 {
t.Fatalf("blind_spots_preview=%#v", out.Summary["blind_spots_preview"])
}
for _, s := range prev {
if strings.Contains(s, "深度版") {
t.Fatalf("preview should not be upsell: %q", s)
}
}
st, ok := out.Summary["solar_term"].(map[string]any)
if !ok || st["name"] == nil {
t.Fatalf("missing solar_term: %#v", out.Summary["solar_term"])
}
}