const models = require('vn-loopback/server/server').models;

describe('itemShelving getInventory()', () => {
    it('should return a list of itemShelvings', async() => {
        const tx = await models.ItemShelving.beginTransaction({});

        let response;
        try {
            const options = {transaction: tx};
            await models.ItemShelving.rawSql(`
                UPDATE vn.config
                    SET mainWarehouseFk=1
                    WHERE id=1
            `, null, options);
            response = await models.ItemShelving.getInventory('100-01', 'LR-02-3', options);
            await tx.rollback();
        } catch (e) {
            await tx.rollback();
            throw e;
        }

        expect(response.length).toEqual(2);
    });
});