WIP: Note editing, markdown to html
[oweals/karmaworld.git] / karmaworld / apps / wysihtml5 / static / wysihtml5 / wysihtml-0.4.17 / test / dom / has_element_with_tag_name_test.js
1 module("wysihtml5.dom.hasElementWithTagName", {
2   teardown: function() {
3     var iframe;
4     while (iframe = document.querySelector("iframe.wysihtml5-sandbox")) {
5       iframe.parentNode.removeChild(iframe);
6     }
7   }
8 });
9
10
11 asyncTest("Basic test", function() {
12   expect(3);
13   
14   new wysihtml5.dom.Sandbox(function(sandbox) {
15     var doc         = sandbox.getDocument(),
16         tempElement = doc.createElement("i");
17     ok(!wysihtml5.dom.hasElementWithTagName(doc, "I"));
18     doc.body.appendChild(tempElement);
19     ok(wysihtml5.dom.hasElementWithTagName(doc, "I"));
20     tempElement.parentNode.removeChild(tempElement);
21     ok(!wysihtml5.dom.hasElementWithTagName(doc, "I"));
22     
23     start();
24   }).insertInto(document.body);
25 });