]> source.dussan.org Git - gwtquery.git/commitdiff
Adding a test unit for issue97
authorManolo Carrasco <manolo@apache.org>
Thu, 25 Aug 2011 16:32:42 +0000 (16:32 +0000)
committerManolo Carrasco <manolo@apache.org>
Thu, 25 Aug 2011 16:32:42 +0000 (16:32 +0000)
gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTest.java

index 487af6f6619ad621f9a75f3cbfc1cb5a6b5a0407..7a308d17987b085e1b59b3a902184a5ba63e4ca4 100644 (file)
@@ -940,7 +940,16 @@ public class GQueryCoreTest extends GWTTestCase {
     assertEquals("check1", InputElement.as($("#text", e).get(0)).getValue());
 
   }
-
+  
+  public void testCheckedAttr_Issue97() {
+    $(e).html("<input type='checkbox' id='cb' name='cb' value='1' />");
+    assertEquals("", $("#cb").val());
+    $("#cb").attr("checked", "checked");
+    assertEquals("1", $("#cb").val());
+    $("#cb").removeAttr("checked");
+    assertEquals("", $("#cb").val());
+  }
+  
   public void testWidthHeight() {
     $(e).html(
         "<div style='border: 1px solid red; padding: 10px; margin:10px; width: 100px; height: 100px'>Content 1</div>");