0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Added tests for null values in content/excerpt helpers

refs #10612

- Added test coverage for existing implementation in excerpt helper and new changes in content helper (9a21bea)
This commit is contained in:
Nazar Gargol 2019-03-18 19:52:49 +08:00
parent 56deccb74d
commit 04857e8823
2 changed files with 19 additions and 0 deletions

View file

@ -4,6 +4,14 @@ var should = require('should'),
helpers = require('../../../server/helpers');
describe('{{content}} helper', function () {
it('renders empty string when null', function () {
var html = null,
rendered = helpers.content.call({html: html});
should.exist(rendered);
rendered.string.should.equal('');
});
it('can render content', function () {
var html = 'Hello World',
rendered = helpers.content.call({html: html});

View file

@ -4,6 +4,17 @@ var should = require('should'),
helpers = require('../../../server/helpers');
describe('{{excerpt}} Helper', function () {
it('renders empty string when html and excerpt are null', function () {
var html = null,
rendered = helpers.excerpt.call({
html: html,
custom_excerpt: null
});
should.exist(rendered);
rendered.string.should.equal('');
});
it('can render excerpt', function () {
var html = 'Hello World',
rendered = helpers.excerpt.call({