Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 lines
1.0 KiB

const SectorsView = require('style_manager/view/SectorsView');
const Sectors = require('style_manager/model/Sectors');
module.exports = {
run() {
describe('SectorsView', () => {
var $fixtures;
var $fixture;
var model;
var view;
before(() => {
$fixtures = $("#fixtures");
$fixture = $('<div class="sectors-fixture"></div>');
});
beforeEach(() => {
model = new Sectors([]);
view = new SectorsView({
collection: model
});
$fixture.empty().appendTo($fixtures);
$fixture.html(view.render().el);
});
afterEach(() => {
view.collection.reset();
});
after(() => {
$fixture.remove();
});
it("Collection is empty", () => {
expect(view.el.innerHTML).toEqual('');
});
it("Add new sectors", () => {
view.collection.add([{}, {}]);
expect(view.el.children.length).toEqual(2);
});
});
}
};