From 9b878c19d87c1c77e32f87bc1dde5c96102aee61 Mon Sep 17 00:00:00 2001 From: Bruno Wagner and Fabio Pio Date: Fri, 16 Jan 2015 19:30:02 -0200 Subject: Issue #233 plain text body now escapes html tags --- web-ui/test/spec/helpers/view_helper.spec.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'web-ui/test/spec/helpers/view_helper.spec.js') diff --git a/web-ui/test/spec/helpers/view_helper.spec.js b/web-ui/test/spec/helpers/view_helper.spec.js index 806739b9..51ede430 100644 --- a/web-ui/test/spec/helpers/view_helper.spec.js +++ b/web-ui/test/spec/helpers/view_helper.spec.js @@ -53,10 +53,20 @@ define(['helpers/view_helper'], function (viewHelper) { }); }); - it('formats the body of a plain text email', function () { - var formatedMail = $('
'); - formatedMail.html(viewHelper.formatMailBody(testData.parsedMail.simpleTextPlain)); - expect(formatedMail).toContainHtml('

Hello Everyone

'); + it('each line of plain text mail gets a new paragraph', function () { + var formattedMail = $('
'); + formattedMail.html(viewHelper.formatMailBody(testData.parsedMail.simpleTextPlain)); + expect(formattedMail).toContainHtml('

Hello Everyone

'); + }); + + + it('escape html in plain text body', function () { + var formattedMail = $('
'); + var mail = testData.parsedMail.simpleTextPlain; + mail.textPlainBody = 'This is some text!' + formattedMail.html(viewHelper.formatMailBody(mail)); + expect(formattedMail.text()).toBe('This is some text!') + }); it('move caret to the end of text after 1ms', function () { -- cgit v1.2.3