From a4243e14c53a3309125d3caeb5719d0b03ad52f9 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Mon, 17 Oct 2022 10:17:56 +0200 Subject: [PATCH] Created Back test for newSupplier --- .../methods/supplier/specs/newSupplier.spec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules/supplier/back/methods/supplier/specs/newSupplier.spec.js 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); + }); +});