(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 28 Aug 2010 20:16:21 +0000 (20:16 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 28 Aug 2010 20:16:21 +0000 (20:16 +0000)
wicket/components/src/test/java/org/wamblee/wicket/jquery/AbstractJQueryBehaviorTest.java

index 807effdd67ce9c9af658654129389d067b18a935..92fcf16e38e6da9563e8a242288613dcc8cc68d2 100644 (file)
@@ -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");