From cbca47d1c7d33858990d708e576327d0e7b33526 Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Mon, 27 Aug 2012 18:49:39 +0000 Subject: [PATCH] test for issue 149 --- .../query/client/GQuerySelectorsTestGwt.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTestGwt.java index 9d32fece..097dbc81 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTestGwt.java @@ -43,6 +43,19 @@ public class GQuerySelectorsTestGwt extends GWTTestCase { boolean runSlow = false; + protected interface ParentSelector extends Selectors { + @Selector("#parent") + GQuery parentSelector(); + + } + + protected interface ExtendedSelector extends ParentSelector { + + @Selector("#child") + GQuery childSelector(); + } + + protected interface AllSelectors extends Selectors { @Selector("h1[id]:contains(Selectors)") NodeList h1IdContainsSelectors(); @@ -183,6 +196,18 @@ public class GQuerySelectorsTestGwt extends GWTTestCase { } } + public void testInhiterance(){ + final ExtendedSelector selector = GWT.create(ExtendedSelector.class); + + $(e).html("
parent
child
"); + + assertEquals(1, selector.parentSelector().length()); + assertEquals(1, selector.childSelector().length()); + + assertEquals("parentchild", selector.parentSelector().text()); + assertEquals("child", selector.childSelector().text()); + } + public void testJQueryPseudoselectors() { $(e).html("
A Text

"); assertEquals(9, $("* ", e).size()); -- 2.39.5