Skip to content
This repository
Browse code

add test for firing of dynamically-added onchange event on target ele…

…ment
  • Loading branch information...
commit c1f836a1c600b6047d61bcea8d1845c30d8788f2 1 parent 2be9ce5
authored December 15, 2010

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  js_test/functional/cds_test.html
11  js_test/functional/cds_test.html
@@ -21,6 +21,7 @@
21 21
 <div id="cds_test_div">
22 22
   <input type="text" id="cds_test" />
23 23
 </div>
  24
+<div id="cds_status"></div>
24 25
 
25 26
 <!-- Tests -->
26 27
 <script type="text/javascript" language="javascript">
@@ -357,6 +358,16 @@
357 358
       
358 359
       assertEqual(1, $$(".calendar_date_select").length);
359 360
       cds.close();
  361
+    }},
  362
+    test__dynamic_onchange_should_be_fired: function() {with (this) {
  363
+      Event.observe($('cds_test'), 'change', function()
  364
+      { $('cds_status').innerHTML='calendar input changed';
  365
+      });
  366
+      cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
  367
+      today_now = $$(".cds_buttons a[href=#]");
  368
+      today_now[0].onclick();
  369
+      assertMatch('calendar input changed', $('cds_status').innerHTML, "status div should indicate date changed");
  370
+      cds.close();
360 371
     }}
361 372
   });
362 373
 // ]]>

0 notes on commit c1f836a

Please sign in to comment.
Something went wrong with that request. Please try again.