mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
add server to monorepo.
This commit is contained in:
32
packages/server/tests/lib/CachableModel.test.js
Normal file
32
packages/server/tests/lib/CachableModel.test.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
request,
|
||||
expect,
|
||||
} from '~/testInit';
|
||||
import Account from 'models/Account';
|
||||
import {
|
||||
tenantWebsite,
|
||||
tenantFactory,
|
||||
loginRes
|
||||
} from '~/dbInit';
|
||||
import { times } from 'lodash';
|
||||
|
||||
describe('CachableModel', () => {
|
||||
describe('remember()', () => {
|
||||
it('Should retrieve the data from the storage.', async () => {
|
||||
|
||||
for (let i = 0; i < 1; i++) {
|
||||
const account = await Account.tenant().query()
|
||||
.remember()
|
||||
.where('id', 1);
|
||||
|
||||
const account2 = await Account.tenant().query()
|
||||
.remember()
|
||||
.withGraphFetched('balance');
|
||||
|
||||
console.log(account2);
|
||||
// \\\
|
||||
}
|
||||
// Account.flushCache();
|
||||
});
|
||||
});
|
||||
});
|
||||
39
packages/server/tests/lib/MetableStore.test.ts
Normal file
39
packages/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')
|
||||
});
|
||||
Reference in New Issue
Block a user