Permalink
Browse files

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

…ment
  • Loading branch information...
1 parent 2be9ce5 commit c1f836a1c600b6047d61bcea8d1845c30d8788f2 Ethan committed Dec 15, 2010
Showing with 11 additions and 0 deletions.
  1. +11 −0 js_test/functional/cds_test.html
@@ -21,6 +21,7 @@
<div id="cds_test_div">
<input type="text" id="cds_test" />
</div>
+<div id="cds_status"></div>
<!-- Tests -->
<script type="text/javascript" language="javascript">
@@ -357,6 +358,16 @@
assertEqual(1, $$(".calendar_date_select").length);
cds.close();
+ }},
+ test__dynamic_onchange_should_be_fired: function() {with (this) {
+ Event.observe($('cds_test'), 'change', function()
+ { $('cds_status').innerHTML='calendar input changed';
+ });
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
+ today_now = $$(".cds_buttons a[href=#]");
+ today_now[0].onclick();
+ assertMatch('calendar input changed', $('cds_status').innerHTML, "status div should indicate date changed");
+ cds.close();
}}
});
// ]]>

0 comments on commit c1f836a

Please sign in to comment.