2024-01-17 11:58:57 +00:00
|
|
|
const {models} = require('vn-loopback/server/server');
|
|
|
|
|
2024-02-19 13:46:42 +00:00
|
|
|
describe('itemShelving getAlternative()', () => {
|
2024-01-17 11:58:57 +00:00
|
|
|
beforeAll(async() => {
|
|
|
|
ctx = {
|
|
|
|
req: {
|
|
|
|
headers: {origin: 'http://localhost'},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-01-17 13:21:50 +00:00
|
|
|
it('should return a list of items without alternatives', async() => {
|
2024-01-17 14:26:04 +00:00
|
|
|
const shelvingFk = 'HEJ';
|
2024-02-19 13:46:42 +00:00
|
|
|
const itemShelvings = await models.ItemShelving.getAlternative(shelvingFk);
|
2024-01-17 13:21:50 +00:00
|
|
|
|
2024-03-04 08:21:41 +00:00
|
|
|
expect(itemShelvings[0].shelvings.length).toEqual(0);
|
2024-01-17 13:21:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should return an empty list', async() => {
|
2024-01-17 14:26:04 +00:00
|
|
|
const shelvingFk = 'ZZP';
|
2024-02-19 13:46:42 +00:00
|
|
|
const itemShelvings = await models.ItemShelving.getAlternative(shelvingFk);
|
2024-01-17 13:21:50 +00:00
|
|
|
|
|
|
|
expect(itemShelvings.length).toEqual(0);
|
2024-01-17 11:58:57 +00:00
|
|
|
});
|
|
|
|
});
|