feat: add persisted page insight platform
This commit is contained in:
22
internal/insight/model_test.go
Normal file
22
internal/insight/model_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user