etherpad-lite/tests/frontend/specs/keystroke_urls_become_clickable.js

25 lines
782 B
JavaScript
Raw Normal View History

2012-10-06 23:38:17 +02:00
describe("urls", function(){
//create a new pad before each test run
beforeEach(function(cb){
helper.newPad(cb);
2012-11-02 00:19:59 +01:00
this.timeout(60000);
});
2012-10-06 23:38:17 +02:00
it("when you enter an url, it becomes clickable", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var firstTextElement = inner$("div").first();
// simulate key presses to delete content
firstTextElement.sendkeys('{selectall}'); // select all
firstTextElement.sendkeys('{del}'); // clear the first line
firstTextElement.sendkeys('http://etherpad.org'); // insert a URL
2012-10-08 19:42:52 +02:00
helper.waitFor(function(){
return inner$("div").first().find("a").length === 1;
}, 2000).done(done);
});
});