]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker: Fix flaky test
authorScott González <scott.gonzalez@gmail.com>
Tue, 9 Feb 2016 16:28:31 +0000 (11:28 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 9 Feb 2016 16:28:31 +0000 (11:28 -0500)
tests/unit/datepicker/options.js

index 794487f72ac029d8098ce72a16a303eedbfac08d..38c87730945f00d470977db825c8280f2341f4a2 100644 (file)
@@ -517,19 +517,19 @@ test( "minMax", function() {
        inp.datepicker( "setDate", "12/30/" + new Date().getFullYear() );
        ok( dp.find( ".ui-datepicker-next" ).hasClass( "ui-state-disabled" ), "Year Range Test - next button disabled at 12/30/maxYear" );
 
-       inp.datepicker( "option", {
+       inp.val( "" ).datepicker( "option", {
                minDate: new Date( 1900, 0, 1 ),
                maxDate: "-7Y",
                yearRange: "1900:-7"
-       } ).val( "" );
+       } );
        ok( dp.find( ".ui-datepicker-next" ).hasClass( "ui-state-disabled" ), "Year Range Test - relative - next button disabled" );
        ok( !dp.find( ".ui-datepicker-prev" ).hasClass( "ui-state-disabled" ), "Year Range Test - relative - prev button enabled" );
 
-       inp.datepicker( "option", {
+       inp.val( "" ).datepicker( "option", {
                minDate: new Date( 1900, 0, 1 ),
                maxDate: "1/25/2007",
                yearRange: "1900:2007"
-       } ).val( "" );
+       } );
        ok( dp.find( ".ui-datepicker-next" ).hasClass( "ui-state-disabled" ), "Year Range Test - absolute - next button disabled" );
        ok( !dp.find( ".ui-datepicker-prev" ).hasClass( "ui-state-disabled" ), "Year Range Test - absolute - prev button enabled" );
 } );