summaryrefslogtreecommitdiff
path: root/tests/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'tests/frontend')
-rw-r--r--tests/frontend/specs/helper.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/frontend/specs/helper.js b/tests/frontend/specs/helper.js
index bb47f4dc..7270d479 100644
--- a/tests/frontend/specs/helper.js
+++ b/tests/frontend/specs/helper.js
@@ -101,16 +101,17 @@ describe("the test helper", function(){
// function to support tests, use a single way to represent whitespaces
var cleanText = function(text){
return text
- .replace(/\n/gi, "\\\\n") // avoid \n to be replaced by \s on next line
- .replace(/\s/gi, " ")
- .replace(/\\\\n/gi, "\n"); // move back \n to its original state
+ // IE replaces line breaks with a whitespace, so we need to unify its behavior
+ // for other browsers, to have all tests running for all browsers
+ .replace(/\n/gi, " ")
+ .replace(/\s/gi, " ");
}
before(function(done){
helper.newPad(function() {
// create some lines to be used on the tests
var $firstLine = helper.padInner$("div").first();
- $firstLine.sendkeys("{selectall}some{enter}short{enter}lines{enter}to test{enter}");
+ $firstLine.sendkeys("{selectall}some{enter}short{enter}lines{enter}to test{enter}{enter}");
// wait for lines to be split
helper.waitFor(function(){
@@ -135,7 +136,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);
var selection = inner$.document.getSelection();
- expect(cleanText(selection.toString())).to.be("ort \nlines \nto t");
+ expect(cleanText(selection.toString())).to.be("ort lines to t");
done();
});
@@ -153,7 +154,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);
var selection = inner$.document.getSelection();
- expect(cleanText(selection.toString())).to.be("ort \nlines \nto test\n");
+ expect(cleanText(selection.toString())).to.be("ort lines to test");
done();
});
@@ -171,7 +172,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);
var selection = inner$.document.getSelection();
- expect(cleanText(selection.toString())).to.be("ort \nlines \n");
+ expect(cleanText(selection.toString())).to.be("ort lines ");
done();
});
@@ -189,7 +190,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);
var selection = inner$.document.getSelection();
- expect(cleanText(selection.toString())).to.be("ort \nlines \nto test");
+ expect(cleanText(selection.toString())).to.be("ort lines to test");
done();
});
@@ -204,7 +205,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine);
var selection = inner$.document.getSelection();
- expect(cleanText(selection.toString())).to.be("short \nlines \nto test");
+ expect(cleanText(selection.toString())).to.be("short lines to test");
done();
});