diff --git a/app/tests/libs/send-email-notifications.test.js b/app/tests/libs/send-email-notifications.test.js index 9b2ee476..85366fe3 100644 --- a/app/tests/libs/send-email-notifications.test.js +++ b/app/tests/libs/send-email-notifications.test.js @@ -3,7 +3,8 @@ /** * Module dependencies. */ -var emailNotifications = require('../../libs/send-email-notifications'); +var emailNotifications = require('../../libs/send-email-notifications'), + constants = require('../../libs/constants'); /** * Globals @@ -26,6 +27,14 @@ var invalidFormFields = [ {fieldType:'number', title:'Your Age'} ]; +var htmlTemplate = '

First Name \ +
Your Website \ +
Your Age

'; + +var renderedTemplate = '

John Smith \ +
https://johnsmith.me \ +
45

'; + /** * Unit tests */ @@ -43,12 +52,16 @@ describe('Send Email Notification Unit Tests', function() { }); }); + describe('Method parseTemplate', function(){ + it('should be properly render a template given a valid field dict', function() { + var actualRenderedTemplate = parseTemplate(htmlTemplate, validFieldDict, constants.varFormat); + actualRenderedTemplate.should.equal(renderedTemplate); + }); + }); + describe('Method replaceTemplateVal', function() { }); describe('Method send', function() { }); - - describe('Method parseTemplate', function(){ - }); });