From: erik Date: Sat, 28 Aug 2010 20:16:21 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.6~13 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=a18930d2c8e0888e327b1c2d5de73277d6433c70;p=utils --- diff --git a/wicket/components/src/test/java/org/wamblee/wicket/jquery/AbstractJQueryBehaviorTest.java b/wicket/components/src/test/java/org/wamblee/wicket/jquery/AbstractJQueryBehaviorTest.java index 807effdd..92fcf16e 100644 --- a/wicket/components/src/test/java/org/wamblee/wicket/jquery/AbstractJQueryBehaviorTest.java +++ b/wicket/components/src/test/java/org/wamblee/wicket/jquery/AbstractJQueryBehaviorTest.java @@ -18,10 +18,12 @@ package org.wamblee.wicket.jquery; import org.apache.wicket.Component; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.util.tester.TagTester; import org.apache.wicket.util.tester.WicketTester; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.wamblee.wicket.MyPage; import static junit.framework.TestCase.*; @@ -38,6 +40,19 @@ public class AbstractJQueryBehaviorTest { wicket.destroy(); } + @Test + public void testVerifyBasicFunc() { + MyPage page = new MyPage(); + page.getLabel().add(new AbstractJQueryBehavior("initfunc")); + wicket.startPage(page); + wicket.assertRenderedPage(MyPage.class); + TagTester tag = wicket.getTagByWicketId("label"); + assertNotNull(tag.getAttribute("id")); + String doc = wicket.getServletResponse().getDocument(); + assertTrue(doc.contains("jquery-noconflict")); + assertTrue(doc.contains("initfunc")); + } + @Test public void testCreateReadyJavascript() { Component component = new Label("label");