mirror of https://github.com/artf/grapesjs.git
5 changed files with 119 additions and 30 deletions
@ -0,0 +1,50 @@ |
|||||
|
var path = 'StyleManager/view/'; |
||||
|
define([path + 'SectorsView', 'StyleManager/model/Sectors'], |
||||
|
function(SectorsView, Sectors) { |
||||
|
|
||||
|
return { |
||||
|
run : function(){ |
||||
|
|
||||
|
describe('SectorsView', function() { |
||||
|
|
||||
|
var $fixtures; |
||||
|
var $fixture; |
||||
|
var model; |
||||
|
var view; |
||||
|
|
||||
|
before(function () { |
||||
|
$fixtures = $("#fixtures"); |
||||
|
$fixture = $('<div class="cssrules-fixture"></div>'); |
||||
|
}); |
||||
|
|
||||
|
beforeEach(function () { |
||||
|
model = new Sectors([]); |
||||
|
view = new SectorsView({ |
||||
|
collection: model |
||||
|
}); |
||||
|
$fixture.empty().appendTo($fixtures); |
||||
|
$fixture.html(view.render().el); |
||||
|
}); |
||||
|
|
||||
|
afterEach(function () { |
||||
|
view.collection.reset(); |
||||
|
}); |
||||
|
|
||||
|
after(function () { |
||||
|
$fixture.remove(); |
||||
|
}); |
||||
|
|
||||
|
it("Collection is empty", function (){ |
||||
|
view.$el.html().should.be.empty; |
||||
|
}); |
||||
|
|
||||
|
it("Add new sectors", function (){ |
||||
|
view.collection.add([{}, {}]); |
||||
|
view.el.children.length.should.equal(2); |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
}); |
||||
Loading…
Reference in new issue