Skip to content

Commit

Permalink
Merge pull request #114 from mjschock/STENCIL-3323
Browse files Browse the repository at this point in the history
STENCIL-3323 - Fix thumbnailImage helper
  • Loading branch information
mjschock authored Apr 12, 2017
2 parents f3dcfb2 + 777179e commit 311c5a9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/thirdParty.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const whitelist = [
},
{
name: 'html',
include: ['ellipsis', 'sanitize', 'ul', 'ol', 'thumbnail']
include: ['ellipsis', 'sanitize', 'ul', 'ol', 'thumbnailImage']
},
{
name: 'inflection',
Expand Down
20 changes: 20 additions & 0 deletions test/helpers/thirdParty.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,26 @@ describe('third party handlebars-helpers', function() {
});
});

describe('contains thumbnailImage', function() {
it('creates a <figure> with a thumbnail linked to an image', function(done) {
const ctxt = {
data: {
id: 'id',
alt: 'alt',
thumbnail: 'thumbnail.png',
size: {
width: 32,
height: 32
}
}
};
expect(c(`{{{thumbnailImage data}}}`, ctxt)).to.be
.equal('<figure id=\"image-id\">\n<img alt=\"alt\" src=\"thumbnail.png\" width=\"32\" height=\"32\">\n</figure>');

done();
});
});

});

describe('inflection helpers', function() {
Expand Down

0 comments on commit 311c5a9

Please sign in to comment.