declastruct-stripe-sdk
Version:
declarative control of stripe constructs, via declastruct
26 lines • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const test_fns_1 = require("test-fns");
const getStripeCredentials_1 = require("../../../__test_assets__/getStripeCredentials");
const DeclaredStripeDiscountCoupon_1 = require("../../../domain/objects/DeclaredStripeDiscountCoupon");
const getStripe_1 = require("../../auth/getStripe");
const setCoupon_1 = require("./setCoupon");
const log = console;
describe('setCoupon', () => {
(0, test_fns_1.given)('a coupon to insert', () => {
(0, test_fns_1.when)('we try to insert it', () => {
(0, test_fns_1.then)('it should succeed', async () => {
const coupon = await (0, setCoupon_1.setCoupon)({
insert: new DeclaredStripeDiscountCoupon_1.DeclaredStripeDiscountCoupon({
percentOff: 100,
duration: 'once',
name: 'Customer was unresponsive',
amountOff: null,
metadata: null,
}),
}, { stripe: await (0, getStripe_1.getStripe)((0, getStripeCredentials_1.getStripeCredentials)()), log });
});
});
});
});
//# sourceMappingURL=setCoupon.integration.test.js.map