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

@@ -90,6 +90,13 @@ describe('Sale Receipts (e2e)', () => {
.expect(200);
});
it('/sale-receipts (GET)', async () => {
return request(app.getHttpServer())
.get('/sale-receipts')
.set('organization-id', orgainzationId)
.expect(200);
});
it('/sale-receipts/:id (GET)', async () => {
const response = await request(app.getHttpServer())
.post('/sale-receipts')
@@ -103,4 +110,16 @@ describe('Sale Receipts (e2e)', () => {
.set('organization-id', orgainzationId)
.expect(200);
});
it('/sale-receipts/:id/mail (GET)', async () => {
const response = await request(app.getHttpServer())
.post('/sale-receipts')
.set('organization-id', orgainzationId)
.send(makeReceiptRequest());
return request(app.getHttpServer())
.get(`/sale-receipts/${response.body.id}/mail`)
.set('organization-id', orgainzationId)
.expect(200);
});
});