mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
- feat: remove unnecessary migrations, controllers and models files.
- feat: metable store - feat: metable store with settings store. - feat: settings middleware to auto-save and load. - feat: DI db manager to master container. - feat: write some logs to sale invoices.
This commit is contained in:
39
server/tests/lib/MetableStore.test.ts
Normal file
39
server/tests/lib/MetableStore.test.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { expect } from '~/testInit';
|
||||
import MetableStore from '@/lib/MetableStore';
|
||||
|
||||
describe('MetableStore()', () => {
|
||||
|
||||
describe('find', () => {
|
||||
it('Find metadata by the given key.', () => {
|
||||
const store = new MetableStore();
|
||||
store.metadata = [{ key: 'first-key', value: 'first-value' }];
|
||||
|
||||
const meta = store.find('first-key');
|
||||
|
||||
expect(meta.value).equals('first-value');
|
||||
expect(meta.key).equals('first-key');
|
||||
});
|
||||
|
||||
it('Find metadata by the key as payload.', () => {
|
||||
|
||||
});
|
||||
|
||||
it('Find metadata by the given key and extra columns.', () => {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
describe('all()', () => {
|
||||
it('Should retrieve all metadata in the store.', () => {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
describe('get()', () => {
|
||||
it('Should retrieve data of the given metadata query.', () => {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
describe('removeMeta')
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
import { create, expect } from '~/testInit';
|
||||
import Option from '@/models/Option';
|
||||
import MetableCollection from '@/lib/Metable/MetableCollection';
|
||||
import {
|
||||
tenantFactory,
|
||||
tenantWebsite,
|
||||
} from '~/dbInit';
|
||||
|
||||
|
||||
describe('Model: Option', () => {
|
||||
it('Should result collection be instance of `MetableCollection` class.', async () => {
|
||||
await tenantFactory.create('option');
|
||||
await tenantFactory.create('option');
|
||||
const options = await Option.tenant().query();
|
||||
|
||||
expect(options).to.be.an.instanceof(MetableCollection);
|
||||
});
|
||||
});
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
loginRes
|
||||
} from '~/dbInit';
|
||||
|
||||
describe.only('route: `/api/purchases/bills`', () => {
|
||||
describe('route: `/api/purchases/bills`', () => {
|
||||
describe('POST: `/api/purchases/bills`', () => {
|
||||
it('Should `bill_number` be required.', async () => {
|
||||
const res = await request()
|
||||
|
||||
Reference in New Issue
Block a user