2012-10-06 23:38:17 +02:00
|
|
|
describe("urls", function(){
|
2012-10-03 22:55:23 +02:00
|
|
|
//create a new pad before each test run
|
|
|
|
beforeEach(function(cb){
|
2012-10-06 21:45:46 +02:00
|
|
|
helper.newPad(cb);
|
2012-11-02 00:19:59 +01:00
|
|
|
this.timeout(60000);
|
2012-10-03 22:55:23 +02:00
|
|
|
});
|
|
|
|
|
2012-10-06 23:38:17 +02:00
|
|
|
it("when you enter an url, it becomes clickable", function(done) {
|
2012-10-08 00:34:29 +02:00
|
|
|
var inner$ = helper.padInner$;
|
|
|
|
var chrome$ = helper.padChrome$;
|
2012-10-03 22:55:23 +02:00
|
|
|
|
|
|
|
//get the first text element out of the inner iframe
|
2012-10-06 21:45:46 +02:00
|
|
|
var firstTextElement = inner$("div").first();
|
2012-10-03 22:55:23 +02:00
|
|
|
|
|
|
|
// simulate key presses to delete content
|
|
|
|
firstTextElement.sendkeys('{selectall}'); // select all
|
|
|
|
firstTextElement.sendkeys('{del}'); // clear the first line
|
2012-10-05 01:38:07 +02:00
|
|
|
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);
|
2012-10-03 22:55:23 +02:00
|
|
|
});
|
|
|
|
});
|