inline.js 771 B

12345678910111213141516171819202122232425262728
  1. module('Inline', {
  2. setup: function(){
  3. this.component = $('<div data-date="12-02-2012"></div>')
  4. .appendTo('#qunit-fixture')
  5. .datepicker({format: "dd-mm-yyyy"});
  6. this.dp = this.component.data('datepicker');
  7. this.picker = this.dp.picker;
  8. },
  9. teardown: function(){
  10. this.picker.remove();
  11. }
  12. });
  13. test('Picker gets date/viewDate from data-date attr', function(){
  14. datesEqual(this.dp.dates[0], UTCDate(2012, 1, 12));
  15. datesEqual(this.dp.viewDate, UTCDate(2012, 1, 12));
  16. });
  17. test('Visible after init', function(){
  18. ok(this.picker.is(':visible'));
  19. });
  20. test('update', function(){
  21. this.dp.update('13-03-2012');
  22. datesEqual(this.dp.dates[0], UTCDate(2012, 2, 13));
  23. });