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

26 lines
752 B
JavaScript
Raw Normal View History

2024-01-17 11:58:57 +00:00
const {models} = require('vn-loopback/server/server');
describe('itemShelving getAlternative()', () => {
2024-01-17 11:58:57 +00:00
beforeAll(async() => {
ctx = {
req: {
headers: {origin: 'http://localhost'},
}
};
});
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);
2024-01-17 11:58:57 +00:00
});
});