Browse Source

Fix tests

pull/36/head
Artur Arseniev 10 years ago
parent
commit
22cb6737fd
  1. 4
      test/specs/style_manager/view/PropertyColorView.js
  2. 9
      test/specs/style_manager/view/PropertyIntegerView.js

4
test/specs/style_manager/view/PropertyColorView.js

@ -58,7 +58,7 @@ define([path + 'PropertyColorView', 'StyleManager/model/Property', 'DomComponent
it('Inputs rendered', function() { it('Inputs rendered', function() {
var prop = view.el; var prop = view.el;
prop.querySelector('input[type=text]').should.be.ok; prop.querySelector('input[type=text]').should.be.ok;
prop.querySelector('.color-picker').should.be.ok; prop.querySelector('.field-color-picker').should.be.ok;
}); });
it('Inputs should exist', function() { it('Inputs should exist', function() {
@ -161,4 +161,4 @@ define([path + 'PropertyColorView', 'StyleManager/model/Property', 'DomComponent
} }
}; };
}); });

9
test/specs/style_manager/view/PropertyIntegerView.js

@ -21,6 +21,7 @@ define([path + 'PropertyIntegerView', 'StyleManager/model/Property', 'DomCompone
var units = ['px', '%', 'em']; var units = ['px', '%', 'em'];
var minValue = -15; var minValue = -15;
var maxValue = 15; var maxValue = 15;
var unitsElSel = '.field-units select';
before(function () { before(function () {
$fixtures = $("#fixtures"); $fixtures = $("#fixtures");
@ -63,16 +64,16 @@ define([path + 'PropertyIntegerView', 'StyleManager/model/Property', 'DomCompone
it('Inputs rendered', function() { it('Inputs rendered', function() {
var prop = view.el; var prop = view.el;
prop.querySelector('input[type=text]').should.be.ok; prop.querySelector('input[type=text]').should.be.ok;
prop.querySelector('select.unit').should.be.ok; prop.querySelector(unitsElSel).should.be.ok;
}); });
it('Units rendered', function() { it('Units rendered', function() {
var select = view.el.querySelector('select.unit'); var select = view.el.querySelector(unitsElSel);
select.children.length.should.equal(units.length); select.children.length.should.equal(units.length);
}); });
it('Units rendered correctly', function() { it('Units rendered correctly', function() {
var children = view.el.querySelector('select.unit').children; var children = view.el.querySelector(unitsElSel).children;
children[0].textContent.should.equal(units[0]); children[0].textContent.should.equal(units[0]);
children[1].textContent.should.equal(units[1]); children[1].textContent.should.equal(units[1]);
children[2].textContent.should.equal(units[2]); children[2].textContent.should.equal(units[2]);
@ -205,4 +206,4 @@ define([path + 'PropertyIntegerView', 'StyleManager/model/Property', 'DomCompone
} }
}; };
}); });

Loading…
Cancel
Save