diff --git a/src/style_manager/model/Layers.js b/src/style_manager/model/Layers.js index 1cfa4900a..79bbfeb7b 100644 --- a/src/style_manager/model/Layers.js +++ b/src/style_manager/model/Layers.js @@ -19,7 +19,8 @@ module.exports = Backbone.Collection.extend({ }, getSeparator() { - return this.property.get('layerSeparator'); + const { property } = this; + return property ? property.get('layerSeparator') : ', '; }, /** diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index d1feb2cce..8ed458eaa 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -155,6 +155,7 @@ describe('StyleManager', () => { } ] }); + obj.onLoad(); }); afterEach(() => { diff --git a/test/specs/style_manager/model/Models.js b/test/specs/style_manager/model/Models.js index a5579a9fe..012b5f0a7 100644 --- a/test/specs/style_manager/model/Models.js +++ b/test/specs/style_manager/model/Models.js @@ -155,7 +155,7 @@ module.exports = { test('parseValue with function and functionName', () => { obj = new Property({ functionName: 'fn' }); - const result = { value: 'testValue' }; + const result = { value: 'testValue', functionName: 'fn' }; expect(obj.parseValue('fn(testValue)')).toEqual(result); expect(obj.parseValue('fn(testValue')).toEqual(result); }); @@ -194,7 +194,7 @@ module.exports = { units: ['px', 'deg'], functionName: 'test' }); - const result = { value: 55, unit: 'deg' }; + const result = { value: 55, unit: 'deg', functionName: 'test' }; expect(obj.parseValue('test(55deg)')).toEqual(result); });