all.js 711 B

1234567891011121314151617181920212223242526
  1. module('Keyboard Navigation (All)', {
  2. setup: function(){
  3. this.input = $('<input type="text">')
  4. .appendTo('#qunit-fixture')
  5. .datetimepicker({format: "dd-mm-yyyy"})
  6. .focus(); // Activate for visibility checks
  7. this.dp = this.input.data('datetimepicker')
  8. this.picker = this.dp.picker;
  9. },
  10. teardown: function(){
  11. this.picker.remove();
  12. }
  13. });
  14. test('TAB hides picker', function(){
  15. var target;
  16. ok(this.picker.is(':visible'), 'Picker is visible');
  17. this.input.trigger({
  18. type: 'keydown',
  19. keyCode: 9
  20. });
  21. ok(this.picker.is(':not(:visible)'), 'Picker is hidden');
  22. });