feat(ECR-012–016): 合规、题库、时辰刷新、头像、MBTI OEJTS 与埋点
落地输入合规、探索题库、报告日/时辰刷新、账号头像、OEJTS 量表,并补齐 H5 埋点与 Admin 漏斗;同步 ESS 工件、切至自建 Git、清理 GitHub Actions。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,21 +1,36 @@
|
||||
package rhythm
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestBuild(t *testing.T) {
|
||||
out := Build(time.Date(1992, 6, 8, 0, 0, 0, 0, time.UTC), "我")
|
||||
if out.Summary["primary_element"] == nil {
|
||||
t.Fatal("missing element")
|
||||
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")
|
||||
}
|
||||
raw, _ := json.Marshal(out)
|
||||
for _, bad := range []string{"运势", "吉凶", "算命", "疗效", "治病"} {
|
||||
if strings.Contains(string(raw), bad) {
|
||||
t.Fatalf("forbidden %q", bad)
|
||||
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"])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user