Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Commit

Permalink
Verify id property for multiple updates
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Sep 20, 2016
1 parent 77d8ad2 commit 0f6e010
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() =>
Expand Down Expand Up @@ -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');
});
});
Expand Down

0 comments on commit 0f6e010

Please sign in to comment.