Browse Source

Fix regressions

pull/1874/head
Artur Arseniev 7 years ago
parent
commit
f2dc62905a
  1. 2
      src/device_manager/model/Device.js
  2. 4
      src/style_manager/model/Property.js
  3. 1
      test/specs/device_manager/view/DevicesView.js
  4. 2
      test/specs/dom_components/model/Component.js
  5. 3
      test/specs/dom_components/view/ComponentImageView.js

2
src/device_manager/model/Device.js

@ -32,7 +32,7 @@ module.exports = Backbone.Model.extend({
},
checkUnit(prop) {
const pr = this.get(prop);
const pr = this.get(prop) || '';
const noUnit = (parseFloat(pr) || 0).toString() === pr.toString();
noUnit && this.set(prop, `${pr}px`);
}

4
src/style_manager/model/Property.js

@ -43,8 +43,8 @@ const Property = require('backbone').Model.extend(
},
initialize(props = {}, opts = {}) {
const id = this.get('id');
const name = this.get('name');
const id = this.get('id') || '';
const name = this.get('name') || '';
!this.get('property') &&
this.set('property', (name || id).replace(/ /g, '-'));
const prop = this.get('property');

1
test/specs/device_manager/view/DevicesView.js

@ -9,6 +9,7 @@ module.exports = {
var model;
var view;
var editorModel;
var em;
beforeEach(() => {
model = new Devices([]);

2
test/specs/dom_components/model/Component.js

@ -389,7 +389,7 @@ module.exports = {
});
test('ComponentImage toHTML', () => {
obj = new ComponentImage();
obj = new ComponentImage({ src: '' });
expect(obj.toHTML()).toEqual('<img/>');
});

3
test/specs/dom_components/view/ComponentImageView.js

@ -1,5 +1,5 @@
const ComponentImageView = require('dom_components/view/ComponentImageView');
const Component = require('dom_components/model/Component');
const Component = require('dom_components/model/ComponentImage');
module.exports = {
run() {
@ -21,7 +21,6 @@ module.exports = {
});
test('Component empty', () => {
expect(view.el.getAttribute('onmousedown')).toEqual('return false');
expect(view.el.getAttribute('class')).toEqual(view.classEmpty);
});

Loading…
Cancel
Save