salix/modules/item/back/methods/item-shelving/specs/getAlternative.spec.js

23 lines
735 B
JavaScript

const {models} = require('vn-loopback/server/server');
const {mockLoopBackContext} = require('vn-loopback/../../back/vn-jasmine');
describe('itemShelving getAlternative()', () => {
beforeAll(() =>
mockLoopBackContext()
);
it('should return a list of items without alternatives', async() => {
const shelvingFk = 'HEJ';
const itemShelvings = await models.ItemShelving.getAlternative(shelvingFk);
expect(itemShelvings[0].shelvings.length).toEqual(0);
});
it('should return an empty list', async() => {
const shelvingFk = 'ZZP';
const itemShelvings = await models.ItemShelving.getAlternative(shelvingFk);
expect(itemShelvings.length).toEqual(0);
});
});