Move over initial editor code, split templates into smaller pieces

This commit is contained in:
Tautvidas Sipavičius
2015-08-17 14:23:46 +03:00
parent a22000abff
commit 42586a72e9
399 changed files with 13316 additions and 94 deletions

View File

@ -0,0 +1,41 @@
describe('Heading', function() {
describe('view', function() {
var view;
beforeEach(function() {
var model = new Backbone.SuperModel({
newsletter_subject: 'a test subject',
});
view = new (EditorApplication.module("components.heading").HeadingView)({
model: model,
});
});
it('renders', function() {
expect(view.render).to.not.throw();
});
describe('once rendered', function() {
var view, model;
beforeEach(function() {
model = new Backbone.SuperModel({
newsletter_subject: 'a test subject',
newsletter_preheader: 'a test preheader',
});
view = new (EditorApplication.module("components.heading").HeadingView)({
model: model,
});
view.render();
});
it('changes the model when subject field is changed', function() {
view.$('.mailpoet_input_title').val('a new testing subject').keyup();
expect(model.get('newsletter_subject')).to.equal('a new testing subject');
});
it('changes the model when preheader field is changed', function() {
view.$('.mailpoet_input_preheader').val('a new testing preheader').keyup();
expect(model.get('newsletter_preheader')).to.equal('a new testing preheader');
});
});
});
});