mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-24 00:29:49 +00:00
refactor: e2e test cases
This commit is contained in:
@@ -84,6 +84,18 @@ describe('Sale Invoices (e2e)', () => {
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/sale-invoices (GET)', async () => {
|
||||
await request(app.getHttpServer())
|
||||
.post('/sale-invoices')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestSaleInvoiceBody());
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.get('/sale-invoices')
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/sale-invoices/:id (GET)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/sale-invoices')
|
||||
@@ -172,4 +184,34 @@ describe('Sale Invoices (e2e)', () => {
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/sale-invoices/:id/mail-state (GET)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/sale-invoices')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestSaleInvoiceBody());
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.get(`/sale-invoices/${response.body.id}/mail-state`)
|
||||
.set('organization-id', orgainzationId)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/sale-invoices/:id/mail (POST)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/sale-invoices')
|
||||
.set('organization-id', orgainzationId)
|
||||
.send(requestSaleInvoiceBody());
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put(`/sale-invoices/${response.body.id}/mail`)
|
||||
.set('organization-id', orgainzationId)
|
||||
.send({
|
||||
subject: 'Email subject from here',
|
||||
to: 'a.bouhuolia@gmail.com',
|
||||
body: 'asfdasdf',
|
||||
attachInvoice: false,
|
||||
})
|
||||
.expect(200);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user