From 2260b1fc6282589ecb90b8d530ced5c12e054071 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Nov 2012 17:52:10 +0000 Subject: [PATCH] Test for PR 1188 https://github.com/ether/etherpad-lite/pull/1188 --- .../specs/keystroke_urls_become_clickable.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/frontend/specs/keystroke_urls_become_clickable.js b/tests/frontend/specs/keystroke_urls_become_clickable.js index 2a46360e..8c72d748 100644 --- a/tests/frontend/specs/keystroke_urls_become_clickable.js +++ b/tests/frontend/specs/keystroke_urls_become_clickable.js @@ -21,4 +21,27 @@ describe("urls", function(){ return inner$("div").first().find("a").length === 1; }, 2000).done(done); }); + + it("when you enter a url containing a !, it becomes clickable and contains the whole URL", 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(); + var url = "http://etherpad.org/!foo"; + + // simulate key presses to delete content + firstTextElement.sendkeys('{selectall}'); // select all + firstTextElement.sendkeys('{del}'); // clear the first line + firstTextElement.sendkeys(url); // insert a URL + + helper.waitFor(function(){ + if(inner$("div").first().find("a").length === 1){ // if it contains an A link + if(inner$("div").first().find("a")[0].href === url){ + return true; + } + }; + }, 2000).done(done); + }); + });