diff --git a/tests/frontend/specs/button_redo.js b/tests/frontend/specs/button_redo.js index 59991ebec..81fa42b6e 100644 --- a/tests/frontend/specs/button_redo.js +++ b/tests/frontend/specs/button_redo.js @@ -1,4 +1,4 @@ -describe("undo button", function(){ +describe("undo button then redo button", function(){ beforeEach(function(cb){ helper.newPad(cb); // creates a new pad this.timeout(5000); @@ -11,22 +11,24 @@ describe("undo button", function(){ // get the first text element inside the editable space var $firstTextElement = inner$("div span").first(); var originalValue = $firstTextElement.text(); // get the original value + var newString = "Foo"; - $firstTextElement.sendkeys("foo"); // send line 1 to the pad + $firstTextElement.sendkeys(newString); // send line 1 to the pad var modifiedValue = $firstTextElement.text(); // get the modified value expect(modifiedValue).not.to.be(originalValue); // expect the value to change - // get clear authorship button as a variable + // get undo and redo buttons var $undoButton = chrome$(".buttonicon-undo"); var $redoButton = chrome$(".buttonicon-redo"); // click the buttons - $undoButton.click(); - $redoButton.click(); + $undoButton.click(); // removes foo + $redoButton.click(); // resends foo helper.waitFor(function(){ - return inner$("div span").first().text() === originalValue; + console.log(inner$("div span").first().text()); + return inner$("div span").first().text() === newString; }).done(function(){ - var finalValue = inner$("div span").first().text(); + var finalValue = inner$("div").first().text(); expect(finalValue).to.be(modifiedValue); // expect the value to change done(); });