diff --git a/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js new file mode 100644 index 000000000..69a32436e --- /dev/null +++ b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js @@ -0,0 +1,14 @@ +const app = require('vn-loopback/server/server'); + +describe('Supplier newSupplier()', () => { + const supplier = { + name: 'TestSupplier-1' + }; + + it('should create a new supplier containing only the name', async() => { + const result = await app.models.Supplier.newSupplier(supplier); + + expect(result.payDemFk).toEqual('TestSupplier-1'); + expect(result.payDemFk).toEqual(1); + }); +});