Change title position to featured image position

This commit is contained in:
Tautvidas Sipavičius
2016-02-23 15:26:12 +02:00
parent a23aac370c
commit 1942972282
9 changed files with 141 additions and 109 deletions

View File

@ -62,10 +62,6 @@ define([
expect(model.get('titleFormat')).to.match(/^(h1|h2|h3|ul)$/);
});
it('has title position', function () {
expect(model.get('titlePosition')).to.match(/^(inTextBlock|aboveBlock)$/);
});
it('has title alignment', function () {
expect(model.get('titleAlignment')).to.match(/^(left|center|right)$/);
});
@ -74,10 +70,14 @@ define([
expect(model.get('titleIsLink')).to.be.a('boolean');
});
it('has image specific alignment', function () {
it('has image width', function () {
expect(model.get('imageFullWidth')).to.be.a('boolean');
});
it('has featured image position', function () {
expect(model.get('featuredImagePosition')).to.match(/^(belowTitle|aboveTitle|none)$/);
});
it('has an option to display author', function () {
expect(model.get('showAuthor')).to.match(/^(no|aboveText|belowText)$/);
});
@ -127,11 +127,10 @@ define([
inclusionType: 'exclude', // 'include'|'exclude'
displayType: 'full', // 'excerpt'|'full'|'titleOnly'
titleFormat: 'h3', // 'h1'|'h2'|'h3'|'ul'
titlePosition: 'aboveBlock', // 'inTextBlock'|'aboveBlock',
titleAlignment: 'right', // 'left'|'center'|'right'
titleIsLink: true, // false|true
imageFullWidth: false, // true|false
//imageAlignment: 'right', // 'centerFull'|'centerPadded'|'left'|'right'|'alternate'|'none'
featuredImagePosition: 'aboveTitle',
showAuthor: 'belowText', // 'no'|'aboveText'|'belowText'
authorPrecededBy: 'Custom config author preceded by',
showCategories: 'belowText', // 'no'|'aboveText'|'belowText'
@ -174,10 +173,10 @@ define([
expect(model.get('inclusionType')).to.equal('exclude');
expect(model.get('displayType')).to.equal('full');
expect(model.get('titleFormat')).to.equal('h3');
expect(model.get('titlePosition')).to.equal('aboveBlock');
expect(model.get('titleAlignment')).to.equal('right');
expect(model.get('titleIsLink')).to.equal(true);
expect(model.get('imageFullWidth')).to.equal(false);
expect(model.get('featuredImagePosition')).to.equal('aboveTitle');
expect(model.get('showAuthor')).to.equal('belowText');
expect(model.get('authorPrecededBy')).to.equal('Custom config author preceded by');
expect(model.get('showCategories')).to.equal('belowText');
@ -299,12 +298,6 @@ define([
expect(model.get('titleFormat')).to.equal(newValue);
});
it('changes the model if title position changes', function () {
var newValue = 'aboveBlock';
view.$('.mailpoet_posts_title_position').val(newValue).change();
expect(model.get('titlePosition')).to.equal(newValue);
});
it('changes the model if title alignment changes', function () {
var newValue = 'right';
view.$('.mailpoet_posts_title_alignment').val(newValue).change();
@ -323,6 +316,12 @@ define([
expect(model.get('imageFullWidth')).to.equal(newValue);
});
it('changes the model if featured image position changes', function () {
var newValue = 'aboveTitle';
view.$('.mailpoet_posts_featured_image_position').val(newValue).change();
expect(model.get('featuredImagePosition')).to.equal(newValue);
});
it('changes the model if show author changes', function () {
var newValue = 'belowText';
view.$('.mailpoet_posts_show_author').val(newValue).change();