落地输入合规、探索题库、报告日/时辰刷新、账号头像、OEJTS 量表,并补齐 H5 埋点与 Admin 漏斗;同步 ESS 工件、切至自建 Git、清理 GitHub Actions。 Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
864 B
Go
35 lines
864 B
Go
package scalebank
|
|
|
|
import "testing"
|
|
|
|
func TestCatalogCuratedASet(t *testing.T) {
|
|
out, err := Catalog()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(out.Categories) != 4 {
|
|
t.Fatalf("cats=%d", len(out.Categories))
|
|
}
|
|
if len(out.Featured) < 6 {
|
|
t.Fatalf("featured=%d", len(out.Featured))
|
|
}
|
|
seen := map[string]bool{}
|
|
for _, f := range out.Featured {
|
|
if f.Icon == "" || seen[f.Icon] {
|
|
t.Fatalf("featured icons must be unique nonempty: %#v", out.Featured)
|
|
}
|
|
seen[f.Icon] = true
|
|
}
|
|
if !Has("mbti") || !Has("gd3") || Has("yyzcs") {
|
|
t.Fatal("unexpected slug set")
|
|
}
|
|
s, err := Get("eq1")
|
|
if err != nil || len(s.Questions) == 0 {
|
|
t.Fatalf("eq1 %#v %v", s, err)
|
|
}
|
|
key, label, sum, ceil := ScoreSum(map[string]string{"a": "3", "b": "4"}, 2)
|
|
if key == "" || label == "" || sum == 0 || ceil == 0 {
|
|
t.Fatalf("%s %s %d %d", key, label, sum, ceil)
|
|
}
|
|
}
|