From c7fb2cde1e30fc5fd055fa09f5bfc125d682bb34 Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Thu, 31 Mar 2011 21:27:41 +0000 Subject: [PATCH] add test for unwrap() method --- .../gwt/query/client/GQueryCoreTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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()); + + } } -- 2.39.5