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.
 
 
 
 

38 lines
904 B

const SectorsView = require('style_manager/view/SectorsView');
const Sectors = require('style_manager/model/Sectors');
module.exports = {
run() {
describe('SectorsView', () => {
var fixtures;
var model;
var view;
beforeEach(() => {
model = new Sectors([]);
view = new SectorsView({
collection: model
});
document.body.innerHTML = '<div id="fixtures"></div>';
fixtures = document.body.firstChild;
fixtures.appendChild(view.render().el);
});
afterEach(() => {
view.collection.reset();
});
it("Collection is empty", () => {
expect(view.el.innerHTML).toEqual('');
});
it("Add new sectors", () => {
view.collection.add([{}, {}]);
expect(view.el.children.length).toEqual(2);
});
});
}
};