From ff22ae9206acee99130fdc48aafb330ccf74f9d7 Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Thu, 4 Oct 2012 19:12:01 +0100 Subject: [PATCH] fix keystroke delete test --- tests/frontend/specs/keystroke_delete.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/frontend/specs/keystroke_delete.js b/tests/frontend/specs/keystroke_delete.js index 58a6b5bb..1d3faf66 100644 --- a/tests/frontend/specs/keystroke_delete.js +++ b/tests/frontend/specs/keystroke_delete.js @@ -12,11 +12,11 @@ describe("delete keystroke", function(){ var firstTextElement = $inner.find("div").first(); // get the original length of this element - var elementLength = firstTextElement.html().length; + var elementLength = firstTextElement.text().length; // get the original string value minus the last char var originalTextValue = firstTextElement.text(); - originalTextValue = originalTextValue.substring(0, originalTextValue.length -1); + originalTextValueMinusFirstChar = originalTextValue.substring(1, originalTextValue.length ); // simulate key presses to delete content firstTextElement.sendkeys('{leftarrow}'); // simulate a keypress of the left arrow key @@ -26,13 +26,13 @@ describe("delete keystroke", function(){ var newFirstTextElement = $inner.find("div").first(); // get the new length of this element - var newElementLength = newFirstTextElement.html().length; + var newElementLength = newFirstTextElement.text().length; //expect it to be one char less in length expect(newElementLength).to.be((elementLength-1)); //make sure the text has changed correctly - expect(newFirstTextElement.text()).to.eql(originalTextValue); + expect(newFirstTextElement.text()).to.eql(originalTextValueMinusFirstChar); }); });