Browse Source

Test detached getStyleFromLayers

up-style-manager
Artur Arseniev 5 years ago
parent
commit
48ac5fc348
  1. 4
      src/style_manager/model/PropertyStack.js
  2. 10
      test/specs/style_manager/model/Properties.js

4
src/style_manager/model/PropertyStack.js

@ -321,7 +321,9 @@ export default Property.extend({
result[key] = result[key].join(this.__getJoinLayers());
});
if (!this.isDetached()) {
if (this.isDetached()) {
result[this.getName()] = '';
} else {
const style = this.getProperties().reduce((acc, prop) => {
acc[prop.getName()] = '';
return acc;

10
test/specs/style_manager/model/Properties.js

@ -187,6 +187,16 @@ describe('StyleManager properties logic', () => {
});
});
test('getStyleFromLayers detached', () => {
compTypeProp.set('detached', true);
expect(compTypeProp.getStyleFromLayers()).toEqual({
[propTest]: '',
[propATest]: 'valueA-1, valueA-2',
[propBTest]: 'valueB-1, valueB-2',
[propCTest]: 'valueC-1-ext, valueC-2-ext',
});
});
test('Layers has the right values', () => {
expect(compTypeProp.getLayer(0).getValues()).toEqual({
[propATest]: 'valueA-1',

Loading…
Cancel
Save