Browse Source

Fix tests

pull/36/head
Artur Arseniev 10 years ago
parent
commit
45b7e3beeb
  1. 10
      src/block_manager/view/BlocksView.js
  2. 7
      src/device_manager/view/DevicesView.js
  3. 3
      test/specs/dom_components/view/ComponentImageView.js

10
src/block_manager/view/BlocksView.js

@ -10,10 +10,12 @@ function(Backbone, BlockView) {
this.listenTo(this.collection, 'add', this.addTo);
this.em = this.config.em;
this.tac = 'test-tac';
this.config.getSorter = this.getSorter;
this.config.dragHelper = this.dragHelper;
//this.listenTo(this.em, 'change:device', this.updateOffset);
this.canvas = this.em.get('Canvas');
if(this.em){
this.config.getSorter = this.getSorter;
this.config.dragHelper = this.dragHelper;
this.canvas = this.em.get('Canvas');
}
},
/**

7
src/device_manager/view/DevicesView.js

@ -43,10 +43,11 @@ function(Backbone, devicesTemplate) {
*/
updateSelect: function(){
var em = this.em;
if(em){
var device = this.em.getDeviceModel();
var devEl = this.devicesEl;
if(em && em.getDeviceModel && devEl){
var device = em.getDeviceModel();
var name = device ? device.get('name') : '';
this.devicesEl.val(name);
devEl.val(name);
}
},

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

@ -35,7 +35,8 @@ define([path + 'ComponentImageView', 'DomComponents/model/Component'],
});
it('Component empty', function() {
$fixture.html().should.equal('<img class="'+ view.classEmpty +'">');
view.el.getAttribute('onmousedown').should.equal('return false');
view.el.getAttribute('class').should.equal(view.classEmpty);
});
it('TagName is <img>', function() {

Loading…
Cancel
Save