Browse Source

Add composite property tests

up-style-manager
Artur Arseniev 5 years ago
parent
commit
396df55f1b
  1. 14
      test/specs/style_manager/model/Properties.js

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

@ -68,13 +68,23 @@ describe('StyleManager properties logic', () => {
expect(compTypePropInn).toBeTruthy(); expect(compTypePropInn).toBeTruthy();
}); });
test('Inner property has no value', () => {
expect(compTypeProp.hasValue()).toBe(false);
expect(compTypePropInn.hasValue()).toBe(false);
});
test('Rule selected', () => { test('Rule selected', () => {
expect(obj.getLastSelected()).toBe(rule1); expect(obj.getLastSelected()).toBe(rule1);
}); });
test('Updating inner property, it reflects on the rule', () => { test('Updating inner property, it reflects on the rule', () => {
compTypePropInn.upValue('55'); compTypePropInn.upValue('55%');
expect(rule1.getStyle()).toBe(1); const style = rule1.getStyle();
const otherProps = Object.keys(style).filter(p => p.indexOf('padding') >= 0 && p !== propInTest);
expect(style[propInTest]).toBe('55%');
expect(compTypeProp.hasValue()).toBe(true);
expect(compTypePropInn.hasValue()).toBe(true);
otherProps.forEach(prop => expect(style[prop]).toBe(''));
}); });
}); });
}); });

Loading…
Cancel
Save