diff --git a/models/meta.js b/models/meta.js index 9ed6b29..b14c106 100644 --- a/models/meta.js +++ b/models/meta.js @@ -29,7 +29,7 @@ module.exports = function (Meta, options) { */ function formatProperties (properties) { const result = {} - for (const key in properties) { + for (key in properties) { if (properties.hasOwnProperty(key)) { result[ key ] = _.clone(properties[ key ]) result[ key ].type = properties[ key ].type.name diff --git a/test/component-test.js b/test/component-test.js index e435d66..eb219d9 100644 --- a/test/component-test.js +++ b/test/component-test.js @@ -35,6 +35,15 @@ describe('Component test', function() { expect(res.validations).to.be.an('array') }) }) + + it('should find all models fields', function () { + return Meta.getModelById('Category') + .then((res) = > { + expect(res.properties).to.be.an('object') + expect(res.properties.name).to.be.an('object') + expect(res.properties.id).to.be.an('object') + }) + }) }) })