2020-04-08 19:02:31 +01:00
|
|
|
const should = require('should');
|
|
|
|
const hbs = require('../../../../../core/frontend/services/themes/engine');
|
|
|
|
const template = require('../../../../../core/frontend/services/themes/handlebars/template');
|
2013-11-27 21:45:01 -05:00
|
|
|
|
|
|
|
describe('Helpers Template', function () {
|
2014-06-04 22:26:03 +01:00
|
|
|
it('can execute a template', function () {
|
2013-12-01 18:31:55 -05:00
|
|
|
hbs.registerPartial('test', '<h1>Hello {{name}}</h1>');
|
2013-11-27 21:45:01 -05:00
|
|
|
|
2020-04-29 16:44:27 +01:00
|
|
|
const safeString = template.execute('test', {name: 'world'});
|
2013-11-27 21:45:01 -05:00
|
|
|
|
2013-12-01 18:31:55 -05:00
|
|
|
should.exist(safeString);
|
|
|
|
safeString.should.have.property('string').and.equal('<h1>Hello world</h1>');
|
2013-11-27 21:45:01 -05:00
|
|
|
});
|
2014-09-10 00:06:24 -04:00
|
|
|
});
|