diff --git a/public/javascripts/jquery.instructure_date_and_time.js b/public/javascripts/jquery.instructure_date_and_time.js index d316fe3cdde..538496bb281 100644 --- a/public/javascripts/jquery.instructure_date_and_time.js +++ b/public/javascripts/jquery.instructure_date_and_time.js @@ -280,21 +280,18 @@ I18n.scoped('instructure', function(I18n) { var cur = $.datepicker._curInst; if(cur) { var val = $(this).val(); - $(this).val(val); cur.input.data('time-hour', val); } }).delegate(".ui-datepicker-time-minute", 'change keypress focus blur', function(event) { var cur = $.datepicker._curInst; if(cur) { var val = $(this).val(); - $(this).val(val); cur.input.data('time-minute', val); } }).delegate(".ui-datepicker-time-ampm", 'change keypress focus blur', function(event) { var cur = $.datepicker._curInst; if(cur) { var val = $(this).val(); - $(this).val(val); cur.input.data('time-ampm', val); } }); diff --git a/spec/selenium/jquery_ui_spec.rb b/spec/selenium/jquery_ui_spec.rb index c26a22a551d..34515b7b6e4 100644 --- a/spec/selenium/jquery_ui_spec.rb +++ b/spec/selenium/jquery_ui_spec.rb @@ -25,6 +25,27 @@ describe "jquery ui selenium tests" do driver.find_element(:css, ".ui-widget-overlay").should be_displayed end + context "calendar widget" do + it "should let you replace content by selecting and typing instead of appending" do + get "/courses/#{@course.id}/assignments" + + driver.find_element(:css, "a.add_assignment_link").click + wait_for_animations + driver.find_element(:css, ".ui-datepicker-trigger").click + wait_for_animations + driver.find_element(:css, ".ui-datepicker-time-hour").send_keys("12") + driver.find_element(:css, ".ui-datepicker-time-minute").send_keys("00") + driver.find_element(:css, ".ui-datepicker-ok").click + + driver.find_element(:css, ".ui-datepicker-trigger").click + wait_for_animations + + driver.execute_script("$('#ui-datepicker-time-hour').select();") + driver.find_element(:id, "ui-datepicker-time-hour").send_keys('5') + driver.find_element(:id, "ui-datepicker-time-hour").attribute('value').should == "5" + end + end + context "dialog titles" do # jquery ui doesn't escape dialog titles by default (even when inferred from