Files
commerce/embed_ceiling_test.go
zooqueenandHanzo Dev 9705d8bc03 A deployment caps every org at test with organization.Ceiling
EmbedConfig.Ceiling is declared by the host as Born is: Test where the
network holds no real money, "" or Live for no cap, and any other value
caps at Test. Under a Test ceiling TestMode is true for every org, a
record marked Live included, so it charges sandbox credentials, writes
the test books and publishes the sandbox application.

TestMode is the one reading of the mode: the ledger, balance, transaction,
library, account and Authorize.Net paths, StripeToken and PayPal read it
instead of org.Live, so the ceiling holds on each of them.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-16 07:27:25 -07:00

24 lines
614 B
Go

package commerce
import (
"testing"
"github.com/hanzoai/commerce/models/organization"
)
// A host's declaration maps to a cap: none for "" and Live, Test for Test and
// for anything unrecognised.
func TestCeilingOf(t *testing.T) {
for in, want := range map[organization.Kind]organization.Kind{
"": organization.Live,
organization.Live: organization.Live,
organization.Test: organization.Test,
"production": organization.Test,
"sandbox": organization.Test,
} {
if got := ceilingOf(in); got != want {
t.Errorf("ceilingOf(%q) = %q, want %q", in, got, want)
}
}
}