From ce303cec9c05e88de46a00125a03a2e50ad42dca Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Sat, 28 Aug 2010 20:16:21 +0000 Subject: [PATCH] --- .../wicket/jquery/AbstractJQueryBehaviorTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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"); -- 2.31.1