refactor: e2e test cases

This commit is contained in:
Ahmed Bouhuolia
2025-01-15 17:02:42 +02:00
parent 271c46ea3b
commit 108d286f62
14 changed files with 362 additions and 115 deletions

View File

@@ -129,4 +129,37 @@ describe('Payment Received (e2e)', () => {
.set('organization-id', orgainzationId)
.expect(200);
});
it('/payments-received/:id/mail (POST)', async () => {
const response = await request(app.getHttpServer())
.post('/payments-received')
.set('organization-id', orgainzationId)
.send(requestPaymentReceivedBody(invoice.id));
const paymentReceivedId = response.body.id;
return request(app.getHttpServer())
.post(`/payments-received/${paymentReceivedId}/mail`)
.set('organization-id', orgainzationId)
.send({
subject: 'Email subject from here',
to: 'a.bouhuolia@gmail.com',
body: 'asfdasdf',
})
.expect(200);
});
it('/payments-received/:id/mail (GET)', async () => {
const response = await request(app.getHttpServer())
.post('/payments-received')
.set('organization-id', orgainzationId)
.send(requestPaymentReceivedBody(invoice.id));
const paymentReceivedId = response.body.id;
return request(app.getHttpServer())
.get(`/payments-received/${paymentReceivedId}/mail`)
.set('organization-id', orgainzationId)
.expect(200);
});
});