fix button redo spec
This commit is contained in:
parent
54f6ac451a
commit
72d40fcfd4
|
@ -1,4 +1,4 @@
|
||||||
describe("undo button", function(){
|
describe("undo button then redo button", function(){
|
||||||
beforeEach(function(cb){
|
beforeEach(function(cb){
|
||||||
helper.newPad(cb); // creates a new pad
|
helper.newPad(cb); // creates a new pad
|
||||||
this.timeout(5000);
|
this.timeout(5000);
|
||||||
|
@ -11,22 +11,24 @@ describe("undo button", function(){
|
||||||
// get the first text element inside the editable space
|
// get the first text element inside the editable space
|
||||||
var $firstTextElement = inner$("div span").first();
|
var $firstTextElement = inner$("div span").first();
|
||||||
var originalValue = $firstTextElement.text(); // get the original value
|
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
|
var modifiedValue = $firstTextElement.text(); // get the modified value
|
||||||
expect(modifiedValue).not.to.be(originalValue); // expect the value to change
|
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 $undoButton = chrome$(".buttonicon-undo");
|
||||||
var $redoButton = chrome$(".buttonicon-redo");
|
var $redoButton = chrome$(".buttonicon-redo");
|
||||||
// click the buttons
|
// click the buttons
|
||||||
$undoButton.click();
|
$undoButton.click(); // removes foo
|
||||||
$redoButton.click();
|
$redoButton.click(); // resends foo
|
||||||
|
|
||||||
helper.waitFor(function(){
|
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(){
|
}).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
|
expect(finalValue).to.be(modifiedValue); // expect the value to change
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue