spec
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
7d6a33d79a
commit
3f1039f6d7
|
@ -1,5 +1,5 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('getSectors', {
|
||||
Self.remoteMethod('getSectors', {
|
||||
description: 'Get all sectors',
|
||||
accessType: 'READ',
|
||||
returns: {
|
||||
|
@ -12,9 +12,9 @@ module.exports = Self => {
|
|||
}
|
||||
});
|
||||
|
||||
Self.getSectors = async ctx => {
|
||||
Self.getSectors = async() => {
|
||||
const query = `CALL vn.sector_get()`;
|
||||
const [result] = await Self.rawSql(query, []);
|
||||
const [result] = await Self.rawSql(query);
|
||||
return result;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
describe('collectionFaults()', () => {
|
||||
it('return shelving afected', async() => {
|
||||
let val = 2;
|
||||
|
||||
expect(val).toBeGreaterThan(1);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('getCollection()', () => {
|
||||
it('return list of collection', async() => {
|
||||
let ctx = {req: {accessToken: {userId: 1}}};
|
||||
let response = await app.models.Collection.getCollection(ctx);
|
||||
|
||||
expect(response.length).toEqual(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('getSectors()', () => {
|
||||
it('return list of sectors', async() => {
|
||||
let response = await app.models.Collection.getSectors();
|
||||
|
||||
expect(response.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('newCollection()', () => {
|
||||
it('return a new collection', async() => {
|
||||
let ctx = {req: {accessToken: {userId: 1}}};
|
||||
let response = await app.models.Collection.newCollection(ctx, 500, 1, 1);
|
||||
|
||||
expect(response.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
describe('updateCollectionSale()', () => {
|
||||
it('return a collection updated', async() => {
|
||||
let val = 2;
|
||||
|
||||
expect(val).toBeGreaterThan(1);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue