落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。 Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package scale
|
|
|
|
import "testing"
|
|
|
|
func TestScoreMajority_communication(t *testing.T) {
|
|
key, label := ScoreMajority(map[string]string{
|
|
"q1": "B", "q2": "B", "q3": "A",
|
|
}, CommunicationLabels(), "平衡探索型")
|
|
if key != "B" || label != "感受连接型" {
|
|
t.Fatalf("got %s %s", key, label)
|
|
}
|
|
}
|
|
|
|
func TestScoreMajority_emotion(t *testing.T) {
|
|
key, label := ScoreMajority(map[string]string{
|
|
"q1": "C", "q2": "C", "q3": "C",
|
|
}, EmotionLabels(), "平衡探索型")
|
|
if key != "C" || label != "行动调节型" {
|
|
t.Fatalf("got %s %s", key, label)
|
|
}
|
|
}
|
|
|
|
func TestScoreMajority_empty(t *testing.T) {
|
|
_, label := ScoreMajority(nil, CommunicationLabels(), "平衡探索型")
|
|
if label != "平衡探索型" {
|
|
t.Fatalf("got %s", label)
|
|
}
|
|
}
|
|
|
|
func TestBuildResult_rich(t *testing.T) {
|
|
r := BuildResult("communication-style", "B", "感受连接型")
|
|
if r["overview"] == nil || r["tips"] == nil || r["scripts"] == nil {
|
|
t.Fatalf("missing rich fields: %#v", r)
|
|
}
|
|
r2 := BuildResult("emotion-pattern", "A", "觉察表达型")
|
|
if r2["growth_plan"] == nil || r2["faq"] == nil {
|
|
t.Fatalf("missing emotion rich fields")
|
|
}
|
|
}
|