mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
refactor: e2e
This commit is contained in:
@@ -16,10 +16,7 @@ const makeExpenseRequest = () => ({
|
||||
description: faker.lorem.sentence(),
|
||||
},
|
||||
],
|
||||
// currencyCode: faker.finance.currencyCode(),
|
||||
// userId: faker.number.int({ min: 1, max: 100 }),
|
||||
// payeeId: faker.number.int({ min: 1, max: 100 }),
|
||||
// branchId: faker.number.int({ min: 1, max: 100 }),
|
||||
branchId: 1,
|
||||
});
|
||||
|
||||
describe('Expenses (e2e)', () => {
|
||||
@@ -31,6 +28,21 @@ describe('Expenses (e2e)', () => {
|
||||
.expect(201);
|
||||
});
|
||||
|
||||
it('/expenses/:id (PUT)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/expenses')
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.send(makeExpenseRequest());
|
||||
|
||||
const expenseId = response.body.id;
|
||||
|
||||
return request(app.getHttpServer())
|
||||
.put(`/expenses/${expenseId}`)
|
||||
.set('organization-id', '4064541lv40nhca')
|
||||
.send(makeExpenseRequest())
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it('/expenses/:id (GET)', async () => {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/expenses')
|
||||
|
||||
Reference in New Issue
Block a user