mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
redo button
This commit is contained in:
parent
2db2683c98
commit
fbf509ce87
1 changed files with 35 additions and 0 deletions
35
tests/frontend/specs/button_redo.js
Normal file
35
tests/frontend/specs/button_redo.js
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
describe("undo button", function(){
|
||||||
|
beforeEach(function(cb){
|
||||||
|
helper.newPad(cb); // creates a new pad
|
||||||
|
this.timeout(5000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("undo some typing", function(done){
|
||||||
|
var inner$ = helper.padInner$;
|
||||||
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
|
// get the first text element inside the editable space
|
||||||
|
var $firstTextElement = inner$("div span").first();
|
||||||
|
var originalValue = $firstTextElement.text(); // get the original value
|
||||||
|
|
||||||
|
$firstTextElement.sendkeys("foo"); // 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
|
||||||
|
var $undoButton = chrome$(".buttonicon-undo");
|
||||||
|
var $redoButton = chrome$(".buttonicon-redo");
|
||||||
|
// click the buttons
|
||||||
|
$undoButton.click();
|
||||||
|
$redoButton.click();
|
||||||
|
|
||||||
|
helper.waitFor(function(){
|
||||||
|
return inner$("div span").first().text() === originalValue;
|
||||||
|
}).done(function(){
|
||||||
|
var finalValue = inner$("div span").first().text();
|
||||||
|
expect(finalValue).to.be(modifiedValue); // expect the value to change
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue