describe('gae_flex_node_static_files', () => { it('should be listening', async () => { await supertest(app).get('/').expect(200); }); });
supertest('https://192.168.99.100:8080') .post('/notification/sendEmail') .send({payload}) .end((err, res) => { if (err) { reject(new Error('An error occured with the payment service, err: ' + err)) } resolve(res.body) })
it('should be listening', async () => { await supertest(app).get('/').expect(200); });
describe('Booking Service', () => { const api = supertest('http://192.168.99.100:3002') const now = new Date() now.setDate(now.getDate() + 1)
supertest('https://192.168.99.100:8080') .post('/payment/makePurchase') .send({paymentOrder}) .end((err, res) => { if (err) { reject(new Error('An error occured with the payment service, err: ' + err)) } resolve(res.body.paid) })
step('check address 1 balance', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .get(`/operator/${context.address1}/balance`) .expect(200) .expect((res) => { assert.equal(res.body.balance, 7999999999, `Expected balance of address '${context.address1}' to be '7999999999'`); }); }); });
step('create address 1', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .post(`/operator/wallets/${context.walletId}/addresses`) .set({ password: walletPassword }) .expect(201); }).then((res) => { context.address1 = res.body.address; }); });
it('should not get the wallet', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .get('/operator/wallets/a') .expect(404); }); });
it('should not create a wallet address with a wrong password', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .post(`/operator/wallets/${context.walletId}/addresses`) .set({ password: 'wrong one' }) .expect(403); }); });
it('should be listening', async () => { await supertest(app).get('/').expect(200); });
it('should be listening', async () => { await supertest(app).get('/').expect(200); });
it('should not get the addresses of a inexistent wallet', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .get('/operator/wallets/a/addresses') .expect(400); }); });
it('should not get the address balance because no transactions were found', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .get('/operator/A/balance') .expect(404); }); });
step('check address 1 balance', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .get(`/operator/${context.address1}/balance`) .expect(200) .expect((res) => { assert.equal(res.body.balance, 9000000000, `Expected balance of address '${context.address1}' to be '9000000000'`); }); }); });
it('should not get the block by hash', () => { return Promise.resolve() .then(() => { return supertest(context.httpServer1.app) .get('/blockchain/blocks/1111111111111111111111111111111111111111111111111111111111111111') .expect(404); }); });