diff options
author | johnyma22 <john@mclear.co.uk> | 2012-10-05 00:38:07 +0100 |
---|---|---|
committer | johnyma22 <john@mclear.co.uk> | 2012-10-05 00:38:07 +0100 |
commit | ae25c085e03397c52b41946ade1100c6b41c07d5 (patch) | |
tree | f435a2e1ef35ea4a6ec58f71b2fb88c5b0daea5d /tests | |
parent | 9d7d973faa371df771e0243bdf5cefcfb26a2826 (diff) | |
download | etherpad-lite-ae25c085e03397c52b41946ade1100c6b41c07d5.zip |
a better way of geting href but note that it only works if we use settimeotu but settimeout breaks mocha so it's not okay. Peter please find a way of making sendkeys allow for callbacks, k tnx
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/specs/keystroke_urls_become_clickable.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/frontend/specs/keystroke_urls_become_clickable.js b/tests/frontend/specs/keystroke_urls_become_clickable.js index 87de3bae..0bc4d86c 100644 --- a/tests/frontend/specs/keystroke_urls_become_clickable.js +++ b/tests/frontend/specs/keystroke_urls_become_clickable.js @@ -14,16 +14,19 @@ describe("urls become clickable", function(){ // simulate key presses to delete content firstTextElement.sendkeys('{selectall}'); // select all firstTextElement.sendkeys('{del}'); // clear the first line - firstTextElement.sendkeys('http://etherpad.org'); // add a url to the pad + firstTextElement.sendkeys('http://etherpad.org'); // insert a URL + +// setTimeout(function(){ + //ace creates a new dom element when you press a keystroke, so just get the first text element again + var newFirstTextElement = $inner.find("div").first(); + var locatedHref = newFirstTextElement.find("a").contents().text(); + var isURL = locatedHref.indexOf("http://etherpad.org") != -1; // if we found a URL and it is for etherpad.org - //ace creates a new dom element when you press a keystroke, so just get the first text element again - var newFirstTextElement = $inner.find("div").first(); - - // is there a url class now? - var isURL = newFirstTextElement.find("href").length === 1; + console.log(isURL); //expect it to be bold expect(isURL).to.be(true); +// }, 1000); }); }); |