mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
started button_indention test
This commit is contained in:
parent
6fefadee88
commit
0927b13f78
2 changed files with 44 additions and 6 deletions
|
@ -26,10 +26,7 @@
|
||||||
<script src="specs/font_type.js"></script>
|
<script src="specs/font_type.js"></script>
|
||||||
<script src="specs/embed_value.js"></script>
|
<script src="specs/embed_value.js"></script>
|
||||||
<script src="specs/keystroke_urls_become_clickable.js"></script>
|
<script src="specs/keystroke_urls_become_clickable.js"></script>
|
||||||
|
|
||||||
<!-- TODO: port to new test helper
|
|
||||||
<script src="specs/button_indentation.js"></script>
|
<script src="specs/button_indentation.js"></script>
|
||||||
-->
|
|
||||||
|
|
||||||
<script src="runner.js"></script>
|
<script src="runner.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,9 +1,50 @@
|
||||||
describe("indentation button", function(){
|
describe("indentation button", function(){
|
||||||
//create a new pad before each test run
|
//create a new pad before each test run
|
||||||
beforeEach(function(cb){
|
beforeEach(function(cb){
|
||||||
testHelper.newPad(cb);
|
helper.newPad(cb);
|
||||||
|
this.timeout(5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("indent text", function(done){
|
||||||
|
var inner$ = helper.padInner$;
|
||||||
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
|
var $indentButton = chrome$(".buttonicon-indent");
|
||||||
|
$indentButton.click();
|
||||||
|
|
||||||
|
helper.waitFor(function(){
|
||||||
|
return inner$("div").first().find("ul li").length === 1;
|
||||||
|
}).done(done);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("keeps the indent on enter for the new line", function(done){
|
||||||
|
var inner$ = helper.padInner$;
|
||||||
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
|
var $indentButton = chrome$(".buttonicon-indent");
|
||||||
|
$indentButton.click();
|
||||||
|
|
||||||
|
//type a bit, make a line break and type again
|
||||||
|
var $firstTextElement = inner$("div span").first();
|
||||||
|
$firstTextElement.sendkeys('line 1');
|
||||||
|
$firstTextElement.sendkeys('{enter}');
|
||||||
|
$firstTextElement.sendkeys('line 2');
|
||||||
|
$firstTextElement.sendkeys('{enter}');
|
||||||
|
|
||||||
|
helper.waitFor(function(){
|
||||||
|
return inner$("div span").first().text().indexOf("line 2") === -1;
|
||||||
|
}).done(function(){
|
||||||
|
var $newSecondLine = inner$("div").first().next();
|
||||||
|
var hasULElement = $newSecondLine.find("ul li").length === 1;
|
||||||
|
|
||||||
|
expect(hasULElement).to.be(true);
|
||||||
|
expect($newSecondLine.text()).to.be("line 2");
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
it("makes text indented and outdented", function() {
|
it("makes text indented and outdented", function() {
|
||||||
|
|
||||||
//get the inner iframe
|
//get the inner iframe
|
||||||
|
@ -94,7 +135,7 @@ describe("indentation button", function(){
|
||||||
/* this test creates the below content, both should have double indentation
|
/* this test creates the below content, both should have double indentation
|
||||||
line1
|
line1
|
||||||
line2
|
line2
|
||||||
*/
|
|
||||||
|
|
||||||
firstTextElement.sendkeys('{rightarrow}'); // simulate a keypress of enter
|
firstTextElement.sendkeys('{rightarrow}'); // simulate a keypress of enter
|
||||||
firstTextElement.sendkeys('{enter}'); // simulate a keypress of enter
|
firstTextElement.sendkeys('{enter}'); // simulate a keypress of enter
|
||||||
|
@ -134,5 +175,5 @@ describe("indentation button", function(){
|
||||||
//expect it to be part of a list
|
//expect it to be part of a list
|
||||||
expect(isLI).to.be(true);
|
expect(isLI).to.be(true);
|
||||||
},1000);
|
},1000);
|
||||||
});
|
});*/
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue