Added test for #769
[jquery.git] / src / jquery / coreTest.js
index 98a1ba8..a793f17 100644 (file)
@@ -826,3 +826,29 @@ test("$().html().evalScripts() Eval's Scripts Twice in Firefox, see #975", funct
        expect(1);\r
        $("#main").html('<script type="text/javascript">ok( true, "execute script" );</script>').evalScripts();\r
 });\r
+\r
+test("$('<tag>') needs optional document parameter to ease cross-frame DOM wrangling, see #968", function() {\r
+       var f = frames["iframe"].document;\r
+    f.open();\r
+    f.write("<html><body></body></html>");\r
+    f.close();\r
+    $("<div>Testing</div>").appendTo(f.body);\r
+    ok( true, "passed" );\r
+});\r
+\r
+test("Checkbox's state is erased after wrap() action (IE 6), see #769", function() {\r
+       expect(3);\r
+       stop();\r
+       $('#check1').click(function() {         \r
+               var checkbox = this;            \r
+               ok( !checkbox.checked );\r
+               $(checkbox).wrap( '<div id="c1" style="display:none;"></div>' );\r
+               ok( !checkbox.checked );\r
+               // use a fade in to check state after this event handler has finished\r
+               $("#c1").fadeIn(function() {\r
+                       ok( checkbox.checked );\r
+                       start();\r
+               });\r
+       }).click();\r
+       \r
+});
\ No newline at end of file