diff options
-rw-r--r-- | tests/unit/datepicker/datepicker_core.js | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/unit/datepicker/datepicker_core.js b/tests/unit/datepicker/datepicker_core.js index 8795b5a7e..cd1a64939 100644 --- a/tests/unit/datepicker/datepicker_core.js +++ b/tests/unit/datepicker/datepicker_core.js @@ -1,17 +1,24 @@ -/* - * datepicker_core.js - */ +(function( $ ) { -(function($) { - -module( "datepicker: core", { - setup: function() { - $( "body" ).focus(); - } -}); +module( "datepicker: core" ); TestHelpers.testJshint( "datepicker" ); +test( "input's value determines starting date", function() { + expect( 3 ); + + var input = $( "#datepicker" ).val( "1/1/2014" ).datepicker(), + picker = input.datepicker( "widget" ); + + input.datepicker( "open" ); + + equal( picker.find( ".ui-datepicker-month" ).html(), "January", "correct month displayed" ); + equal( picker.find( ".ui-datepicker-year" ).html(), "2014", "correct year displayed" ); + equal( picker.find( ".ui-state-focus" ).html(), "1", "correct day highlighted" ); + + input.val( "" ).datepicker( "destroy" ); +}); + asyncTest( "baseStructure", function() { expect( 42 ); var header, title, table, thead, week, panel, inl, child, @@ -485,4 +492,4 @@ test( "mouse", function() { "Mouse click inline - next" ); }); -})(jQuery); +})( jQuery ); |