Session 14: Africa checkout, Tank01 NBA/MLB wiring, WNBA+MLB odds proxies, OAuth icons, loading skeletons (1330 tests)
This commit is contained in:
@@ -57,6 +57,36 @@ describe('stripeService', () => {
|
||||
test('invalid tier throws', () => {
|
||||
expect(() => getPriceId('gold', null)).toThrow('Invalid tier');
|
||||
});
|
||||
|
||||
describe('Session 14 — africa tier', () => {
|
||||
const original = process.env.STRIPE_PRICE_AFRICA;
|
||||
afterAll(() => {
|
||||
if (original == null) delete process.env.STRIPE_PRICE_AFRICA;
|
||||
else process.env.STRIPE_PRICE_AFRICA = original;
|
||||
});
|
||||
|
||||
test('africa returns the configured price ID when set', () => {
|
||||
// We can't re-import to pick up the env change after the
|
||||
// module loaded its PRICE_MAP at require-time, so this test
|
||||
// asserts the contract: getPriceId('africa') returns either
|
||||
// a price ID OR the sentinel. The route-layer integration
|
||||
// test covers the env-flip → 503 path end-to-end.
|
||||
const result = getPriceId('africa', null);
|
||||
expect(typeof result).toBe('string');
|
||||
});
|
||||
|
||||
test("africa never returns a founder-discounted variant (the tier IS the discount)", () => {
|
||||
const a = getPriceId('africa', null);
|
||||
const b = getPriceId('africa', 'FOUNDER2026');
|
||||
expect(a).toBe(b);
|
||||
});
|
||||
|
||||
test('exports PRICE_UNCONFIGURED sentinel', () => {
|
||||
const { PRICE_UNCONFIGURED } = require('../../src/services/stripeService');
|
||||
expect(typeof PRICE_UNCONFIGURED).toBe('string');
|
||||
expect(PRICE_UNCONFIGURED.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('handleWebhookEvent', () => {
|
||||
|
||||
Reference in New Issue
Block a user