feat: Manual journals.

This commit is contained in:
Ahmed Bouhuolia
2020-04-05 19:20:47 +02:00
parent b2d1a09612
commit 2d904601fa
6 changed files with 127 additions and 5 deletions

View File

@@ -245,6 +245,36 @@ describe('routes: `/accounting`', () => {
});
});
describe.only('route: `accounting/manual-journals`', async () => {
it('Should retrieve manual journals resource not found.', async () => {
const res = await request()
.get('/api/accounting/manual-journals')
.set('x-access-token', loginRes.body.token)
.send();
expect(res.status).equal(400);
expect(res.body.errors[0].type).equals('MANUAL_JOURNALS.RESOURCE.NOT.FOUND');
expect(res.body.errors[0].code).equals(200);
});
it.only('Should retrieve all manual journals with pagination meta.', async () => {
const resource = await create('resource', { name: 'manual_journals' });
const manualJournal1 = await create('manual_journal');
const manualJournal2 = await create('manual_journal');
const res = await request()
.get('/api/accounting/manual-journals')
.set('x-access-token', loginRes.body.token)
.send();
expect(res.status).equals(200);
expect(res.body.manualJournals).to.be.a('array');
expect(res.body.manualJournals.length).equals(2);
});
});
describe('route: `/accounting/quick-journal-entries`', async () => {
it('Shoud `credit_account_id` be required', () => {

View File

@@ -363,7 +363,7 @@ describe('routes: `/financial_statements`', () => {
});
});
describe.only('routes: `financial_statements/balance_sheet`', () => {
describe('routes: `financial_statements/balance_sheet`', () => {
it('Should response unauthorzied in case the user was not authorized.', async () => {
const res = await request()
.get('/api/financial_statements/balance_sheet')
@@ -406,7 +406,7 @@ describe('routes: `/financial_statements`', () => {
expect(res.body.balance_sheet.liabilities_equity.accounts).to.be.a('array');
});
it.only('Should retrieve assets/liabilities total balance between the given date range.', async () => {
it('Should retrieve assets/liabilities total balance between the given date range.', async () => {
const res = await request()
.get('/api/financial_statements/balance_sheet')
.set('x-access-token', loginRes.body.token)