Skip to content

Commit

Permalink
Add tests for the new resource
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Apr 22, 2020
1 parent a3c3730 commit e5ac920
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/resources/BillingPortal/Sessions.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

const stripe = require('../../../testUtils').getSpyableStripe();

const expect = require('chai').expect;

describe('BillingPortal', () => {
describe('Sessions Resource', () => {
describe('create', () => {
it('Sends the correct request', () => {
const params = {
customer: 'cus_123',
return_url: 'https://stripe.com/return',
};
stripe.billingPortal.sessions.create(params);

expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'POST',
url: '/v1/billing_portal/sessions',
headers: {},
data: params,
settings: {},
});
});
});
});
});

0 comments on commit e5ac920

Please sign in to comment.