diff --git a/services/loopback/common/methods/item/specs/clone.spec.js b/services/loopback/common/methods/item/specs/clone.spec.js index cad4edf31..e971e1ee6 100644 --- a/services/loopback/common/methods/item/specs/clone.spec.js +++ b/services/loopback/common/methods/item/specs/clone.spec.js @@ -12,10 +12,19 @@ describe('item clone()', () => { nextItemId = nextAvailableId.id; }); - it('should', async() => { + it('should clone the given item and it should have the expected id', async() => { let itemFk = 1; let result = await app.models.Item.clone(itemFk); expect(result).toEqual(nextItemId); }); + + it('should attempt to clone the given item but give an error as it doesnt exist', async() => { + try { + let itemFk = 999; + await app.models.Item.clone(itemFk); + } catch (error) { + expect(error.toString()).toContain('Cannot convert undefined or null to object'); + } + }); });