From 0f6e010a36486b322b100bd06f1adf20d8e3ccae Mon Sep 17 00:00:00 2001 From: David Luecke Date: Mon, 19 Sep 2016 19:21:10 -0700 Subject: [PATCH] Verify id property for multiple updates --- src/common-tests.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common-tests.js b/src/common-tests.js index bf8a574..996a687 100644 --- a/src/common-tests.js +++ b/src/common-tests.js @@ -3,7 +3,7 @@ import { expect } from 'chai'; function common(app, errors, serviceName = 'people', idProp = 'id') { - describe('Common tests', () => { + describe(`Common tests, ${serviceName} service with ${idProp} id property`, () => { const _ids = {}; beforeEach(() => @@ -520,7 +520,10 @@ function common(app, errors, serviceName = 'people', idProp = 'id') { return app.service(serviceName).create(items).then(data => { expect(data).to.not.be.empty; + expect(Array.isArray(data)).to.equal(true); + expect(typeof data[0][idProp]).to.not.equal('undefined'); expect(data[0].name).to.equal('Gerald'); + expect(typeof data[1][idProp]).to.not.equal('undefined'); expect(data[1].name).to.equal('Herald'); }); });