methods_jquery.js 697 B

1234567891011121314151617181920212223242526
  1. module('Methods (jQuery)', {
  2. setup: function(){
  3. this.$inputs = $('<input><input>')
  4. .datepicker()
  5. .appendTo('#qunit-fixture');
  6. },
  7. teardown: function(){
  8. this.$inputs.each(function(){
  9. $.data(this, 'datepicker').picker.remove();
  10. });
  11. }
  12. });
  13. test('Methods', function(){
  14. [
  15. 'show',
  16. 'hide',
  17. 'setValue',
  18. 'place'
  19. ].forEach($.proxy(function(index, value){
  20. var returnedObject = this.$inputs.datepicker(value);
  21. strictEqual(returnedObject, this.$inputs, "is jQuery element");
  22. strictEqual(returnedObject.length, 2, "correct length of jQuery elements");
  23. }, this));
  24. });