diff options
Diffstat (limited to 'tests/unit/calendar/helper.js')
-rw-r--r-- | tests/unit/calendar/helper.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/calendar/helper.js b/tests/unit/calendar/helper.js new file mode 100644 index 000000000..e1575e71b --- /dev/null +++ b/tests/unit/calendar/helper.js @@ -0,0 +1,27 @@ +define( [ + "jquery", + "lib/helper" +], function( $, helper ) { + +return $.extend( helper, { + createDate: function( year, month, day ) { + if ( arguments.length === 1 ) { + return new Date( year ); + } + + if ( arguments.length === 3 ) { + return new Date( year, month, day ); + } + + return new Date(); + }, + focusGrid: function( element ) { + element.find( ":tabbable" ).last().simulate( "focus" ); + $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB } ); + $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB } ); + + return $( document.activeElement ); + } +} ); + +} ); |