Skip to content

Commit

Permalink
fix rest of firefox tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMcLear committed Mar 22, 2020
1 parent 5662287 commit 6a7bcfd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/frontend/specs/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);

var selection = inner$.document.getSelection();
// .replace is required here because Firefox keeps the line breaks. I'm not sure this is ideal behavior of getSelection where the text
// is not consistant between browsers but that's the situation so that's how I'm covering it in this test.
expect(cleanText(selection.toString().replace(/(\r\n|\n|\r)/gm,""))).to.be("ort lines to t");

done();
Expand All @@ -154,7 +156,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);

var selection = inner$.document.getSelection();
expect(cleanText(selection.toString())).to.be("ort lines to test");
expect(cleanText(selection.toString().replace(/(\r\n|\n|\r)/gm,""))).to.be("ort lines to test");

done();
});
Expand All @@ -172,7 +174,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);

var selection = inner$.document.getSelection();
expect(cleanText(selection.toString())).to.be("ort lines ");
expect(cleanText(selection.toString().replace(/(\r\n|\n|\r)/gm,""))).to.be("ort lines ");

done();
});
Expand All @@ -190,7 +192,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine, startOffset, endOffset);

var selection = inner$.document.getSelection();
expect(cleanText(selection.toString())).to.be("ort lines to test");
expect(cleanText(selection.toString().replace(/(\r\n|\n|\r)/gm,""))).to.be("ort lines to test");

done();
});
Expand All @@ -205,7 +207,7 @@ describe("the test helper", function(){
helper.selectLines($startLine, $endLine);

var selection = inner$.document.getSelection();
expect(cleanText(selection.toString())).to.be("short lines to test");
expect(cleanText(selection.toString().replace(/(\r\n|\n|\r)/gm,""))).to.be("short lines to test");

done();
});
Expand Down

0 comments on commit 6a7bcfd

Please sign in to comment.