forceEventDuration.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. describe('forceEventDuration', function() {
  2. pushOptions({
  3. defaultDate: '2014-05-01',
  4. defaultView: 'month'
  5. })
  6. describe('when turned off', function() {
  7. pushOptions({
  8. forceEventDuration: false
  9. })
  10. it('allows a null end date for all-day and timed events', function() {
  11. initCalendar({
  12. events: [
  13. {
  14. id: '1',
  15. start: '2014-05-10'
  16. },
  17. {
  18. id: '2',
  19. start: '2014-05-10T14:00:00'
  20. }
  21. ]
  22. })
  23. var events = currentCalendar.clientEvents()
  24. expect(events[0].end).toBeNull()
  25. expect(events[1].end).toBeNull()
  26. })
  27. })
  28. describe('when turned on', function() {
  29. pushOptions({
  30. forceEventDuration: true
  31. })
  32. it('allows a null end date for all-day and timed events', function() {
  33. initCalendar({
  34. events: [
  35. {
  36. id: '1',
  37. start: '2014-05-10'
  38. },
  39. {
  40. id: '2',
  41. start: '2014-05-10T14:00:00'
  42. }
  43. ]
  44. })
  45. var events = currentCalendar.clientEvents()
  46. expect(events[0].id).toEqual('1')
  47. expect(moment.isMoment(events[0].end)).toEqual(true)
  48. expect(events[1].id).toEqual('2')
  49. expect(moment.isMoment(events[1].end)).toEqual(true)
  50. })
  51. })
  52. // NOTE: the actual verification of the correct calculation of the end
  53. // (using defaultTimedEventDuration and defaultAllDayEventDuration)
  54. // is done in those test files.
  55. })