Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanjakl committed May 10, 2024
1 parent fc8c190 commit d71213a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ describe('Apostrophe - Stripe Products Integration Tests', function () {
assert(page.match(/logged in/));
});

it('should connect to Stripe API', async function() {
const Stripe = require('stripe');
const stripe = new Stripe('sk_test_xyz', {
host: 'localhost',
protocol: 'http',
port: 12111
});

try {
const paymentMethods = await stripe.paymentMethods.list({ limit: 1 });
assert.strictEqual(paymentMethods.data.length > 0, true);
} catch (error) {
console.error('Error connecting to Stripe API:', error);
throw error;
}
});

it('should synchronize products and save them to the database', async function () {
let response;

Expand Down Expand Up @@ -107,8 +124,7 @@ describe('Apostrophe - Stripe Products Integration Tests', function () {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
},
jar
}
});
} catch (error) {
console.error('An error occurred:', error);
Expand Down

0 comments on commit d71213a

Please sign in to comment.