From: Julien Dramaix Date: Thu, 31 Mar 2011 21:27:41 +0000 (+0000) Subject: add test for unwrap() method X-Git-Tag: release-1.3.2~441 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c7fb2cde1e30fc5fd055fa09f5bfc125d682bb34;p=gwtquery.git add test for unwrap() method --- diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTest.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTest.java index 0e9db738..55c78842 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTest.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTest.java @@ -1145,5 +1145,24 @@ public class GQueryCoreTest extends GWTTestCase { } + + public void testUnwrapMethod(){ + String html = "
child1
other child
child2
child3
"; + $(e).html(html); + + assertEquals(3, $(".parent", e).length()); + assertEquals(3, $(".child", e).length()); +System.err.println("before" +$(e)); + + $(".child",e).unwrap(); + System.err.println("after" +$(e)); + assertEquals(0, $(".parent",e).length()); + assertEquals(3, $(".child",e).length()); + + String expectedHtml = "
child1
other child
child2
child3
"; + + assertEquals(expectedHtml, $(e).html()); + + } }