feat: add persisted page insight platform

This commit is contained in:
2026-08-21 18:51:00 +08:00
parent 8507b5d017
commit 17e3f1a7d0
18 changed files with 1587 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
package insight
import "testing"
func TestParseModuleRejectsUnscopedValues(t *testing.T) {
for _, value := range []string{"overview", "payments", "fees", "peers", "transactions", "growth"} {
if _, ok := ParseModule(value); !ok {
t.Fatalf("expected %s to be valid", value)
}
}
for _, value := range []string{"", "transaction-detail", "merchant_2", "OVERVIEW"} {
if _, ok := ParseModule(value); ok {
t.Fatalf("expected %s to be invalid", value)
}
}
}
func TestStaleAlwaysCapsConfidence(t *testing.T) {
if got := confidenceFor(FreshnessStale); got != ConfidenceLow {
t.Fatalf("got %s", got)
}
}