mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: Sorting manual journals and items.
This commit is contained in:
@@ -581,19 +581,7 @@ describe('routes: `/accounting`', () => {
|
||||
|
||||
describe('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('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');
|
||||
|
||||
@@ -603,8 +591,8 @@ describe('routes: `/accounting`', () => {
|
||||
.send();
|
||||
|
||||
expect(res.status).equals(200);
|
||||
expect(res.body.manualJournals).to.be.a('array');
|
||||
expect(res.body.manualJournals.length).equals(2);
|
||||
expect(res.body.manualJournals.results).to.be.a('array');
|
||||
expect(res.body.manualJournals.results.length).equals(2);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user