feat: add admin panel
This commit is contained in:
@@ -23,6 +23,9 @@ func setup(t *testing.T) (*Service, int64) {
|
||||
}
|
||||
id, _ := res.LastInsertId()
|
||||
svc := New(st.DB, DevAdVerifier{}, DevIAPVerifier{})
|
||||
if err := svc.LoadCatalog(context.Background()); err != nil {
|
||||
t.Fatalf("load catalog: %v", err)
|
||||
}
|
||||
return svc, id
|
||||
}
|
||||
|
||||
@@ -156,7 +159,7 @@ func TestPurchaseCreditsAndIdempotent(t *testing.T) {
|
||||
if err := svc.VerifyPurchase(ctx, id, req); err != nil {
|
||||
t.Fatalf("purchase: %v", err)
|
||||
}
|
||||
pkg := findCoinPackage("small")
|
||||
pkg := svc.findCoinPackage("small")
|
||||
if c := coinsOf(t, svc, id); c != pkg.Coins {
|
||||
t.Fatalf("want %d coins, got %d", pkg.Coins, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user