Просмотр исходного кода

tons of lint autofixes for tests

Adam Shaw 8 лет назад
Родитель
Сommit
a581fdb126
100 измененных файлов с 6941 добавлено и 6968 удалено
  1. 9 9
      tests/event-data/EventObject-parsing.js
  2. 11 11
      tests/event-data/dynamic-options.js
  3. 8 8
      tests/event-data/eventDataTransform.js
  4. 42 42
      tests/event-data/events-function.js
  5. 45 45
      tests/event-data/lazyFetching.js
  6. 10 10
      tests/event-data/recurring.js
  7. 14 14
      tests/event-data/refetchEvents.js
  8. 123 124
      tests/event-data/updateEvent.js
  9. 5 5
      tests/event-drag/DayGridEventDragUtils.js
  10. 16 16
      tests/event-drag/EventDragUtils.js
  11. 6 6
      tests/event-drag/TimeGridEventDragUtils.js
  12. 23 23
      tests/event-drag/repeating.js
  13. 15 15
      tests/event-drag/showNonCurrentDates.js
  14. 17 17
      tests/event-drag/validRange.js
  15. 11 13
      tests/event-render/EventRenderUtils.js
  16. 79 82
      tests/event-render/TimeGridEventRenderUtils.js
  17. 9 9
      tests/event-render/maxTime.js
  18. 23 23
      tests/event-render/minSegmentHeight.js
  19. 9 9
      tests/event-render/minTime.js
  20. 7 7
      tests/event-render/timeText.js
  21. 18 18
      tests/event-render/validRange.js
  22. 4 4
      tests/event-resize/DayGridEventResizeUtils.js
  23. 18 18
      tests/event-resize/EventResizeUtils.js
  24. 9 9
      tests/event-resize/validRange.js
  25. 70 72
      tests/globals.js
  26. 4 4
      tests/index.js
  27. 84 86
      tests/jasmine-ext.js
  28. 20 20
      tests/legacy/Agenda-render.js
  29. 113 116
      tests/legacy/DayGrid-events.js
  30. 220 220
      tests/legacy/ListView.js
  31. 24 24
      tests/legacy/TimeGrid-events.js
  32. 12 12
      tests/legacy/View.js
  33. 36 36
      tests/legacy/addEventSource.js
  34. 30 30
      tests/legacy/agenda-view.js
  35. 56 56
      tests/legacy/allDayDefault.js
  36. 40 40
      tests/legacy/allDaySlot.js
  37. 53 53
      tests/legacy/allDayText.js
  38. 86 86
      tests/legacy/aspectRatio.js
  39. 373 373
      tests/legacy/background-events.js
  40. 27 27
      tests/legacy/basic-view.js
  41. 85 89
      tests/legacy/businessHours.js
  42. 39 39
      tests/legacy/buttonIcons.js
  43. 112 112
      tests/legacy/buttonText.js
  44. 189 189
      tests/legacy/columnHeaderFormat.js
  45. 388 388
      tests/legacy/constraint.js
  46. 40 40
      tests/legacy/constructor.js
  47. 181 182
      tests/legacy/current-date.js
  48. 36 36
      tests/legacy/custom-view-class.js
  49. 194 194
      tests/legacy/custom-view-duration.js
  50. 120 120
      tests/legacy/dayClick.js
  51. 42 42
      tests/legacy/dayNames.js
  52. 38 38
      tests/legacy/dayNamesShort.js
  53. 15 15
      tests/legacy/dayPopoverFormat.js
  54. 36 36
      tests/legacy/dayRender.js
  55. 36 36
      tests/legacy/defaultAllDayEventDuration.js
  56. 49 49
      tests/legacy/defaultTimedEventDuration.js
  57. 47 47
      tests/legacy/destroy.js
  58. 72 72
      tests/legacy/displayEventEnd.js
  59. 82 82
      tests/legacy/emitter.js
  60. 82 82
      tests/legacy/event-coloring.js
  61. 205 205
      tests/legacy/event-dnd.js
  62. 40 40
      tests/legacy/event-feed-param.js
  63. 72 72
      tests/legacy/event-obj.js
  64. 279 279
      tests/legacy/event-resize.js
  65. 29 29
      tests/legacy/eventAllow.js
  66. 20 20
      tests/legacy/eventClick.js
  67. 16 16
      tests/legacy/eventDestroy.js
  68. 164 164
      tests/legacy/eventLimit-popover.js
  69. 46 46
      tests/legacy/eventLimit-popoverDestroy.js
  70. 100 100
      tests/legacy/eventLimit.js
  71. 70 70
      tests/legacy/eventLimitClick.js
  72. 24 24
      tests/legacy/eventLimitText.js
  73. 15 15
      tests/legacy/eventMouseover.js
  74. 187 187
      tests/legacy/eventRender.js
  75. 29 29
      tests/legacy/eventRenderWait.js
  76. 20 20
      tests/legacy/events-array.js
  77. 100 101
      tests/legacy/events-function.js
  78. 248 249
      tests/legacy/events-gcal.js
  79. 80 80
      tests/legacy/events-json-feed.js
  80. 226 229
      tests/legacy/external-dnd-advanced.js
  81. 174 177
      tests/legacy/external-dnd.js
  82. 143 143
      tests/legacy/firstDay.js
  83. 20 20
      tests/legacy/fixedWeekCount.js
  84. 36 36
      tests/legacy/footer-navigation.js
  85. 16 16
      tests/legacy/footer-rendering.js
  86. 25 25
      tests/legacy/forceEventDuration.js
  87. 87 87
      tests/legacy/formatRange.js
  88. 37 38
      tests/legacy/getClientRect.js
  89. 9 9
      tests/legacy/getEventSourceById.js
  90. 9 9
      tests/legacy/getEventSources.js
  91. 34 35
      tests/legacy/getScrollbarWidths.js
  92. 1 1
      tests/legacy/handleWindowResize.js
  93. 36 36
      tests/legacy/header-navigation.js
  94. 81 81
      tests/legacy/header-rendering.js
  95. 290 289
      tests/legacy/height-and-contentHeight.js
  96. 52 52
      tests/legacy/hiddenDays.js
  97. 12 12
      tests/legacy/isRTL.js
  98. 40 40
      tests/legacy/locale.js
  99. 65 65
      tests/legacy/maxTime.js
  100. 142 142
      tests/legacy/moment-ambig.js

+ 9 - 9
tests/event-data/EventObject-parsing.js

@@ -8,11 +8,11 @@ describe('Event Object parsing', function() {
       events: [
       events: [
         { _id: 'a', start: '2017-09-05' }
         { _id: 'a', start: '2017-09-05' }
       ]
       ]
-    });
+    })
 
 
-    var events = currentCalendar.clientEvents();
-    expect(events[0]._id).toBe('a');
-  });
+    var events = currentCalendar.clientEvents()
+    expect(events[0]._id).toBe('a')
+  })
 
 
   it('leaves an existing date prop unparsed and untouched', function() {
   it('leaves an existing date prop unparsed and untouched', function() {
     initCalendar({
     initCalendar({
@@ -21,10 +21,10 @@ describe('Event Object parsing', function() {
       events: [
       events: [
         { date: '2017-09-05' }
         { date: '2017-09-05' }
       ]
       ]
-    });
+    })
 
 
-    var events = currentCalendar.clientEvents();
-    expect(events[0].date).toBe('2017-09-05');
-  });
+    var events = currentCalendar.clientEvents()
+    expect(events[0].date).toBe('2017-09-05')
+  })
 
 
-});
+})

+ 11 - 11
tests/event-data/dynamic-options.js

@@ -2,23 +2,23 @@
 describe('setting option dynamically', function() {
 describe('setting option dynamically', function() {
 
 
   it('does not cause refetch of events', function(done) {
   it('does not cause refetch of events', function(done) {
-    var fetchCnt = 0;
+    var fetchCnt = 0
 
 
     initCalendar({
     initCalendar({
       defaultView: 'month',
       defaultView: 'month',
       events: function(start, end, timezone, callback) {
       events: function(start, end, timezone, callback) {
-        fetchCnt++;
-        callback([]);
+        fetchCnt++
+        callback([])
       }
       }
-    });
+    })
 
 
-    expect(fetchCnt).toBe(1);
+    expect(fetchCnt).toBe(1)
 
 
-    currentCalendar.option('selectable', true);
+    currentCalendar.option('selectable', true)
 
 
     setTimeout(function() { // in case async
     setTimeout(function() { // in case async
-      expect(fetchCnt).toBe(1);
-      done();
-    }, 0);
-  });
-});
+      expect(fetchCnt).toBe(1)
+      done()
+    }, 0)
+  })
+})

+ 8 - 8
tests/event-data/eventDataTransform.js

@@ -3,8 +3,8 @@ describe('eventDataTransform', function() {
   var transform = function(raw) {
   var transform = function(raw) {
     return $.extend({}, raw, {
     return $.extend({}, raw, {
       was_processed: true
       was_processed: true
-    });
-  };
+    })
+  }
 
 
   describeOptions({
   describeOptions({
     'when on the calendar': {
     'when on the calendar': {
@@ -23,10 +23,10 @@ describe('eventDataTransform', function() {
     }
     }
   }, function() {
   }, function() {
     it('affects parsing of the event', function() {
     it('affects parsing of the event', function() {
-      initCalendar();
-      var eventObj = currentCalendar.clientEvents()[0];
-      expect(eventObj.was_processed).toBe(true);
-    });
-  });
+      initCalendar()
+      var eventObj = currentCalendar.clientEvents()[0]
+      expect(eventObj.was_processed).toBe(true)
+    })
+  })
 
 
-});
+})

+ 42 - 42
tests/event-data/events-function.js

@@ -8,12 +8,12 @@ describe('events as a function', function() {
       weekends: false,
       weekends: false,
       fixedWeekCount: false,
       fixedWeekCount: false,
       events: function(start, end, timezone, callback) {
       events: function(start, end, timezone, callback) {
-        expect(start).toEqualMoment('2013-06-03');
-        expect(end).toEqualMoment('2013-06-29');
-        done();
+        expect(start).toEqualMoment('2013-06-03')
+        expect(end).toEqualMoment('2013-06-29')
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('does not request dates excluded by showNonCurrentDates:false', function(done) {
   it('does not request dates excluded by showNonCurrentDates:false', function(done) {
     initCalendar({
     initCalendar({
@@ -21,12 +21,12 @@ describe('events as a function', function() {
       defaultDate: '2013-06-01',
       defaultDate: '2013-06-01',
       showNonCurrentDates: false,
       showNonCurrentDates: false,
       events: function(start, end, timezone, callback) {
       events: function(start, end, timezone, callback) {
-        expect(start).toEqualMoment('2013-06-01');
-        expect(end).toEqualMoment('2013-07-01');
-        done();
+        expect(start).toEqualMoment('2013-06-01')
+        expect(end).toEqualMoment('2013-07-01')
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('requests a timed range when minTime is negative', function(done) {
   it('requests a timed range when minTime is negative', function(done) {
     initCalendar({
     initCalendar({
@@ -34,12 +34,12 @@ describe('events as a function', function() {
       defaultDate: '2017-06-08',
       defaultDate: '2017-06-08',
       minTime: { hours: -2 },
       minTime: { hours: -2 },
       events: function(start, end, timezone, callback) {
       events: function(start, end, timezone, callback) {
-        expect(start).toEqualMoment('2017-06-03T22:00:00');
-        expect(end).toEqualMoment('2017-06-11T00:00:00');
-        done();
+        expect(start).toEqualMoment('2017-06-03T22:00:00')
+        expect(end).toEqualMoment('2017-06-11T00:00:00')
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('requests a timed range when maxTime exceeds 24 hours', function(done) {
   it('requests a timed range when maxTime exceeds 24 hours', function(done) {
     initCalendar({
     initCalendar({
@@ -47,57 +47,57 @@ describe('events as a function', function() {
       defaultDate: '2017-06-08',
       defaultDate: '2017-06-08',
       maxTime: '26:00',
       maxTime: '26:00',
       events: function(start, end, timezone, callback) {
       events: function(start, end, timezone, callback) {
-        expect(start).toEqualMoment('2017-06-04T00:00:00');
-        expect(end).toEqualMoment('2017-06-11T02:00:00');
-        done();
+        expect(start).toEqualMoment('2017-06-04T00:00:00')
+        expect(end).toEqualMoment('2017-06-11T02:00:00')
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('calls loading callback', function(done) {
   it('calls loading callback', function(done) {
-    var loadingCallArgs = [];
+    var loadingCallArgs = []
 
 
     initCalendar({
     initCalendar({
       loading: function(bool) {
       loading: function(bool) {
-        loadingCallArgs.push(bool);
+        loadingCallArgs.push(bool)
       },
       },
       events: function(start, end, timezone, callback) {
       events: function(start, end, timezone, callback) {
         setTimeout(function() {
         setTimeout(function() {
-          expect(loadingCallArgs).toEqual([ true ]);
-          callback([]);
+          expect(loadingCallArgs).toEqual([ true ])
+          callback([])
           setTimeout(function() {
           setTimeout(function() {
-            expect(loadingCallArgs).toEqual([ true, false ]);
-            done();
-          }, 0);
-        }, 0);
+            expect(loadingCallArgs).toEqual([ true, false ])
+            done()
+          }, 0)
+        }, 0)
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('calls loading callback only once for multiple sources', function(done) {
   it('calls loading callback only once for multiple sources', function(done) {
-    var loadingCallArgs = [];
+    var loadingCallArgs = []
 
 
     initCalendar({
     initCalendar({
       loading: function(bool) {
       loading: function(bool) {
-        loadingCallArgs.push(bool);
+        loadingCallArgs.push(bool)
       },
       },
       eventSources: [
       eventSources: [
         function(start, end, timezone, callback) {
         function(start, end, timezone, callback) {
           setTimeout(function() {
           setTimeout(function() {
-            callback([]);
-          }, 0);
+            callback([])
+          }, 0)
         },
         },
         function(start, end, timezone, callback) {
         function(start, end, timezone, callback) {
           setTimeout(function() {
           setTimeout(function() {
-            callback([]);
-          }, 10);
+            callback([])
+          }, 10)
         }
         }
       ]
       ]
-    });
+    })
 
 
     setTimeout(function() {
     setTimeout(function() {
-      expect(loadingCallArgs).toEqual([ true, false ]);
-      done();
-    }, 20);
-  });
-});
+      expect(loadingCallArgs).toEqual([ true, false ])
+      done()
+    }, 20)
+  })
+})

+ 45 - 45
tests/event-data/lazyFetching.js

@@ -3,76 +3,76 @@ describe('lazyFetching', function() {
   pushOptions({
   pushOptions({
     defaultView: 'month',
     defaultView: 'month',
     defaultDate: '2017-10-04'
     defaultDate: '2017-10-04'
-  });
+  })
 
 
   describe('when on', function() {
   describe('when on', function() {
     pushOptions({
     pushOptions({
       lazyFetching: true
       lazyFetching: true
-    });
+    })
 
 
     it('won\'t fetch weeks already queryied', function() {
     it('won\'t fetch weeks already queryied', function() {
-      var args;
+      var args
       var options = {
       var options = {
         events: function(start, end, timezone, callback) {
         events: function(start, end, timezone, callback) {
-          callback([]);
+          callback([])
         }
         }
-      };
-      spyOn(options, 'events');
+      }
+      spyOn(options, 'events')
 
 
-      initCalendar(options);
-      currentCalendar.changeView('agendaWeek');
-      currentCalendar.next();
-      currentCalendar.next();
-      currentCalendar.next();
+      initCalendar(options)
+      currentCalendar.changeView('agendaWeek')
+      currentCalendar.next()
+      currentCalendar.next()
+      currentCalendar.next()
 
 
-      expect(options.events.calls.count()).toBe(1);
+      expect(options.events.calls.count()).toBe(1)
 
 
-      args = options.events.calls.argsFor(0);
-      expect(args[0]).toEqualMoment('2017-10-01');
-      expect(args[1]).toEqualMoment('2017-11-12');
-    });
-  });
+      args = options.events.calls.argsFor(0)
+      expect(args[0]).toEqualMoment('2017-10-01')
+      expect(args[1]).toEqualMoment('2017-11-12')
+    })
+  })
 
 
   describe('when off', function() {
   describe('when off', function() {
     pushOptions({
     pushOptions({
       lazyFetching: false
       lazyFetching: false
-    });
+    })
 
 
     it('will fetch each new week range', function() {
     it('will fetch each new week range', function() {
       var options = {
       var options = {
         events: function(start, end, timezone, callback) {
         events: function(start, end, timezone, callback) {
-          callback([]);
+          callback([])
         }
         }
-      };
-      spyOn(options, 'events');
+      }
+      spyOn(options, 'events')
 
 
-      initCalendar(options);
-      currentCalendar.changeView('agendaWeek');
-      currentCalendar.next();
-      currentCalendar.next();
-      currentCalendar.next();
+      initCalendar(options)
+      currentCalendar.changeView('agendaWeek')
+      currentCalendar.next()
+      currentCalendar.next()
+      currentCalendar.next()
 
 
-      expect(options.events.calls.count()).toBe(5);
+      expect(options.events.calls.count()).toBe(5)
 
 
-      args = options.events.calls.argsFor(0);
-      expect(args[0]).toEqualMoment('2017-10-01');
-      expect(args[1]).toEqualMoment('2017-11-12');
+      args = options.events.calls.argsFor(0)
+      expect(args[0]).toEqualMoment('2017-10-01')
+      expect(args[1]).toEqualMoment('2017-11-12')
 
 
-      args = options.events.calls.argsFor(1);
-      expect(args[0]).toEqualMoment('2017-10-01T00:00:00');
-      expect(args[1]).toEqualMoment('2017-10-08T00:00:00');
+      args = options.events.calls.argsFor(1)
+      expect(args[0]).toEqualMoment('2017-10-01T00:00:00')
+      expect(args[1]).toEqualMoment('2017-10-08T00:00:00')
 
 
-      args = options.events.calls.argsFor(2);
-      expect(args[0]).toEqualMoment('2017-10-08T00:00:00');
-      expect(args[1]).toEqualMoment('2017-10-15T00:00:00');
+      args = options.events.calls.argsFor(2)
+      expect(args[0]).toEqualMoment('2017-10-08T00:00:00')
+      expect(args[1]).toEqualMoment('2017-10-15T00:00:00')
 
 
-      args = options.events.calls.argsFor(3);
-      expect(args[0]).toEqualMoment('2017-10-15T00:00:00');
-      expect(args[1]).toEqualMoment('2017-10-22T00:00:00');
+      args = options.events.calls.argsFor(3)
+      expect(args[0]).toEqualMoment('2017-10-15T00:00:00')
+      expect(args[1]).toEqualMoment('2017-10-22T00:00:00')
 
 
-      args = options.events.calls.argsFor(4);
-      expect(args[0]).toEqualMoment('2017-10-22T00:00:00');
-      expect(args[1]).toEqualMoment('2017-10-29T00:00:00');
-    });
-  });
-});
+      args = options.events.calls.argsFor(4)
+      expect(args[0]).toEqualMoment('2017-10-22T00:00:00')
+      expect(args[1]).toEqualMoment('2017-10-29T00:00:00')
+    })
+  })
+})

+ 10 - 10
tests/event-data/recurring.js

@@ -9,27 +9,27 @@ describe('recurring events', function() {
       events: [
       events: [
         { start: '09:00', end: '11:00', dow: [ 2, 4 ] }
         { start: '09:00', end: '11:00', dow: [ 2, 4 ] }
       ]
       ]
-    });
+    })
 
 
     it('expands events with local time', function() {
     it('expands events with local time', function() {
-      initCalendar();
+      initCalendar()
 
 
-      var events = currentCalendar.clientEvents();
+      var events = currentCalendar.clientEvents()
 
 
       expect(events[0].start.format()).toBe(
       expect(events[0].start.format()).toBe(
         moment('2017-07-04T09:00:00').format() // local
         moment('2017-07-04T09:00:00').format() // local
-      );
+      )
       expect(events[0].end.format()).toBe(
       expect(events[0].end.format()).toBe(
         moment('2017-07-04T11:00:00').format() // local
         moment('2017-07-04T11:00:00').format() // local
-      );
+      )
 
 
       expect(events[1].start.format()).toBe(
       expect(events[1].start.format()).toBe(
         moment('2017-07-06T09:00:00').format() // local
         moment('2017-07-06T09:00:00').format() // local
-      );
+      )
       expect(events[1].end.format()).toBe(
       expect(events[1].end.format()).toBe(
         moment('2017-07-06T11:00:00').format() // local
         moment('2017-07-06T11:00:00').format() // local
-      );
-    });
-  });
+      )
+    })
+  })
 
 
-});
+})

+ 14 - 14
tests/event-data/refetchEvents.js

@@ -2,9 +2,9 @@
 describe('refetchEvents', function() {
 describe('refetchEvents', function() {
 
 
   it('retains scroll when in month view', function() {
   it('retains scroll when in month view', function() {
-    var el = $('<div id="calendar" style="width:300px"/>').appendTo('body');
-    var scrollEl;
-    var scrollTop;
+    var el = $('<div id="calendar" style="width:300px"/>').appendTo('body')
+    var scrollEl
+    var scrollTop
 
 
     initCalendar({
     initCalendar({
       defaultView: 'month',
       defaultView: 'month',
@@ -19,19 +19,19 @@ describe('refetchEvents', function() {
         { start: '2017-04-04', title: 'event' },
         { start: '2017-04-04', title: 'event' },
         { start: '2017-04-04', title: 'event' }
         { start: '2017-04-04', title: 'event' }
       ]
       ]
-    }, el);
+    }, el)
 
 
-    expect($('.fc-event').length).toBe(8);
+    expect($('.fc-event').length).toBe(8)
 
 
-    scrollEl = el.find('.fc-scroller');
-    scrollEl.scrollTop(1000);
-    scrollTop = scrollEl.scrollTop();
+    scrollEl = el.find('.fc-scroller')
+    scrollEl.scrollTop(1000)
+    scrollTop = scrollEl.scrollTop()
 
 
     // verify that we queried the correct scroller el
     // verify that we queried the correct scroller el
-    expect(scrollTop).toBeGreaterThan(10);
+    expect(scrollTop).toBeGreaterThan(10)
 
 
-    currentCalendar.refetchEvents();
-    expect($('.fc-event').length).toBe(8);
-    expect(scrollEl.scrollTop()).toBe(scrollTop);
-  });
-});
+    currentCalendar.refetchEvents()
+    expect($('.fc-event').length).toBe(8)
+    expect(scrollEl.scrollTop()).toBe(scrollTop)
+  })
+})

+ 123 - 124
tests/event-data/updateEvent.js

@@ -8,70 +8,69 @@ describe('updateEvent', function() {
       events: [
       events: [
         { id: '2', start: '2017-07-14', end: '2017-07-19' }
         { id: '2', start: '2017-07-14', end: '2017-07-19' }
       ]
       ]
-    });
+    })
 
 
     it('reflects the ID change on the event object', function(done) {
     it('reflects the ID change on the event object', function(done) {
-      var allRenderCnt = 0;
+      var allRenderCnt = 0
 
 
       initCalendar({
       initCalendar({
         eventAfterAllRender: function() {
         eventAfterAllRender: function() {
-          var eventObjs;
-          var eventObj;
+          var eventObjs
+          var eventObj
 
 
-          allRenderCnt++;
+          allRenderCnt++
 
 
           if (allRenderCnt === 1) {
           if (allRenderCnt === 1) {
-            eventObjs = currentCalendar.clientEvents();
-            expect(eventObjs.length).toBe(1);
+            eventObjs = currentCalendar.clientEvents()
+            expect(eventObjs.length).toBe(1)
 
 
-            eventObj = eventObjs[0];
-            eventObj.id = '3';
-            currentCalendar.updateEvent(eventObj);
+            eventObj = eventObjs[0]
+            eventObj.id = '3'
+            currentCalendar.updateEvent(eventObj)
 
 
-            eventObjs = currentCalendar.clientEvents();
-            expect(eventObjs.length).toBe(1);
-            eventObj = eventObjs[0];
-            expect(eventObj.id).toBe('3');
+            eventObjs = currentCalendar.clientEvents()
+            expect(eventObjs.length).toBe(1)
+            eventObj = eventObjs[0]
+            expect(eventObj.id).toBe('3')
 
 
-            done();
+            done()
           }
           }
         }
         }
-      });
-    });
+      })
+    })
 
 
     it('reflects the ID change during event rendering', function(done) {
     it('reflects the ID change during event rendering', function(done) {
-      var allRenderCnt = 0;
-      var renderCnt = 0;
+      var allRenderCnt = 0
+      var renderCnt = 0
 
 
       initCalendar({
       initCalendar({
         eventRender: function(eventObj) {
         eventRender: function(eventObj) {
           if (allRenderCnt === 1) {
           if (allRenderCnt === 1) {
-            expect(eventObj.id).toBe('3');
-            renderCnt++;
+            expect(eventObj.id).toBe('3')
+            renderCnt++
           }
           }
         },
         },
         eventAfterAllRender: function() {
         eventAfterAllRender: function() {
-          var eventObjs;
-          var eventObj;
+          var eventObjs
+          var eventObj
 
 
-          allRenderCnt++;
+          allRenderCnt++
 
 
           if (allRenderCnt === 1) {
           if (allRenderCnt === 1) {
-            eventObjs = currentCalendar.clientEvents();
-            expect(eventObjs.length).toBe(1);
-
-            eventObj = eventObjs[0];
-            eventObj.id = '3';
-            currentCalendar.updateEvent(eventObj);
-          }
-          else if (allRenderCnt === 2) {
-            expect(renderCnt).toBe(2);
-            done();
+            eventObjs = currentCalendar.clientEvents()
+            expect(eventObjs.length).toBe(1)
+
+            eventObj = eventObjs[0]
+            eventObj.id = '3'
+            currentCalendar.updateEvent(eventObj)
+          } else if (allRenderCnt === 2) {
+            expect(renderCnt).toBe(2)
+            done()
           }
           }
         }
         }
-      });
-    });
-  });
+      })
+    })
+  })
 
 
   describe('when changing an event from timed to all-day', function() {
   describe('when changing an event from timed to all-day', function() {
     pushOptions({
     pushOptions({
@@ -80,44 +79,44 @@ describe('updateEvent', function() {
       events: [
       events: [
         { id: '2', start: '2017-07-14T08:00:00Z', end: '2017-07-14T12:00:00Z' }
         { id: '2', start: '2017-07-14T08:00:00Z', end: '2017-07-14T12:00:00Z' }
       ]
       ]
-    });
+    })
 
 
     it('reflects the change on the event object', function(done) {
     it('reflects the change on the event object', function(done) {
-      var allRenderCnt = 0;
+      var allRenderCnt = 0
 
 
       initCalendar({
       initCalendar({
         eventAfterAllRender: function() {
         eventAfterAllRender: function() {
-          var eventObj;
+          var eventObj
 
 
-          allRenderCnt++;
+          allRenderCnt++
 
 
           if (allRenderCnt === 1) {
           if (allRenderCnt === 1) {
-            eventObj = currentCalendar.clientEvents('2')[0];
+            eventObj = currentCalendar.clientEvents('2')[0]
 
 
-            expect(eventObj.allDay).toBe(false);
+            expect(eventObj.allDay).toBe(false)
 
 
-            eventObj.allDay = true;
-            eventObj.start = '2017-07-14';
-            eventObj.end = '2017-07-15';
-            currentCalendar.updateEvent(eventObj);
+            eventObj.allDay = true
+            eventObj.start = '2017-07-14'
+            eventObj.end = '2017-07-15'
+            currentCalendar.updateEvent(eventObj)
 
 
-            eventObj = currentCalendar.clientEvents('2')[0];
+            eventObj = currentCalendar.clientEvents('2')[0]
 
 
-            expect(eventObj.allDay).toBe(true);
-            expect(eventObj.start.format()).toBe('2017-07-14');
-            expect(eventObj.end.format()).toBe('2017-07-15');
+            expect(eventObj.allDay).toBe(true)
+            expect(eventObj.start.format()).toBe('2017-07-14')
+            expect(eventObj.end.format()).toBe('2017-07-15')
 
 
-            done();
+            done()
           }
           }
         }
         }
-      });
-    });
-  });
+      })
+    })
+  })
 
 
   describe('when changing an event from all-day to timed', function() {
   describe('when changing an event from all-day to timed', function() {
 
 
     it('accepts all new properties as-is', function() {
     it('accepts all new properties as-is', function() {
-      var event;
+      var event
 
 
       initCalendar({
       initCalendar({
         defaultView: 'month',
         defaultView: 'month',
@@ -128,76 +127,76 @@ describe('updateEvent', function() {
             start: '2016-04-29'
             start: '2016-04-29'
           }
           }
         ]
         ]
-      });
+      })
 
 
-      event = currentCalendar.clientEvents()[0];
+      event = currentCalendar.clientEvents()[0]
 
 
-      event.allDay = false;
-      event.start = '2016-04-29T12:00:00'; // 12 noon
-      event.end = '2016-04-29T14:00:00'; // 2pm
-      currentCalendar.updateEvent(event);
+      event.allDay = false
+      event.start = '2016-04-29T12:00:00' // 12 noon
+      event.end = '2016-04-29T14:00:00' // 2pm
+      currentCalendar.updateEvent(event)
 
 
-      event = currentCalendar.clientEvents()[0];
-      expect(event.allDay).toBe(false);
-      expect(moment.isMoment(event.start)).toBe(true);
-      expect(moment.isMoment(event.end)).toBe(true);
-      expect(event.start).toEqualMoment('2016-04-29T12:00:00');
-      expect(event.end).toEqualMoment('2016-04-29T14:00:00');
-    });
-  });
+      event = currentCalendar.clientEvents()[0]
+      expect(event.allDay).toBe(false)
+      expect(moment.isMoment(event.start)).toBe(true)
+      expect(moment.isMoment(event.end)).toBe(true)
+      expect(event.start).toEqualMoment('2016-04-29T12:00:00')
+      expect(event.end).toEqualMoment('2016-04-29T14:00:00')
+    })
+  })
 
 
   describe('when adding a new misc object property', function() {
   describe('when adding a new misc object property', function() {
 
 
     it('accepts the new property', function() {
     it('accepts the new property', function() {
-      var event;
+      var event
 
 
       initCalendar({
       initCalendar({
         now: '2017-10-05',
         now: '2017-10-05',
         events: [
         events: [
           { title: 'event 0', start: '2017-10-05' }
           { title: 'event 0', start: '2017-10-05' }
         ]
         ]
-      });
+      })
 
 
-      event = currentCalendar.clientEvents()[0];
-      event.user = { fname: 'Adam' };
-      currentCalendar.updateEvent(event);
+      event = currentCalendar.clientEvents()[0]
+      event.user = { fname: 'Adam' }
+      currentCalendar.updateEvent(event)
 
 
-      event = currentCalendar.clientEvents()[0];
-      expect(typeof event.user).toBe('object');
-      expect(event.user.fname).toBe('Adam');
+      event = currentCalendar.clientEvents()[0]
+      expect(typeof event.user).toBe('object')
+      expect(event.user.fname).toBe('Adam')
     })
     })
-  });
+  })
 
 
   describe('when modifying an existing misc object property', function() {
   describe('when modifying an existing misc object property', function() {
 
 
     it('accepts the new property', function() {
     it('accepts the new property', function() {
-      var event;
+      var event
 
 
       initCalendar({
       initCalendar({
         now: '2017-10-05',
         now: '2017-10-05',
         events: [
         events: [
           { title: 'event 0', start: '2017-10-05', user: { fname: 'Adam' } }
           { title: 'event 0', start: '2017-10-05', user: { fname: 'Adam' } }
         ]
         ]
-      });
+      })
 
 
-      event = currentCalendar.clientEvents()[0];
-      expect(typeof event.user).toBe('object');
-      expect(event.user.fname).toBe('Adam');
+      event = currentCalendar.clientEvents()[0]
+      expect(typeof event.user).toBe('object')
+      expect(event.user.fname).toBe('Adam')
 
 
-      event.user = { fname: 'John' };
-      currentCalendar.updateEvent(event);
+      event.user = { fname: 'John' }
+      currentCalendar.updateEvent(event)
 
 
-      event = currentCalendar.clientEvents()[0];
-      expect(typeof event.user).toBe('object');
-      expect(event.user.fname).toBe('John');
+      event = currentCalendar.clientEvents()[0]
+      expect(typeof event.user).toBe('object')
+      expect(event.user.fname).toBe('John')
     })
     })
-  });
+  })
 
 
   describe('with className', function() {
   describe('with className', function() {
 
 
     describe('when not modified', function() {
     describe('when not modified', function() {
       it('maintains classNames for individual event defs', function() {
       it('maintains classNames for individual event defs', function() {
-        var eventA, eventB;
+        var eventA, eventB
 
 
         initCalendar({
         initCalendar({
           now: '2017-10-05',
           now: '2017-10-05',
@@ -205,33 +204,33 @@ describe('updateEvent', function() {
             { id: '1', title: 'event1', start: '2017-10-05', otherId: 'a', customProp: 'asdf', className: 'myclassA' },
             { id: '1', title: 'event1', start: '2017-10-05', otherId: 'a', customProp: 'asdf', className: 'myclassA' },
             { id: '1', title: 'event1', start: '2017-10-12', otherId: 'b', customProp: 'asdf', className: 'myclassB' }
             { id: '1', title: 'event1', start: '2017-10-12', otherId: 'b', customProp: 'asdf', className: 'myclassB' }
           ]
           ]
-        });
+        })
 
 
         eventA = currentCalendar.clientEvents(function(eventDef) {
         eventA = currentCalendar.clientEvents(function(eventDef) {
-          return eventDef.otherId === 'a';
-        })[0];
+          return eventDef.otherId === 'a'
+        })[0]
 
 
-        eventA.customProp = 'qwer';
-        currentCalendar.updateEvent(eventA);
+        eventA.customProp = 'qwer'
+        currentCalendar.updateEvent(eventA)
 
 
         eventA = currentCalendar.clientEvents(function(eventDef) {
         eventA = currentCalendar.clientEvents(function(eventDef) {
-          return eventDef.otherId === 'a';
-        })[0];
+          return eventDef.otherId === 'a'
+        })[0]
 
 
         eventB = currentCalendar.clientEvents(function(eventDef) {
         eventB = currentCalendar.clientEvents(function(eventDef) {
-          return eventDef.otherId === 'b';
-        })[0];
-
-        expect(eventA.customProp).toBe('qwer');
-        expect(eventA.className).toEqual([ 'myclassA' ]);
-        expect(eventB.customProp).toBe('qwer');
-        expect(eventB.className).toEqual([ 'myclassB' ]);
-      });
-    });
+          return eventDef.otherId === 'b'
+        })[0]
+
+        expect(eventA.customProp).toBe('qwer')
+        expect(eventA.className).toEqual([ 'myclassA' ])
+        expect(eventB.customProp).toBe('qwer')
+        expect(eventB.className).toEqual([ 'myclassB' ])
+      })
+    })
 
 
     describe('when modified', function() {
     describe('when modified', function() {
       it('changes classNames for all similar event defs', function() {
       it('changes classNames for all similar event defs', function() {
-        var eventA, eventB;
+        var eventA, eventB
 
 
         initCalendar({
         initCalendar({
           now: '2017-10-05',
           now: '2017-10-05',
@@ -239,26 +238,26 @@ describe('updateEvent', function() {
             { id: '1', title: 'event1', start: '2017-10-05', otherId: 'a', className: 'myclassA' },
             { id: '1', title: 'event1', start: '2017-10-05', otherId: 'a', className: 'myclassA' },
             { id: '1', title: 'event1', start: '2017-10-12', otherId: 'b', className: 'myclassB' }
             { id: '1', title: 'event1', start: '2017-10-12', otherId: 'b', className: 'myclassB' }
           ]
           ]
-        });
+        })
 
 
         eventA = currentCalendar.clientEvents(function(eventDef) {
         eventA = currentCalendar.clientEvents(function(eventDef) {
-          return eventDef.otherId === 'a';
-        })[0];
+          return eventDef.otherId === 'a'
+        })[0]
 
 
-        eventA.className = [ 'otherClass' ];
-        currentCalendar.updateEvent(eventA);
+        eventA.className = [ 'otherClass' ]
+        currentCalendar.updateEvent(eventA)
 
 
         eventA = currentCalendar.clientEvents(function(eventDef) {
         eventA = currentCalendar.clientEvents(function(eventDef) {
-          return eventDef.otherId === 'a';
-        })[0];
+          return eventDef.otherId === 'a'
+        })[0]
 
 
         eventB = currentCalendar.clientEvents(function(eventDef) {
         eventB = currentCalendar.clientEvents(function(eventDef) {
-          return eventDef.otherId === 'b';
-        })[0];
-
-        expect(eventA.className).toEqual([ 'otherClass' ]);
-        expect(eventB.className).toEqual([ 'otherClass' ]);
-      });
-    });
-  });
-});
+          return eventDef.otherId === 'b'
+        })[0]
+
+        expect(eventA.className).toEqual([ 'otherClass' ])
+        expect(eventB.className).toEqual([ 'otherClass' ])
+      })
+    })
+  })
+})

+ 5 - 5
tests/event-drag/DayGridEventDragUtils.js

@@ -1,14 +1,14 @@
-import * as EventDragUtils from './EventDragUtils';
-import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils';
+import * as EventDragUtils from './EventDragUtils'
+import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils'
 
 
 
 
 export function drag(startDate, endDate, debug) {
 export function drag(startDate, endDate, debug) {
-  var el0 = DayGridRenderUtils.getSingleDayEl(startDate);
-  var el1 = DayGridRenderUtils.getSingleDayEl(endDate);
+  var el0 = DayGridRenderUtils.getSingleDayEl(startDate)
+  var el1 = DayGridRenderUtils.getSingleDayEl(endDate)
 
 
   return EventDragUtils.drag(
   return EventDragUtils.drag(
     el0[0].getBoundingClientRect(),
     el0[0].getBoundingClientRect(),
     el1[0].getBoundingClientRect(),
     el1[0].getBoundingClientRect(),
     debug
     debug
-  );
+  )
 }
 }

+ 16 - 16
tests/event-drag/EventDragUtils.js

@@ -1,5 +1,5 @@
-import { getRectCenter, intersectRects } from '../lib/geom';
-import * as EventRenderUtils from '../event-render/EventRenderUtils';
+import { getRectCenter, intersectRects } from '../lib/geom'
+import * as EventRenderUtils from '../event-render/EventRenderUtils'
 
 
 /*
 /*
 TODO: Don't rely on legacy simulateDrag
 TODO: Don't rely on legacy simulateDrag
@@ -7,37 +7,37 @@ Given the rectangles of the origin and destination
 slot or day area.
 slot or day area.
 */
 */
 export function drag(rect0, rect1, debug) {
 export function drag(rect0, rect1, debug) {
-  var el = EventRenderUtils.getSingleEl();
-  var elRect = el[0].getBoundingClientRect();
+  var el = EventRenderUtils.getSingleEl()
+  var elRect = el[0].getBoundingClientRect()
   var point0 = getRectCenter(
   var point0 = getRectCenter(
     intersectRects(elRect, rect0)
     intersectRects(elRect, rect0)
-  );
-  var point1 = getRectCenter(rect1);
-  var deferred = $.Deferred();
+  )
+  var point1 = getRectCenter(rect1)
+  var deferred = $.Deferred()
 
 
   el.simulate('drag', {
   el.simulate('drag', {
     point: point0,
     point: point0,
     end: point1,
     end: point1,
     debug: debug
     debug: debug
-  });
+  })
 
 
   currentCalendar.on('eventDragStop', function() {
   currentCalendar.on('eventDragStop', function() {
     setTimeout(function() {
     setTimeout(function() {
-      deferred.resolve({ isSuccess: false }); // won't do anything if already eventDrop
-    }, 200);  // will happen after eventDrop's timeout
-  });
+      deferred.resolve({ isSuccess: false }) // won't do anything if already eventDrop
+    }, 200) // will happen after eventDrop's timeout
+  })
 
 
   currentCalendar.on('eventDrop', function(event) { // always called after eventDragStop, if success
   currentCalendar.on('eventDrop', function(event) { // always called after eventDragStop, if success
     setTimeout(function() {
     setTimeout(function() {
-      deferred.resolve({ isSuccess: true, event: event });
-    }, 100); // will happen first
-  });
+      deferred.resolve({ isSuccess: true, event: event })
+    }, 100) // will happen first
+  })
 
 
-  return deferred.promise();
+  return deferred.promise()
 }
 }
 
 
 // makes the setTimeout's work.
 // makes the setTimeout's work.
 // also makes the tests faster.
 // also makes the tests faster.
 pushOptions({
 pushOptions({
   dragRevertDuration: 0
   dragRevertDuration: 0
-});
+})

+ 6 - 6
tests/event-drag/TimeGridEventDragUtils.js

@@ -1,24 +1,24 @@
-import * as EventDragUtils from './EventDragUtils';
+import * as EventDragUtils from './EventDragUtils'
 import { computeSpanRects } from '../event-render/TimeGridEventRenderUtils'
 import { computeSpanRects } from '../event-render/TimeGridEventRenderUtils'
 
 
 
 
 export function drag(startDate, endDate, debug) {
 export function drag(startDate, endDate, debug) {
 
 
-  startDate = $.fullCalendar.moment.parseZone(startDate);
-  endDate = $.fullCalendar.moment.parseZone(endDate);
+  startDate = $.fullCalendar.moment.parseZone(startDate)
+  endDate = $.fullCalendar.moment.parseZone(endDate)
 
 
   var startRect = computeSpanRects(
   var startRect = computeSpanRects(
     startDate,
     startDate,
     startDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
     startDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
-  )[0];
+  )[0]
   var endRect = computeSpanRects(
   var endRect = computeSpanRects(
     endDate,
     endDate,
     endDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
     endDate.clone().add({ minutes: 30 }) // hardcoded 30 minute slot :(
-  )[0];
+  )[0]
 
 
   return EventDragUtils.drag(
   return EventDragUtils.drag(
     startRect,
     startRect,
     endRect,
     endRect,
     debug
     debug
-  );
+  )
 }
 }

+ 23 - 23
tests/event-drag/repeating.js

@@ -1,5 +1,5 @@
-import * as EventDragUtils from './EventDragUtils';
-import * as TimeGridEventDragUtils from './TimeGridEventDragUtils';
+import * as EventDragUtils from './EventDragUtils'
+import * as TimeGridEventDragUtils from './TimeGridEventDragUtils'
 
 
 describe('event dragging on repeating events', function() {
 describe('event dragging on repeating events', function() {
   pushOptions({
   pushOptions({
@@ -18,22 +18,22 @@ describe('event dragging on repeating events', function() {
         start: '2017-02-16T16:00:00'
         start: '2017-02-16T16:00:00'
       }
       }
     ]
     ]
-  });
+  })
 
 
   // bug where offscreen instance of a repeating event was being incorrectly dragged
   // bug where offscreen instance of a repeating event was being incorrectly dragged
   pit('drags correct instance of event', function() {
   pit('drags correct instance of event', function() {
 
 
-    initCalendar();
+    initCalendar()
 
 
     // event range needs out large (month) then scope down (agendaWeek)
     // event range needs out large (month) then scope down (agendaWeek)
     // so that the new view receives out-of-range events.
     // so that the new view receives out-of-range events.
-    currentCalendar.changeView('agendaWeek');
+    currentCalendar.changeView('agendaWeek')
 
 
     return TimeGridEventDragUtils.drag('2017-02-16T16:00:00', '2017-02-16T12:00:00')
     return TimeGridEventDragUtils.drag('2017-02-16T16:00:00', '2017-02-16T12:00:00')
       .then(function(res) {
       .then(function(res) {
-        expect(res.isSuccess).toBe(true);
-      });
-  });
+        expect(res.isSuccess).toBe(true)
+      })
+  })
 
 
   it('hides other repeating events when dragging', function(done) {
   it('hides other repeating events when dragging', function(done) {
 
 
@@ -42,23 +42,23 @@ describe('event dragging on repeating events', function() {
         setTimeout(function() { // try go execute DURING the drag
         setTimeout(function() { // try go execute DURING the drag
           expect(
           expect(
             $('.fc-event:visible').filter(function(i, node) {
             $('.fc-event:visible').filter(function(i, node) {
-              return $(node).css('visibility') !== 'hidden';
+              return $(node).css('visibility') !== 'hidden'
             }).length
             }).length
-          ).toBe(1);
-        }, 0);
+          ).toBe(1)
+        }, 0)
       },
       },
       eventDrop: function() {
       eventDrop: function() {
         setTimeout(function() {
         setTimeout(function() {
-          done();
+          done()
         }, 10)
         }, 10)
       }
       }
-    });
+    })
 
 
     $('.fc-event:first').simulate('drag', {
     $('.fc-event:first').simulate('drag', {
       dx: 100,
       dx: 100,
       duration: 100 // ample time for separate eventDragStart/eventDrop
       duration: 100 // ample time for separate eventDragStart/eventDrop
-    });
-  });
+    })
+  })
 
 
   // inverse of above test
   // inverse of above test
   it('doesnt accidentally hide all non-id events when dragging', function(done) {
   it('doesnt accidentally hide all non-id events when dragging', function(done) {
@@ -78,22 +78,22 @@ describe('event dragging on repeating events', function() {
         setTimeout(function() { // try go execute DURING the drag
         setTimeout(function() { // try go execute DURING the drag
           expect(
           expect(
             $('.fc-event:visible').filter(function(i, node) {
             $('.fc-event:visible').filter(function(i, node) {
-              return $(node).css('visibility') !== 'hidden';
+              return $(node).css('visibility') !== 'hidden'
             }).length
             }).length
-          ).toBe(2); // the dragging event AND the other regular event
-        }, 0);
+          ).toBe(2) // the dragging event AND the other regular event
+        }, 0)
       },
       },
       eventDrop: function() {
       eventDrop: function() {
         setTimeout(function() {
         setTimeout(function() {
-          done();
+          done()
         }, 10)
         }, 10)
       }
       }
-    });
+    })
 
 
     $('.fc-event:first').simulate('drag', {
     $('.fc-event:first').simulate('drag', {
       dx: 100,
       dx: 100,
       duration: 100 // ample time for separate eventDragStart/eventDrop
       duration: 100 // ample time for separate eventDragStart/eventDrop
-    });
-  });
+    })
+  })
 
 
-});
+})

+ 15 - 15
tests/event-drag/showNonCurrentDates.js

@@ -1,6 +1,6 @@
-import * as EventDragUtils from './EventDragUtils';
-import * as DayGridEventDragUtils from './DayGridEventDragUtils';
-import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils';
+import * as EventDragUtils from './EventDragUtils'
+import * as DayGridEventDragUtils from './DayGridEventDragUtils'
+import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils'
 
 
 describe('showNonCurrentDates event dragging', function() {
 describe('showNonCurrentDates event dragging', function() {
   pushOptions({
   pushOptions({
@@ -11,27 +11,27 @@ describe('showNonCurrentDates event dragging', function() {
       { start: '2017-06-07', end: '2017-06-10' }
       { start: '2017-06-07', end: '2017-06-10' }
     ],
     ],
     editable: true
     editable: true
-  });
+  })
 
 
   describe('when dragging pointer into disabled region', function() {
   describe('when dragging pointer into disabled region', function() {
     pit('won\'t allow the drop', function() {
     pit('won\'t allow the drop', function() {
-      initCalendar();
+      initCalendar()
       return EventDragUtils.drag(
       return EventDragUtils.drag(
         DayGridRenderUtils.getSingleDayEl('2017-06-08')[0].getBoundingClientRect(),
         DayGridRenderUtils.getSingleDayEl('2017-06-08')[0].getBoundingClientRect(),
         DayGridRenderUtils.getDisabledEl(3)[0].getBoundingClientRect() // the cell before Jun 1
         DayGridRenderUtils.getDisabledEl(3)[0].getBoundingClientRect() // the cell before Jun 1
       ).then(function(res) {
       ).then(function(res) {
-        expect(res.isSuccess).toBe(false);
-      });
-    });
-  });
+        expect(res.isSuccess).toBe(false)
+      })
+    })
+  })
 
 
   describe('when dragging an event\'s start into a disabled region', function() {
   describe('when dragging an event\'s start into a disabled region', function() {
     pit('allow the drop if the cursor stays over non-disabled cells', function() {
     pit('allow the drop if the cursor stays over non-disabled cells', function() {
-      initCalendar();
+      initCalendar()
       return DayGridEventDragUtils.drag('2017-06-08', '2017-06-01')
       return DayGridEventDragUtils.drag('2017-06-08', '2017-06-01')
         .then(function(res) {
         .then(function(res) {
-          expect(res.isSuccess).toBe(true);
-        });
-    });
-  });
-});
+          expect(res.isSuccess).toBe(true)
+        })
+    })
+  })
+})

+ 17 - 17
tests/event-drag/validRange.js

@@ -1,5 +1,5 @@
-import * as EventDragUtils from './EventDragUtils';
-import * as DayGridEventDragUtils from './DayGridEventDragUtils';
+import * as EventDragUtils from './EventDragUtils'
+import * as DayGridEventDragUtils from './DayGridEventDragUtils'
 
 
 
 
 describe('validRange event dragging', function() {
 describe('validRange event dragging', function() {
@@ -15,17 +15,17 @@ describe('validRange event dragging', function() {
           { start: '2017-06-07', end: '2017-06-10' }
           { start: '2017-06-07', end: '2017-06-10' }
         ],
         ],
         editable: true
         editable: true
-      });
+      })
 
 
       pit('won\'t go before validRange', function() {
       pit('won\'t go before validRange', function() {
-        initCalendar();
+        initCalendar()
         return DayGridEventDragUtils.drag('2017-06-08', '2017-06-06')
         return DayGridEventDragUtils.drag('2017-06-08', '2017-06-06')
           .then(function(res) {
           .then(function(res) {
-            expect(res.isSuccess).toBe(false);
-          });
-      });
-    });
-  });
+            expect(res.isSuccess).toBe(false)
+          })
+      })
+    })
+  })
 
 
   describe('when end constraint', function() {
   describe('when end constraint', function() {
 
 
@@ -38,15 +38,15 @@ describe('validRange event dragging', function() {
           { start: '2017-06-04', end: '2017-06-07' }
           { start: '2017-06-04', end: '2017-06-07' }
         ],
         ],
         editable: true
         editable: true
-      });
+      })
 
 
       pit('won\'t go after validRange', function() {
       pit('won\'t go after validRange', function() {
-        initCalendar();
+        initCalendar()
         return DayGridEventDragUtils.drag('2017-06-05', '2017-06-08')
         return DayGridEventDragUtils.drag('2017-06-05', '2017-06-08')
           .then(function(res) {
           .then(function(res) {
-            expect(res.isSuccess).toBe(false);
-          });
-      });
-    });
-  });
-});
+            expect(res.isSuccess).toBe(false)
+          })
+      })
+    })
+  })
+})

+ 11 - 13
tests/event-render/EventRenderUtils.js

@@ -1,28 +1,26 @@
 
 
 export function expectIsStart(bool) {
 export function expectIsStart(bool) {
-  var el = getSingleEl();
+  var el = getSingleEl()
 
 
   if (bool) {
   if (bool) {
-    expect(el).toHaveClass('fc-start');
-  }
-  else {
-    expect(el).not.toHaveClass('fc-start');
+    expect(el).toHaveClass('fc-start')
+  } else {
+    expect(el).not.toHaveClass('fc-start')
   }
   }
 }
 }
 
 
 export function expectIsEnd(bool) {
 export function expectIsEnd(bool) {
-  var el = getSingleEl();
+  var el = getSingleEl()
 
 
   if (bool) {
   if (bool) {
-    expect(el).toHaveClass('fc-end');
-  }
-  else {
-    expect(el).not.toHaveClass('fc-end');
+    expect(el).toHaveClass('fc-end')
+  } else {
+    expect(el).not.toHaveClass('fc-end')
   }
   }
 }
 }
 
 
 export function getSingleEl() {
 export function getSingleEl() {
-  var els = $('.fc-event');
-  expect(els).toHaveLength(1);
-  return els;
+  var els = $('.fc-event')
+  expect(els).toHaveLength(1)
+  return els
 }
 }

+ 79 - 82
tests/event-render/TimeGridEventRenderUtils.js

@@ -1,8 +1,8 @@
 
 
 export function getTimeTexts() {
 export function getTimeTexts() {
   return $('.fc-event').map(function(i, eventEl) {
   return $('.fc-event').map(function(i, eventEl) {
-    return $(eventEl).find('.fc-time').text();
-  }).get();
+    return $(eventEl).find('.fc-time').text()
+  }).get()
 }
 }
 
 
 
 
@@ -12,35 +12,35 @@ TODO: check isStart/isEnd.
 */
 */
 export function checkEventRendering(start, end) {
 export function checkEventRendering(start, end) {
 
 
-  start = $.fullCalendar.moment.parseZone(start);
-  end = $.fullCalendar.moment.parseZone(end);
+  start = $.fullCalendar.moment.parseZone(start)
+  end = $.fullCalendar.moment.parseZone(end)
 
 
-  var expectedRects = computeSpanRects(start, end);
-  var eventEls = $('.fc-event'); // sorted by DOM order. not good for RTL
-  var isMatch = checkEventRenderingMatch(expectedRects, eventEls);
+  var expectedRects = computeSpanRects(start, end)
+  var eventEls = $('.fc-event') // sorted by DOM order. not good for RTL
+  var isMatch = checkEventRenderingMatch(expectedRects, eventEls)
 
 
   return {
   return {
     rects: expectedRects,
     rects: expectedRects,
     els: eventEls,
     els: eventEls,
     length: eventEls.length,
     length: eventEls.length,
     isMatch: isMatch
     isMatch: isMatch
-  };
+  }
 }
 }
 
 
 
 
 function checkEventRenderingMatch(expectedRects, eventEls) {
 function checkEventRenderingMatch(expectedRects, eventEls) {
-  var expectedLength = expectedRects.length;
-  var i, expectedRect;
-  var elRect;
+  var expectedLength = expectedRects.length
+  var i, expectedRect
+  var elRect
 
 
   if (eventEls.length != expectedLength) {
   if (eventEls.length != expectedLength) {
-    console.log('does not match element count');
-    return false;
+    console.log('does not match element count')
+    return false
   }
   }
 
 
   for (i = 0; i < expectedLength; i++) {
   for (i = 0; i < expectedLength; i++) {
-    expectedRect = expectedRects[i];
-    elRect = eventEls[i].getBoundingClientRect();
+    expectedRect = expectedRects[i]
+    elRect = eventEls[i].getBoundingClientRect()
 
 
     // horizontally contained AND vertically really similar?
     // horizontally contained AND vertically really similar?
     if (!(
     if (!(
@@ -49,50 +49,49 @@ function checkEventRenderingMatch(expectedRects, eventEls) {
       Math.abs(elRect.top - expectedRect.top) < 1 &&
       Math.abs(elRect.top - expectedRect.top) < 1 &&
       Math.abs(elRect.bottom - expectedRect.bottom) < 1
       Math.abs(elRect.bottom - expectedRect.bottom) < 1
     )) {
     )) {
-      console.log('rects do not match');
-      return false;
+      console.log('rects do not match')
+      return false
     }
     }
   }
   }
 
 
-  return true;
+  return true
 }
 }
 
 
 
 
 export function computeSpanRects(start, end) {
 export function computeSpanRects(start, end) {
-  var dayStructs = computeDays();
-  var slotStructs = computeSlots();
-  var dayI, dayStruct;
-  var slotI, slotStruct;
-  var coverage;
-  var startTop = null;
-  var endTop = null;
-  var rects = [];
+  var dayStructs = computeDays()
+  var slotStructs = computeSlots()
+  var dayI, dayStruct
+  var slotI, slotStruct
+  var coverage
+  var startTop = null
+  var endTop = null
+  var rects = []
 
 
   for (dayI = 0; dayI < dayStructs.length; dayI++) {
   for (dayI = 0; dayI < dayStructs.length; dayI++) {
-    dayStruct = dayStructs[dayI];
+    dayStruct = dayStructs[dayI]
 
 
     for (slotI = 0; slotI < slotStructs.length; slotI++) {
     for (slotI = 0; slotI < slotStructs.length; slotI++) {
-      slotStruct = slotStructs[slotI];
+      slotStruct = slotStructs[slotI]
 
 
       slotStart = dayStruct.date.clone().time(0)
       slotStart = dayStruct.date.clone().time(0)
         .add(slotStruct.dayOffset, 'days')
         .add(slotStruct.dayOffset, 'days')
-        .add(slotStruct.startTime);
+        .add(slotStruct.startTime)
 
 
       slotEnd = dayStruct.date.clone().time(0)
       slotEnd = dayStruct.date.clone().time(0)
         .add(slotStruct.dayOffset, 'days')
         .add(slotStruct.dayOffset, 'days')
-        .add(slotStruct.endTime);
+        .add(slotStruct.endTime)
 
 
       if (startTop === null) { // looking for the start
       if (startTop === null) { // looking for the start
-        coverage = (start - slotStart) / (slotEnd - slotStart);
-        startTop = (coverage > 0 && coverage <= 1) ?
-          (slotStruct.top + slotStruct.height * coverage) :
-          null;
-      }
-      else { // looking for the end
-        coverage = (end - slotStart) / (slotEnd - slotStart);
-        endTop = (coverage >= 0 && coverage < 1) ? // exclusive
-          (slotStruct.top + slotStruct.height * coverage) :
-          null;
+        coverage = (start - slotStart) / (slotEnd - slotStart)
+        startTop = (coverage > 0 && coverage <= 1)
+          ? (slotStruct.top + slotStruct.height * coverage)
+          : null
+      } else { // looking for the end
+        coverage = (end - slotStart) / (slotEnd - slotStart)
+        endTop = (coverage >= 0 && coverage < 1) // exclusive
+          ? (slotStruct.top + slotStruct.height * coverage)
+          : null
 
 
         if (endTop !== null) { // found end
         if (endTop !== null) { // found end
           rects.push({
           rects.push({
@@ -102,8 +101,8 @@ export function computeSpanRects(start, end) {
             bottom: endTop,
             bottom: endTop,
             width: dayStruct.right - dayStruct.left,
             width: dayStruct.right - dayStruct.left,
             height: endTop - startTop
             height: endTop - startTop
-          });
-          startTop = null;
+          })
+          startTop = null
         }
         }
       }
       }
     }
     }
@@ -116,98 +115,96 @@ export function computeSpanRects(start, end) {
         bottom: slotStruct.bottom,
         bottom: slotStruct.bottom,
         width: dayStruct.right - dayStruct.left,
         width: dayStruct.right - dayStruct.left,
         height: slotStruct.bottom - startTop
         height: slotStruct.bottom - startTop
-      });
-      startTop = slotStructs[0].top; // top of next column
+      })
+      startTop = slotStructs[0].top // top of next column
     }
     }
   }
   }
 
 
-  return rects;
+  return rects
 }
 }
 
 
 
 
 function computeDays() {
 function computeDays() {
-  var dayEls = $('.fc-day-header[data-date]');
+  var dayEls = $('.fc-day-header[data-date]')
 
 
   var days = dayEls.map(function(i, node) {
   var days = dayEls.map(function(i, node) {
-    var rect = node.getBoundingClientRect();
+    var rect = node.getBoundingClientRect()
     return $.extend({}, rect, {
     return $.extend({}, rect, {
       date: $.fullCalendar.moment.parseZone(
       date: $.fullCalendar.moment.parseZone(
         $(node).data('date')
         $(node).data('date')
       )
       )
-    });
-  }).get();
+    })
+  }).get()
 
 
-  return days;
+  return days
 }
 }
 
 
 
 
 function computeSlots() {
 function computeSlots() {
-  var slotEls = $('.fc-time-grid .fc-slats tr[data-time]');
+  var slotEls = $('.fc-time-grid .fc-slats tr[data-time]')
 
 
   var slots = slotEls.map(function(i, node) {
   var slots = slotEls.map(function(i, node) {
-    var rect = node.getBoundingClientRect();
+    var rect = node.getBoundingClientRect()
     return $.extend({}, rect, {
     return $.extend({}, rect, {
       startTime: moment.duration(
       startTime: moment.duration(
         $(node).data('time')
         $(node).data('time')
       )
       )
-    });
-  }).get();
+    })
+  }).get()
 
 
-  var len = slots.length;
+  var len = slots.length
   if (len < 3) {
   if (len < 3) {
-    console.log('need at least 3 slots');
-    return [];
+    console.log('need at least 3 slots')
+    return []
   }
   }
 
 
-  var mid = Math.floor(len / 2);
-  var i = mid - 1;
-  var standardMs = slots[mid + 1].startTime - slots[mid].startTime;
-  var ms;
-  var dayOffset = 0;
+  var mid = Math.floor(len / 2)
+  var i = mid - 1
+  var standardMs = slots[mid + 1].startTime - slots[mid].startTime
+  var ms
+  var dayOffset = 0
 
 
   // iterate from one-before middle to beginning
   // iterate from one-before middle to beginning
   for (i = mid - 1; i >= 0; i--) {
   for (i = mid - 1; i >= 0; i--) {
-    ms = slots[i + 1].startTime - slots[i].startTime;
+    ms = slots[i + 1].startTime - slots[i].startTime
 
 
     // big deviation? assume moved to previous day (b/c of special minTime)
     // big deviation? assume moved to previous day (b/c of special minTime)
     if (Math.abs(ms - standardMs) > standardMs * 2) {
     if (Math.abs(ms - standardMs) > standardMs * 2) {
-      dayOffset--;
-      slots[i].endTime = moment.duration(slots[i].startTime).add(standardMs);
-    }
-    else { // otherwise, current slot's end is next slot's beginning
-      slots[i].endTime = moment.duration(slots[i + 1].startTime);
+      dayOffset--
+      slots[i].endTime = moment.duration(slots[i].startTime).add(standardMs)
+    } else { // otherwise, current slot's end is next slot's beginning
+      slots[i].endTime = moment.duration(slots[i + 1].startTime)
     }
     }
 
 
-    slots[i].dayOffset = dayOffset;
+    slots[i].dayOffset = dayOffset
   }
   }
 
 
-  dayOffset = 0;
+  dayOffset = 0
 
 
   // iterate from middle to one-before last
   // iterate from middle to one-before last
   for (i = mid; i < len - 1; i++) {
   for (i = mid; i < len - 1; i++) {
-    ms = slots[i + 1].startTime - slots[i].startTime;
+    ms = slots[i + 1].startTime - slots[i].startTime
 
 
-    slots[i].dayOffset = dayOffset;
+    slots[i].dayOffset = dayOffset
 
 
     // big deviation? assume moved to next day (b/c of special maxTime)
     // big deviation? assume moved to next day (b/c of special maxTime)
     if (Math.abs(ms - standardMs) > standardMs * 2) {
     if (Math.abs(ms - standardMs) > standardMs * 2) {
-      dayOffset++; // will apply to the next slotStruct
-      slots[i].endTime = moment.duration(slots[i].startTime).add(standardMs);
-    }
-    else { // otherwise, current slot's end is next slot's beginning
-      slots[i].endTime = moment.duration(slots[i + 1].startTime);
+      dayOffset++ // will apply to the next slotStruct
+      slots[i].endTime = moment.duration(slots[i].startTime).add(standardMs)
+    } else { // otherwise, current slot's end is next slot's beginning
+      slots[i].endTime = moment.duration(slots[i + 1].startTime)
     }
     }
   }
   }
 
 
   // assume last slot has the standard duration
   // assume last slot has the standard duration
-  slots[i].endTime = moment.duration(slots[i].startTime).add(standardMs);
-  slots[i].dayOffset = dayOffset;
+  slots[i].endTime = moment.duration(slots[i].startTime).add(standardMs)
+  slots[i].dayOffset = dayOffset
 
 
   // if last slot went over the day threshold
   // if last slot went over the day threshold
   if (slots[i].endTime.as('days') > 1) {
   if (slots[i].endTime.as('days') > 1) {
-    slots[i].endTime.subtract(1, 'day');
-    slots[i].dayOffset++;
+    slots[i].endTime.subtract(1, 'day')
+    slots[i].dayOffset++
   }
   }
 
 
-  return slots;
+  return slots
 }
 }

+ 9 - 9
tests/event-render/maxTime.js

@@ -1,4 +1,4 @@
-import { checkEventRendering } from './TimeGridEventRenderUtils';
+import { checkEventRendering } from './TimeGridEventRenderUtils'
 
 
 describe('event rendering with maxTime', function() {
 describe('event rendering with maxTime', function() {
   pushOptions({
   pushOptions({
@@ -13,16 +13,16 @@ describe('event rendering with maxTime', function() {
       events: [
       events: [
         { start: '2017-03-22T00:00:00', end: '2017-03-22T02:00:00' }
         { start: '2017-03-22T00:00:00', end: '2017-03-22T02:00:00' }
       ]
       ]
-    });
+    })
 
 
     it('renders two event elements in the correct places', function() {
     it('renders two event elements in the correct places', function() {
-      initCalendar();
+      initCalendar()
       var res = checkEventRendering(
       var res = checkEventRendering(
         '2017-03-22T00:00:00',
         '2017-03-22T00:00:00',
         '2017-03-22T02:00:00'
         '2017-03-22T02:00:00'
-      );
-      expect(res.length).toBe(2);
-      expect(res.isMatch).toBe(true);
-    });
-  });
-});
+      )
+      expect(res.length).toBe(2)
+      expect(res.isMatch).toBe(true)
+    })
+  })
+})

+ 23 - 23
tests/event-render/minSegmentHeight.js

@@ -1,26 +1,26 @@
-import * as EventRenderUtils from './EventRenderUtils';
+import * as EventRenderUtils from './EventRenderUtils'
 
 
 describe('short event rendering with agendaEventMinHeight', function() {
 describe('short event rendering with agendaEventMinHeight', function() {
   pushOptions({
   pushOptions({
     defaultView: 'agendaWeek',
     defaultView: 'agendaWeek',
     defaultDate: '2017-08-10',
     defaultDate: '2017-08-10',
     agendaEventMinHeight: 25
     agendaEventMinHeight: 25
-  });
+  })
 
 
   describe('we we have an isolated short event', function() {
   describe('we we have an isolated short event', function() {
     pushOptions({
     pushOptions({
       events: [
       events: [
         { start: '2017-08-10T10:30:00', end: '2017-08-10T10:31:00' }
         { start: '2017-08-10T10:30:00', end: '2017-08-10T10:31:00' }
       ]
       ]
-    });
+    })
 
 
     it('renders the event having full width and the agendaEventMinHeight height value', function() {
     it('renders the event having full width and the agendaEventMinHeight height value', function() {
-      initCalendar();
-      var el = EventRenderUtils.getSingleEl();
+      initCalendar()
+      var el = EventRenderUtils.getSingleEl()
 
 
-      expect(el.outerHeight()).toEqual(25);
-    });
-  });
+      expect(el.outerHeight()).toEqual(25)
+    })
+  })
 
 
   describe('we we have two short events close to each other', function() {
   describe('we we have two short events close to each other', function() {
     pushOptions({
     pushOptions({
@@ -28,25 +28,25 @@ describe('short event rendering with agendaEventMinHeight', function() {
         { start: '2017-08-10T10:30:00', end: '2017-08-10T10:31:00' },
         { start: '2017-08-10T10:30:00', end: '2017-08-10T10:31:00' },
         { start: '2017-08-10T10:31:20', end: '2017-08-10T10:31:40' }
         { start: '2017-08-10T10:31:20', end: '2017-08-10T10:31:40' }
       ]
       ]
-    });
+    })
 
 
     it('renders the second short event side by side with the first one', function() {
     it('renders the second short event side by side with the first one', function() {
-      initCalendar();
-      var el2 = $('.fc-short').eq(1);
+      initCalendar()
+      var el2 = $('.fc-short').eq(1)
 
 
-      expect(el2.css('left')).not.toEqual('0px');
-    });
+      expect(el2.css('left')).not.toEqual('0px')
+    })
 
 
     it('prevents the events to overlap when we pass the slotEventOverlap: false option', function() {
     it('prevents the events to overlap when we pass the slotEventOverlap: false option', function() {
       initCalendar({
       initCalendar({
         slotEventOverlap: false
         slotEventOverlap: false
-      });
-
-      var el1 = $('.fc-short').eq(0);
-      var el2 = $('.fc-short').eq(1);
-      
-      expect(el1.css('left')).toEqual('0px');
-      expect(el2.css('left')).not.toEqual('0px');
-    });
-  });
-});
+      })
+
+      var el1 = $('.fc-short').eq(0)
+      var el2 = $('.fc-short').eq(1)
+
+      expect(el1.css('left')).toEqual('0px')
+      expect(el2.css('left')).not.toEqual('0px')
+    })
+  })
+})

+ 9 - 9
tests/event-render/minTime.js

@@ -1,4 +1,4 @@
-import { checkEventRendering } from './TimeGridEventRenderUtils';
+import { checkEventRendering } from './TimeGridEventRenderUtils'
 
 
 describe('event rendering with minTime', function() {
 describe('event rendering with minTime', function() {
   pushOptions({
   pushOptions({
@@ -13,16 +13,16 @@ describe('event rendering with minTime', function() {
       events: [
       events: [
         { start: '2017-03-22T22:00:00', end: '2017-03-23T00:00:00' }
         { start: '2017-03-22T22:00:00', end: '2017-03-23T00:00:00' }
       ]
       ]
-    });
+    })
 
 
     it('renders two event elements in the correct places', function() {
     it('renders two event elements in the correct places', function() {
-      initCalendar();
+      initCalendar()
       var res = checkEventRendering(
       var res = checkEventRendering(
         '2017-03-22T22:00:00',
         '2017-03-22T22:00:00',
         '2017-03-23T00:00:00'
         '2017-03-23T00:00:00'
-      );
-      expect(res.length).toBe(2);
-      expect(res.isMatch).toBe(true);
-    });
-  });
-});
+      )
+      expect(res.length).toBe(2)
+      expect(res.isMatch).toBe(true)
+    })
+  })
+})

+ 7 - 7
tests/event-render/timeText.js

@@ -1,4 +1,4 @@
-import { getTimeTexts } from './TimeGridEventRenderUtils';
+import { getTimeTexts } from './TimeGridEventRenderUtils'
 
 
 describe('the time text on events', function() {
 describe('the time text on events', function() {
 
 
@@ -7,7 +7,7 @@ describe('the time text on events', function() {
       defaultView: 'agendaWeek',
       defaultView: 'agendaWeek',
       defaultDate: '2017-07-03',
       defaultDate: '2017-07-03',
       scrollTime: '00:00'
       scrollTime: '00:00'
-    });
+    })
 
 
     it('renders segs with correct local timezone', function() {
     it('renders segs with correct local timezone', function() {
       initCalendar({
       initCalendar({
@@ -16,7 +16,7 @@ describe('the time text on events', function() {
         events: [
         events: [
           { start: '2017-07-03T23:00:00', end: '2017-07-04T13:00:00' }
           { start: '2017-07-03T23:00:00', end: '2017-07-04T13:00:00' }
         ]
         ]
-      });
+      })
 
 
       expect(
       expect(
         getTimeTexts()
         getTimeTexts()
@@ -24,9 +24,9 @@ describe('the time text on events', function() {
         moment('2017-07-03T23:00:00').format('h:mm Z') + ' - ' +
         moment('2017-07-03T23:00:00').format('h:mm Z') + ' - ' +
         moment('2017-07-04T00:00:00').format('h:mm Z'),
         moment('2017-07-04T00:00:00').format('h:mm Z'),
         moment('2017-07-04T00:00:00').format('h:mm Z') + ' - ' +
         moment('2017-07-04T00:00:00').format('h:mm Z') + ' - ' +
-        moment('2017-07-04T13:00:00').format('h:mm Z'),
-      ]);
+        moment('2017-07-04T13:00:00').format('h:mm Z')
+      ])
     })
     })
-  });
+  })
 
 
-});
+})

+ 18 - 18
tests/event-render/validRange.js

@@ -1,4 +1,4 @@
-import * as EventRenderUtils from './EventRenderUtils';
+import * as EventRenderUtils from './EventRenderUtils'
 
 
 describe('validRange event rendering', function() {
 describe('validRange event rendering', function() {
 
 
@@ -9,7 +9,7 @@ describe('validRange event rendering', function() {
         defaultView: 'month',
         defaultView: 'month',
         defaultDate: '2017-06-01',
         defaultDate: '2017-06-01',
         validRange: { start: '2017-06-07' }
         validRange: { start: '2017-06-07' }
-      });
+      })
 
 
       describe('when event is partially before', function() {
       describe('when event is partially before', function() {
         pushOptions({
         pushOptions({
@@ -19,14 +19,14 @@ describe('validRange event rendering', function() {
         })
         })
 
 
         it('truncates the event\'s beginning', function() {
         it('truncates the event\'s beginning', function() {
-          initCalendar();
-          EventRenderUtils.expectIsStart(false);
-          EventRenderUtils.expectIsEnd(true);
+          initCalendar()
+          EventRenderUtils.expectIsStart(false)
+          EventRenderUtils.expectIsEnd(true)
           // TODO: more test about positioning
           // TODO: more test about positioning
-        });
-      });
-    });
-  });
+        })
+      })
+    })
+  })
 
 
   describe('with end constraint', function() {
   describe('with end constraint', function() {
 
 
@@ -35,7 +35,7 @@ describe('validRange event rendering', function() {
         defaultView: 'month',
         defaultView: 'month',
         defaultDate: '2017-06-01',
         defaultDate: '2017-06-01',
         validRange: { end: '2017-06-07' }
         validRange: { end: '2017-06-07' }
-      });
+      })
 
 
       describe('when event is partially before', function() {
       describe('when event is partially before', function() {
         pushOptions({
         pushOptions({
@@ -45,12 +45,12 @@ describe('validRange event rendering', function() {
         })
         })
 
 
         it('truncates the event\'s end', function() {
         it('truncates the event\'s end', function() {
-          initCalendar();
-          EventRenderUtils.expectIsStart(true);
-          EventRenderUtils.expectIsEnd(false);
+          initCalendar()
+          EventRenderUtils.expectIsStart(true)
+          EventRenderUtils.expectIsEnd(false)
           // TODO: more test about positioning
           // TODO: more test about positioning
-        });
-      });
-    });
-  });
-});
+        })
+      })
+    })
+  })
+})

+ 4 - 4
tests/event-resize/DayGridEventResizeUtils.js

@@ -1,14 +1,14 @@
 import * as EventResizeUtils from './EventResizeUtils'
 import * as EventResizeUtils from './EventResizeUtils'
-import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils';
+import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils'
 
 
 
 
 export function resize(startDate, endDate, debug) {
 export function resize(startDate, endDate, debug) {
-  var el0 = DayGridRenderUtils.getSingleDayEl(startDate);
-  var el1 = DayGridRenderUtils.getSingleDayEl(endDate);
+  var el0 = DayGridRenderUtils.getSingleDayEl(startDate)
+  var el1 = DayGridRenderUtils.getSingleDayEl(endDate)
 
 
   return EventResizeUtils.resize(
   return EventResizeUtils.resize(
     el0[0].getBoundingClientRect(),
     el0[0].getBoundingClientRect(),
     el1[0].getBoundingClientRect(),
     el1[0].getBoundingClientRect(),
     debug
     debug
-  );
+  )
 }
 }

+ 18 - 18
tests/event-resize/EventResizeUtils.js

@@ -1,43 +1,43 @@
-import { getRectCenter, getRectTopLeft, subtractPoints, addPoints } from '../lib/geom';
-import * as EventRenderUtils from '../event-render/EventRenderUtils';
+import { getRectCenter, getRectTopLeft, subtractPoints, addPoints } from '../lib/geom'
+import * as EventRenderUtils from '../event-render/EventRenderUtils'
 
 
 
 
 export function resize(rect0, rect1, debug) {
 export function resize(rect0, rect1, debug) {
-  var eventEl = EventRenderUtils.getSingleEl();
+  var eventEl = EventRenderUtils.getSingleEl()
 
 
-  eventEl.simulate('mouseover'); // so that resize handle is revealed
+  eventEl.simulate('mouseover') // so that resize handle is revealed
 
 
-  var resizerEl = eventEl.find('.fc-resizer');
-  var resizerRect = resizerEl[0].getBoundingClientRect();
-  var resizerCenter = getRectCenter(resizerRect);
+  var resizerEl = eventEl.find('.fc-resizer')
+  var resizerRect = resizerEl[0].getBoundingClientRect()
+  var resizerCenter = getRectCenter(resizerRect)
 
 
   var vector = subtractPoints(
   var vector = subtractPoints(
     resizerCenter,
     resizerCenter,
     getRectTopLeft(rect0)
     getRectTopLeft(rect0)
-  );
+  )
   var point1 = addPoints(
   var point1 = addPoints(
     getRectTopLeft(rect1),
     getRectTopLeft(rect1),
     vector
     vector
-  );
-  var deferred = $.Deferred();
+  )
+  var deferred = $.Deferred()
 
 
   resizerEl.simulate('drag', {
   resizerEl.simulate('drag', {
     point: resizerCenter,
     point: resizerCenter,
     end: point1,
     end: point1,
     debug: debug
     debug: debug
-  });
+  })
 
 
   currentCalendar.on('eventResizeStop', function() {
   currentCalendar.on('eventResizeStop', function() {
     setTimeout(function() {
     setTimeout(function() {
-      deferred.resolve({ isSuccess: false }); // won't do anything if already eventResize
-    }, 20);  // will happen after eventResize's timeout
-  });
+      deferred.resolve({ isSuccess: false }) // won't do anything if already eventResize
+    }, 20) // will happen after eventResize's timeout
+  })
 
 
   currentCalendar.on('eventResize', function(event) { // always called after eventDragStop, if success
   currentCalendar.on('eventResize', function(event) { // always called after eventDragStop, if success
     setTimeout(function() {
     setTimeout(function() {
-      deferred.resolve({ isSuccess: true, event: event });
-    }, 10); // will happen first
-  });
+      deferred.resolve({ isSuccess: true, event: event })
+    }, 10) // will happen first
+  })
 
 
-  return deferred.promise();
+  return deferred.promise()
 }
 }

+ 9 - 9
tests/event-resize/validRange.js

@@ -1,5 +1,5 @@
-import * as EventResizeUtils from './EventResizeUtils';
-import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils';
+import * as EventResizeUtils from './EventResizeUtils'
+import * as DayGridRenderUtils from '../view-render/DayGridRenderUtils'
 
 
 
 
 describe('validRange event resizing', function() {
 describe('validRange event resizing', function() {
@@ -13,16 +13,16 @@ describe('validRange event resizing', function() {
         { start: '2017-06-04', end: '2017-06-07' }
         { start: '2017-06-04', end: '2017-06-07' }
       ],
       ],
       editable: true
       editable: true
-    });
+    })
 
 
     pit('won\'t go after validRange', function() {
     pit('won\'t go after validRange', function() {
-      initCalendar();
+      initCalendar()
       return EventResizeUtils.resize(
       return EventResizeUtils.resize(
         DayGridRenderUtils.getSingleDayEl('2017-06-06')[0].getBoundingClientRect(),
         DayGridRenderUtils.getSingleDayEl('2017-06-06')[0].getBoundingClientRect(),
         DayGridRenderUtils.getDisabledEl(0)[0].getBoundingClientRect() // where Jun 9th would be
         DayGridRenderUtils.getDisabledEl(0)[0].getBoundingClientRect() // where Jun 9th would be
       ).then(function(res) {
       ).then(function(res) {
-        expect(res.isSuccess).toBe(false);
-      });
-    });
-  });
-});
+        expect(res.isSuccess).toBe(false)
+      })
+    })
+  })
+})

+ 70 - 72
tests/globals.js

@@ -5,30 +5,30 @@
 // like `it`, but with the ability to return a promise
 // like `it`, but with the ability to return a promise
 window.pit = function(description, runFunc) {
 window.pit = function(description, runFunc) {
   it(description, function(done) {
   it(description, function(done) {
-    runFunc().then(done);
-  });
-};
+    runFunc().then(done)
+  })
+}
 
 
 
 
 // Setup / Teardown
 // Setup / Teardown
 // ---------------------------------------------------------------------------------------------------------------------
 // ---------------------------------------------------------------------------------------------------------------------
 
 
-window.optionsStack = null;
-window.currentCalendar = null;
+window.optionsStack = null
+window.currentCalendar = null
 
 
 
 
 beforeEach(function() {
 beforeEach(function() {
-  window.optionsStack = [];
-});
+  window.optionsStack = []
+})
 
 
 afterEach(function() {
 afterEach(function() {
-  window.optionsStack = null;
+  window.optionsStack = null
   if (window.currentCalendar) {
   if (window.currentCalendar) {
-    window.currentCalendar.destroy();
-    window.currentCalendar = null;
+    window.currentCalendar.destroy()
+    window.currentCalendar = null
   }
   }
-  $('#calendar').remove();
-});
+  $('#calendar').remove()
+})
 
 
 
 
 // Calendar Options and Initialization
 // Calendar Options and Initialization
@@ -36,45 +36,44 @@ afterEach(function() {
 
 
 window.pushOptions = function(options) {
 window.pushOptions = function(options) {
   beforeEach(function() {
   beforeEach(function() {
-    return window.optionsStack.push(options);
-  });
-};
+    return window.optionsStack.push(options)
+  })
+}
 
 
 // called within an `it`
 // called within an `it`
 window.spyOnCalendarCallback = function(name, func) {
 window.spyOnCalendarCallback = function(name, func) {
-  var options = {};
+  var options = {}
 
 
-  options[name] = func;
-  spyOn(options, name).and.callThrough();
+  options[name] = func
+  spyOn(options, name).and.callThrough()
 
 
-  window.optionsStack.push(options);
+  window.optionsStack.push(options)
 
 
-  return options[name];
-};
+  return options[name]
+}
 
 
 window.initCalendar = function(options, el) {
 window.initCalendar = function(options, el) {
-  var Calendar = $.fullCalendar.Calendar;
-  var $el;
+  var Calendar = $.fullCalendar.Calendar
+  var $el
 
 
   if (options) {
   if (options) {
-    window.optionsStack.push(options);
+    window.optionsStack.push(options)
   }
   }
 
 
   if (el) {
   if (el) {
-    $el = $(el);
-  }
-  else {
-    $el = $('<div id="calendar">').appendTo('body');
+    $el = $(el)
+  } else {
+    $el = $('<div id="calendar">').appendTo('body')
   }
   }
 
 
-  window.currentCalendar = new Calendar($el, getCurrentOptions()); // set the global
+  window.currentCalendar = new Calendar($el, getCurrentOptions()) // set the global
 
 
-  return window.currentCalendar.render();
-};
+  return window.currentCalendar.render()
+}
 
 
 window.getCurrentOptions = function() {
 window.getCurrentOptions = function() {
-  return $.extend.apply($, [ {} ].concat(window.optionsStack));
-};
+  return $.extend.apply($, [ {} ].concat(window.optionsStack))
+}
 
 
 
 
 // Categorizing Tests
 // Categorizing Tests
@@ -86,37 +85,36 @@ describeOptions(descriptionAndOptionsHash, callback)
  */
  */
 window.describeOptions = function(optName, hash, callback) {
 window.describeOptions = function(optName, hash, callback) {
   if ($.type(optName) === 'object') {
   if ($.type(optName) === 'object') {
-    callback = hash;
-    hash = optName;
-    optName = null;
+    callback = hash
+    hash = optName
+    optName = null
   }
   }
 
 
   $.each(hash, function(desc, val) {
   $.each(hash, function(desc, val) {
-    var opts;
+    var opts
 
 
     if (optName) {
     if (optName) {
-      opts = {};
-      opts[optName] = val;
-    }
-    else {
-      opts = val;
+      opts = {}
+      opts[optName] = val
+    } else {
+      opts = val
     }
     }
-    opts = $.extend(true, {}, opts);
+    opts = $.extend(true, {}, opts)
 
 
     describe(desc, function() {
     describe(desc, function() {
-      pushOptions(opts);
-      callback(val);
-    });
-  });
-};
+      pushOptions(opts)
+      callback(val)
+    })
+  })
+}
 
 
 window.describeValues = function(hash, callback) {
 window.describeValues = function(hash, callback) {
   $.each(hash, function(desc, val) {
   $.each(hash, function(desc, val) {
     describe(desc, function() {
     describe(desc, function() {
-      callback(val);
-    });
-  });
-};
+      callback(val)
+    })
+  })
+}
 
 
 
 
 // Timezone Tests (needed?)
 // Timezone Tests (needed?)
@@ -127,58 +125,58 @@ const timezoneScenarios = {
     description: 'when no timezone',
     description: 'when no timezone',
     value: null,
     value: null,
     moment: function(str) {
     moment: function(str) {
-      return $.fullCalendar.moment.parseZone(str);
+      return $.fullCalendar.moment.parseZone(str)
     }
     }
   },
   },
   local: {
   local: {
     description: 'when local timezone',
     description: 'when local timezone',
     value: 'local',
     value: 'local',
     moment: function(str) {
     moment: function(str) {
-      return moment(str);
+      return moment(str)
     }
     }
   },
   },
   UTC: {
   UTC: {
     description: 'when UTC timezone',
     description: 'when UTC timezone',
     value: 'UTC',
     value: 'UTC',
     moment: function(str) {
     moment: function(str) {
-      return moment.utc(str);
+      return moment.utc(str)
     }
     }
   }
   }
-};
+}
 
 
 window.describeTimezones = function(callback) {
 window.describeTimezones = function(callback) {
   $.each(timezoneScenarios, function(name, scenario) {
   $.each(timezoneScenarios, function(name, scenario) {
     describe(scenario.description, function() {
     describe(scenario.description, function() {
       pushOptions({
       pushOptions({
         timezone: name
         timezone: name
-      });
-      callback(scenario);
-    });
-  });
-};
+      })
+      callback(scenario)
+    })
+  })
+}
 
 
 window.describeTimezone = function(name, callback) {
 window.describeTimezone = function(name, callback) {
-  var scenario = timezoneScenarios[name];
+  var scenario = timezoneScenarios[name]
 
 
   describe(scenario.description, function() {
   describe(scenario.description, function() {
     pushOptions({
     pushOptions({
       timezone: name
       timezone: name
-    });
-    callback(scenario);
-  });
-};
+    })
+    callback(scenario)
+  })
+}
 
 
 
 
 // Misc
 // Misc
 // ---------------------------------------------------------------------------------------------------------------------
 // ---------------------------------------------------------------------------------------------------------------------
 
 
 window.oneCall = function(func) {
 window.oneCall = function(func) {
-  var called;
-  called = false;
+  var called
+  called = false
   return function() {
   return function() {
     if (!called) {
     if (!called) {
-      called = true;
-      return func.apply(this, arguments);
+      called = true
+      return func.apply(this, arguments)
     }
     }
-  };
-};
+  }
+}

+ 4 - 4
tests/index.js

@@ -1,11 +1,11 @@
 
 
-require('./globals');
-require('./jasmine-ext');
+require('./globals')
+require('./jasmine-ext')
 
 
 var context = require.context(
 var context = require.context(
   '.',
   '.',
   true, // recursive?
   true, // recursive?
   /[^\/]+\/[^\/]+\.(js|ts)$/ // inside subdirectory
   /[^\/]+\/[^\/]+\.(js|ts)$/ // inside subdirectory
-);
+)
 
 
-context.keys().forEach(context);
+context.keys().forEach(context)

+ 84 - 86
tests/jasmine-ext.js

@@ -2,15 +2,15 @@
 beforeEach(function() {
 beforeEach(function() {
 
 
   // HACK. PhantomJS fails otherwise
   // HACK. PhantomJS fails otherwise
-  $.fullCalendar.Calendar.defaults.windowResizeDelay = 200;
+  $.fullCalendar.Calendar.defaults.windowResizeDelay = 200
 
 
   // On real devices, when a click-like touch interaction happens, there is a preiod of time where mouse events
   // On real devices, when a click-like touch interaction happens, there is a preiod of time where mouse events
   // are ignores. Since ignore peroid is global, and might span across tests, disable it.
   // are ignores. Since ignore peroid is global, and might span across tests, disable it.
   // The simulates touch events do not fire these mouse events anyway.
   // The simulates touch events do not fire these mouse events anyway.
-  $.fullCalendar.touchMouseIgnoreWait = 0;
+  $.fullCalendar.touchMouseIgnoreWait = 0
 
 
   // increase the default timeout
   // increase the default timeout
-  jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
+  jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000
 
 
 
 
   jasmine.addMatchers({
   jasmine.addMatchers({
@@ -20,46 +20,46 @@ beforeEach(function() {
     toEqualMoment: function() {
     toEqualMoment: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var actualStr = $.fullCalendar.moment.parseZone(actual).format();
-          var expectedStr = $.fullCalendar.moment.parseZone(expected).format();
+          var actualStr = $.fullCalendar.moment.parseZone(actual).format()
+          var expectedStr = $.fullCalendar.moment.parseZone(expected).format()
           var result = {
           var result = {
             pass: actualStr === expectedStr
             pass: actualStr === expectedStr
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Moment ' + actualStr + ' does not equal ' + expectedStr;
+            result.message = 'Moment ' + actualStr + ' does not equal ' + expectedStr
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
     toEqualNow: function() {
     toEqualNow: function() {
       return {
       return {
         compare: function(actual) {
         compare: function(actual) {
-          var actualMoment = $.fullCalendar.moment.parseZone(actual);
+          var actualMoment = $.fullCalendar.moment.parseZone(actual)
           var result = {
           var result = {
             pass: Math.abs(actualMoment - new Date()) < 1000 // within a second of current datetime
             pass: Math.abs(actualMoment - new Date()) < 1000 // within a second of current datetime
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Moment ' + actualMoment.format() + ' is not close enough to now';
+            result.message = 'Moment ' + actualMoment.format() + ' is not close enough to now'
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
     toEqualDuration: function() {
     toEqualDuration: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var actualStr = serializeDuration(moment.duration(actual));
-          var expectedStr = serializeDuration(moment.duration(expected));
+          var actualStr = serializeDuration(moment.duration(actual))
+          var expectedStr = serializeDuration(moment.duration(expected))
           var result = {
           var result = {
             pass: actualStr === expectedStr
             pass: actualStr === expectedStr
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Duration ' + actualStr + ' does not equal ' + expectedStr;
+            result.message = 'Duration ' + actualStr + ' does not equal ' + expectedStr
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
 
 
 
 
@@ -68,15 +68,15 @@ beforeEach(function() {
     toHaveScrollbars: function() {
     toHaveScrollbars: function() {
       return {
       return {
         compare: function(actual) {
         compare: function(actual) {
-          var elm = $(actual);
+          var elm = $(actual)
           var result = {
           var result = {
             pass: elm[0].scrollWidth - 1 > elm[0].clientWidth || // -1 !!!
             pass: elm[0].scrollWidth - 1 > elm[0].clientWidth || // -1 !!!
               elm[0].scrollHeight - 1 > elm[0].clientHeight // -1 !!!
               elm[0].scrollHeight - 1 > elm[0].clientHeight // -1 !!!
-          };
+          }
           // !!! - IE was reporting a scrollWidth/scrollHeight 1 pixel taller than what it was :(
           // !!! - IE was reporting a scrollWidth/scrollHeight 1 pixel taller than what it was :(
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
 
 
 
 
@@ -85,95 +85,95 @@ beforeEach(function() {
     toBeBoundedBy: function() {
     toBeBoundedBy: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var outer = getBounds(expected);
-          var inner = getBounds(actual);
+          var outer = getBounds(expected)
+          var inner = getBounds(actual)
           var result = {
           var result = {
             pass: outer && inner &&
             pass: outer && inner &&
               inner.left >= outer.left &&
               inner.left >= outer.left &&
               inner.right <= outer.right &&
               inner.right <= outer.right &&
               inner.top >= outer.top &&
               inner.top >= outer.top &&
               inner.bottom <= outer.bottom
               inner.bottom <= outer.bottom
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Element does not bound other element';
+            result.message = 'Element does not bound other element'
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
     toBeLeftOf: function() {
     toBeLeftOf: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var subjectBounds = getBounds(actual);
-          var otherBounds = getBounds(expected);
+          var subjectBounds = getBounds(actual)
+          var otherBounds = getBounds(expected)
           var result = {
           var result = {
             pass: subjectBounds && otherBounds &&
             pass: subjectBounds && otherBounds &&
               Math.round(subjectBounds.right) <= Math.round(otherBounds.left) + 2
               Math.round(subjectBounds.right) <= Math.round(otherBounds.left) + 2
               // need to round because IE was giving weird fractions
               // need to round because IE was giving weird fractions
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Element is not to the left of the other element';
+            result.message = 'Element is not to the left of the other element'
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
     toBeRightOf: function() {
     toBeRightOf: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var subjectBounds = getBounds(actual);
-          var otherBounds = getBounds(expected);
+          var subjectBounds = getBounds(actual)
+          var otherBounds = getBounds(expected)
           var result = {
           var result = {
             pass: subjectBounds && otherBounds &&
             pass: subjectBounds && otherBounds &&
               Math.round(subjectBounds.left) >= Math.round(otherBounds.right) - 2
               Math.round(subjectBounds.left) >= Math.round(otherBounds.right) - 2
               // need to round because IE was giving weird fractions
               // need to round because IE was giving weird fractions
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Element is not to the right of the other element';
+            result.message = 'Element is not to the right of the other element'
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
     toBeAbove: function() {
     toBeAbove: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var subjectBounds = getBounds(actual);
-          var otherBounds = getBounds(expected);
+          var subjectBounds = getBounds(actual)
+          var otherBounds = getBounds(expected)
           var result = {
           var result = {
             pass: subjectBounds && otherBounds &&
             pass: subjectBounds && otherBounds &&
               Math.round(subjectBounds.bottom) <= Math.round(otherBounds.top) + 2
               Math.round(subjectBounds.bottom) <= Math.round(otherBounds.top) + 2
               // need to round because IE was giving weird fractions
               // need to round because IE was giving weird fractions
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Element is not above the other element';
+            result.message = 'Element is not above the other element'
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
     toBeBelow: function() {
     toBeBelow: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var subjectBounds = getBounds(actual);
-          var otherBounds = getBounds(expected);
+          var subjectBounds = getBounds(actual)
+          var otherBounds = getBounds(expected)
           var result = {
           var result = {
             pass: subjectBounds && otherBounds &&
             pass: subjectBounds && otherBounds &&
               Math.round(subjectBounds.top) >= Math.round(otherBounds.bottom) - 2
               Math.round(subjectBounds.top) >= Math.round(otherBounds.bottom) - 2
               // need to round because IE was giving weird fractions
               // need to round because IE was giving weird fractions
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Element is not below the other element';
+            result.message = 'Element is not below the other element'
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     },
     },
     toIntersectWith: function() {
     toIntersectWith: function() {
       return {
       return {
         compare: function(actual, expected) {
         compare: function(actual, expected) {
-          var subjectBounds = getBounds(actual);
-          var otherBounds = getBounds(expected);
+          var subjectBounds = getBounds(actual)
+          var otherBounds = getBounds(expected)
           var result = {
           var result = {
             pass: subjectBounds && otherBounds &&
             pass: subjectBounds && otherBounds &&
               subjectBounds.right - 1 > otherBounds.left &&
               subjectBounds.right - 1 > otherBounds.left &&
@@ -181,77 +181,75 @@ beforeEach(function() {
               subjectBounds.bottom - 1 > otherBounds.top &&
               subjectBounds.bottom - 1 > otherBounds.top &&
               subjectBounds.top + 1 < otherBounds.bottom
               subjectBounds.top + 1 < otherBounds.bottom
               // +/-1 because of zoom
               // +/-1 because of zoom
-          };
+          }
           if (!result.pass) {
           if (!result.pass) {
-            result.message = 'Element does not intersect with other element';
+            result.message = 'Element does not intersect with other element'
           }
           }
-          return result;
+          return result
         }
         }
-      };
+      }
     }
     }
 
 
-  });
+  })
 
 
   function serializeDuration(duration) {
   function serializeDuration(duration) {
     return Math.floor(duration.asDays()) + '.' +
     return Math.floor(duration.asDays()) + '.' +
       pad(duration.hours(), 2) + ':' +
       pad(duration.hours(), 2) + ':' +
       pad(duration.minutes(), 2) + ':' +
       pad(duration.minutes(), 2) + ':' +
       pad(duration.seconds(), 2) + '.' +
       pad(duration.seconds(), 2) + '.' +
-      pad(duration.milliseconds(), 3);
+      pad(duration.milliseconds(), 3)
   }
   }
 
 
   function pad(n, width) {
   function pad(n, width) {
-    n = n + '';
-    return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;
+    n = n + ''
+    return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n
   }
   }
 
 
   function getBounds(node) {
   function getBounds(node) {
-    return $(node)[0].getBoundingClientRect();
+    return $(node)[0].getBoundingClientRect()
   }
   }
 
 
-});
+})
 
 
 
 
 window.spyOnMethod = function(Class, methodName, dontCallThrough) {
 window.spyOnMethod = function(Class, methodName, dontCallThrough) {
-  var origMethod = Class.prototype.hasOwnProperty(methodName) ?
-    Class.prototype[methodName] :
-    null;
+  var origMethod = Class.prototype.hasOwnProperty(methodName)
+    ? Class.prototype[methodName]
+    : null
 
 
-  var spy = spyOn(Class.prototype, methodName);
+  var spy = spyOn(Class.prototype, methodName)
 
 
   if (!dontCallThrough) {
   if (!dontCallThrough) {
-    spy = spy.and.callThrough();
+    spy = spy.and.callThrough()
   }
   }
 
 
   spy.restore = function() {
   spy.restore = function() {
     if (origMethod) {
     if (origMethod) {
-      Class.prototype[methodName] = origMethod;
-    }
-    else {
-      delete Class.prototype[methodName];
+      Class.prototype[methodName] = origMethod
+    } else {
+      delete Class.prototype[methodName]
     }
     }
-  };
+  }
 
 
-  return spy;
+  return spy
 };
 };
 
 
 
 
 // fix bug with jQuery 3 returning 0 height for <td> elements in the IE's
 // fix bug with jQuery 3 returning 0 height for <td> elements in the IE's
 [ 'height', 'outerHeight' ].forEach(function(methodName) {
 [ 'height', 'outerHeight' ].forEach(function(methodName) {
-  var orig = $.fn[methodName];
+  var orig = $.fn[methodName]
 
 
   $.fn[methodName] = function() {
   $.fn[methodName] = function() {
     if (!arguments.length && this.is('td')) {
     if (!arguments.length && this.is('td')) {
-      return this[0].getBoundingClientRect().height;
-    }
-    else {
-      return orig.apply(this, arguments);
+      return this[0].getBoundingClientRect().height
+    } else {
+      return orig.apply(this, arguments)
     }
     }
-  };
-});
+  }
+})
 
 
 // Destroy all calendars afterwards, to prevent memory leaks
 // Destroy all calendars afterwards, to prevent memory leaks
 // (not the best place for this)
 // (not the best place for this)
 afterEach(function() {
 afterEach(function() {
-  $('.fc').fullCalendar('destroy');
-});
+  $('.fc').fullCalendar('destroy')
+})

+ 20 - 20
tests/legacy/Agenda-render.js

@@ -2,35 +2,35 @@
 describe('Agenda view rendering', function() {
 describe('Agenda view rendering', function() {
   pushOptions({
   pushOptions({
     defaultView: 'agendaWeek'
     defaultView: 'agendaWeek'
-  });
+  })
 
 
   describe('when LTR', function() {
   describe('when LTR', function() {
     pushOptions({
     pushOptions({
       isRTL: false
       isRTL: false
-    });
+    })
 
 
     it('renders the axis on the left', function() {
     it('renders the axis on the left', function() {
-      initCalendar();
-      var header = $('.fc-view > table > thead');
-      var firstSlat = $('.fc-slats tr:first');
-      expect(header.find('.fc-axis')).toBeLeftOf(header.find('.fc-day-header:first'));
-      expect($('.fc-day-grid .fc-axis')).toBeLeftOf($('.fc-day-grid .fc-day:first'));
-      expect(firstSlat.find('.fc-axis')).toBeLeftOf(firstSlat.find('td:not(.fc-axis)'));
-    });
-  });
+      initCalendar()
+      var header = $('.fc-view > table > thead')
+      var firstSlat = $('.fc-slats tr:first')
+      expect(header.find('.fc-axis')).toBeLeftOf(header.find('.fc-day-header:first'))
+      expect($('.fc-day-grid .fc-axis')).toBeLeftOf($('.fc-day-grid .fc-day:first'))
+      expect(firstSlat.find('.fc-axis')).toBeLeftOf(firstSlat.find('td:not(.fc-axis)'))
+    })
+  })
 
 
   describe('when RTL', function() {
   describe('when RTL', function() {
     pushOptions({
     pushOptions({
       isRTL: true
       isRTL: true
-    });
+    })
 
 
     it('renders the axis on the right', function() {
     it('renders the axis on the right', function() {
-      initCalendar();
-      var header = $('.fc-view > table > thead');
-      var firstSlat = $('.fc-slats tr:first');
-      expect(header.find('.fc-axis')).toBeRightOf(header.find('.fc-day-header:first'));
-      expect($('.fc-day-grid .fc-axis')).toBeRightOf($('.fc-day-grid .fc-day:first'));
-      expect(firstSlat.find('.fc-axis')).toBeRightOf(firstSlat.find('td:not(.fc-axis)'));
-    });
-  });
-});
+      initCalendar()
+      var header = $('.fc-view > table > thead')
+      var firstSlat = $('.fc-slats tr:first')
+      expect(header.find('.fc-axis')).toBeRightOf(header.find('.fc-day-header:first'))
+      expect($('.fc-day-grid .fc-axis')).toBeRightOf($('.fc-day-grid .fc-day:first'))
+      expect(firstSlat.find('.fc-axis')).toBeRightOf(firstSlat.find('td:not(.fc-axis)'))
+    })
+  })
+})

+ 113 - 116
tests/legacy/DayGrid-events.js

@@ -2,113 +2,113 @@ describe('DayGrid event rendering', function() {
   pushOptions({
   pushOptions({
     defaultDate: '2014-08-01', // 2014-07-27 - 2014-10-07 (excl)
     defaultDate: '2014-08-01', // 2014-07-27 - 2014-10-07 (excl)
     defaultView: 'month'
     defaultView: 'month'
-  });
+  })
 
 
   describe('when LTR', function() {
   describe('when LTR', function() {
-    initMonthTesting(false);
-  });
+    initMonthTesting(false)
+  })
   describe('when RTL', function() {
   describe('when RTL', function() {
-    initMonthTesting(true);
-  });
+    initMonthTesting(true)
+  })
 
 
   function initMonthTesting(isRTL) {
   function initMonthTesting(isRTL) {
     it('correctly renders an event starting before view\'s start', function() {
     it('correctly renders an event starting before view\'s start', function() {
-      var options = {};
+      var options = {}
       options.events = [
       options.events = [
         { start: '2014-07-26', end: '2014-07-30' }
         { start: '2014-07-26', end: '2014-07-30' }
-      ];
+      ]
 
 
       var testSegOptions = {
       var testSegOptions = {
         firstCol: 0,
         firstCol: 0,
         lastCol: 2,
         lastCol: 2,
         isStart: false,
         isStart: false,
         isEnd: true
         isEnd: true
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event starting at view\'s start', function() {
     it('correctly renders an event starting at view\'s start', function() {
-      var options = {};
+      var options = {}
       options.events = [
       options.events = [
         { start: '2014-07-27', end: '2014-07-29' }
         { start: '2014-07-27', end: '2014-07-29' }
-      ];
+      ]
 
 
       var testSegOptions = {
       var testSegOptions = {
         firstCol: 0,
         firstCol: 0,
         lastCol: 1,
         lastCol: 1,
         isStart: true,
         isStart: true,
         isEnd: true
         isEnd: true
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event starting after view\'s start', function() {
     it('correctly renders an event starting after view\'s start', function() {
-      var options = {};
+      var options = {}
       options.events = [
       options.events = [
         { start: '2014-08-01', end: '2014-08-02' }
         { start: '2014-08-01', end: '2014-08-02' }
-      ];
+      ]
 
 
       var testSegOptions = {
       var testSegOptions = {
         firstCol: 5,
         firstCol: 5,
         lastCol: 5,
         lastCol: 5,
         isStart: true,
         isStart: true,
         isEnd: true
         isEnd: true
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event starting on a hidden day at week start', function() {
     it('correctly renders an event starting on a hidden day at week start', function() {
-      var options = {};
-      options.weekends = false;
+      var options = {}
+      options.weekends = false
       options.events = [
       options.events = [
         { start: '2014-07-27', end: '2014-07-30' }
         { start: '2014-07-27', end: '2014-07-30' }
-      ];
+      ]
 
 
       var testSegOptions = {
       var testSegOptions = {
         firstCol: 0,
         firstCol: 0,
         lastCol: 1,
         lastCol: 1,
         isStart: false,
         isStart: false,
         isEnd: true
         isEnd: true
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event starting on a hidden day in middle of week', function() {
     it('correctly renders an event starting on a hidden day in middle of week', function() {
-      var options = {};
-      options.hiddenDays = [ 2 ]; // hide Tues
+      var options = {}
+      options.hiddenDays = [ 2 ] // hide Tues
       options.events = [
       options.events = [
         { start: '2014-07-29', end: '2014-08-01' }
         { start: '2014-07-29', end: '2014-08-01' }
-      ];
+      ]
 
 
       var testSegOptions = {
       var testSegOptions = {
         firstCol: 2,
         firstCol: 2,
         lastCol: 3,
         lastCol: 3,
         isStart: false,
         isStart: false,
         isEnd: true
         isEnd: true
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event ending before view\'s end', function() {
     it('correctly renders an event ending before view\'s end', function() {
-      var options = {};
+      var options = {}
       options.events = [
       options.events = [
         { start: '2014-09-02', end: '2014-09-05' }
         { start: '2014-09-02', end: '2014-09-05' }
-      ];
+      ]
       var testSegOptions = {
       var testSegOptions = {
         row: 5,
         row: 5,
         firstCol: 2,
         firstCol: 2,
         lastCol: 4,
         lastCol: 4,
         isStart: true,
         isStart: true,
         isEnd: true
         isEnd: true
-      };
+      }
       testSeg(options, testSegOptions)
       testSeg(options, testSegOptions)
-    });
+    })
 
 
     it('correctly renders an event ending at view\'s end', function() {
     it('correctly renders an event ending at view\'s end', function() {
-      var options = {};
+      var options = {}
       options.events = [
       options.events = [
         { start: '2014-09-04', end: '2014-09-07' }
         { start: '2014-09-04', end: '2014-09-07' }
-      ];
+      ]
 
 
       var testSegOptions = {
       var testSegOptions = {
         row: 5,
         row: 5,
@@ -116,79 +116,79 @@ describe('DayGrid event rendering', function() {
         lastCol: 6,
         lastCol: 6,
         isStart: true,
         isStart: true,
         isEnd: true
         isEnd: true
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event ending after view\'s end', function() {
     it('correctly renders an event ending after view\'s end', function() {
-      var options = {};
+      var options = {}
       options.events = [
       options.events = [
         { start: '2014-09-04', end: '2014-09-08' }
         { start: '2014-09-04', end: '2014-09-08' }
-      ];
+      ]
       var testSegOptions = {
       var testSegOptions = {
         row: 5,
         row: 5,
         firstCol: 4,
         firstCol: 4,
         lastCol: 6,
         lastCol: 6,
         isStart: true,
         isStart: true,
         isEnd: false
         isEnd: false
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event ending at a week\'s end', function() {
     it('correctly renders an event ending at a week\'s end', function() {
-      var options = {};
+      var options = {}
       options.events = [
       options.events = [
         { start: '2014-08-28', end: '2014-08-31' }
         { start: '2014-08-28', end: '2014-08-31' }
-      ];
+      ]
       var testSegOptions = {
       var testSegOptions = {
         row: 4,
         row: 4,
         firstCol: 4,
         firstCol: 4,
         lastCol: 6,
         lastCol: 6,
         isStart: true,
         isStart: true,
         isEnd: true
         isEnd: true
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event ending on a hidden day at week end', function() {
     it('correctly renders an event ending on a hidden day at week end', function() {
-      var options = {};
-      options.weekends = false;
+      var options = {}
+      options.weekends = false
       options.events = [
       options.events = [
         { start: '2014-07-30', end: '2014-08-03' }
         { start: '2014-07-30', end: '2014-08-03' }
-      ];
+      ]
       var testSegOptions = {
       var testSegOptions = {
         firstCol: 2,
         firstCol: 2,
         lastCol: 4,
         lastCol: 4,
         isStart: true,
         isStart: true,
         isEnd: false
         isEnd: false
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     it('correctly renders an event ending on a hidden day in middle of week', function() {
     it('correctly renders an event ending on a hidden day in middle of week', function() {
-      var options = {};
-      options.hiddenDays = [ 4 ]; // Thurs
+      var options = {}
+      options.hiddenDays = [ 4 ] // Thurs
       options.events = [
       options.events = [
         { start: '2014-07-28', end: '2014-08-01' }
         { start: '2014-07-28', end: '2014-08-01' }
-      ];
+      ]
       var testSegOptions = {
       var testSegOptions = {
         firstCol: 1,
         firstCol: 1,
         lastCol: 3,
         lastCol: 3,
         isStart: true,
         isStart: true,
         isEnd: false
         isEnd: false
-      };
-      testSeg(options, testSegOptions);
-    });
+      }
+      testSeg(options, testSegOptions)
+    })
 
 
     function testSeg(calendarOptions, testSegOptions) {
     function testSeg(calendarOptions, testSegOptions) {
-      calendarOptions.isRTL = isRTL;
-      initCalendar(calendarOptions);
-      directionallyTestSeg(testSegOptions, isRTL);
+      calendarOptions.isRTL = isRTL
+      initCalendar(calendarOptions)
+      directionallyTestSeg(testSegOptions, isRTL)
     }
     }
   }
   }
 
 
   it('rendering of events across weeks stays consistent', function() {
   it('rendering of events across weeks stays consistent', function() {
-    var options = {};
+    var options = {}
     options.events = [
     options.events = [
       {
       {
         title: 'event1',
         title: 'event1',
@@ -202,40 +202,40 @@ describe('DayGrid event rendering', function() {
         end: '2014-08-05',
         end: '2014-08-05',
         className: 'event2'
         className: 'event2'
       }
       }
-    ];
-    initCalendar(options);
-    var row0 = $('.fc-day-grid .fc-row:eq(0)');
-    var row0event1 = row0.find('.event1');
-    var row0event2 = row0.find('.event2');
-    var row1 = $('.fc-day-grid .fc-row:eq(1)');
-    var row1event1 = row1.find('.event1');
-    var row1event2 = row1.find('.event2');
-    expect(row0event1.offset().top).toBeLessThan(row0event2.offset().top);
-    expect(row1event1.offset().top).toBeLessThan(row1event2.offset().top);
-  });
+    ]
+    initCalendar(options)
+    var row0 = $('.fc-day-grid .fc-row:eq(0)')
+    var row0event1 = row0.find('.event1')
+    var row0event2 = row0.find('.event2')
+    var row1 = $('.fc-day-grid .fc-row:eq(1)')
+    var row1event1 = row1.find('.event1')
+    var row1event2 = row1.find('.event2')
+    expect(row0event1.offset().top).toBeLessThan(row0event2.offset().top)
+    expect(row1event1.offset().top).toBeLessThan(row1event2.offset().top)
+  })
 
 
   it('renders an event with no url with no <a> href', function() {
   it('renders an event with no url with no <a> href', function() {
-    var options = {};
+    var options = {}
     options.events = [ {
     options.events = [ {
       title: 'event1',
       title: 'event1',
       start: '2014-08-01'
       start: '2014-08-01'
-    } ];
-    initCalendar(options);
-    var seg = $('.fc-event');
-    expect(seg).not.toHaveAttr('href');
-  });
+    } ]
+    initCalendar(options)
+    var seg = $('.fc-event')
+    expect(seg).not.toHaveAttr('href')
+  })
 
 
   it('renders an event with a url with an <a> href', function() {
   it('renders an event with a url with an <a> href', function() {
-    var options = {};
+    var options = {}
     options.events = [ {
     options.events = [ {
       title: 'event1',
       title: 'event1',
       start: '2014-08-01',
       start: '2014-08-01',
       url: 'http://google.com/'
       url: 'http://google.com/'
-    } ];
-    initCalendar(options);
-    var seg = $('.fc-event');
-    expect(seg).toHaveAttr('href');
-  });
+    } ]
+    initCalendar(options)
+    var seg = $('.fc-event')
+    expect(seg).toHaveAttr('href')
+  })
 
 
 
 
   /*
   /*
@@ -248,50 +248,47 @@ describe('DayGrid event rendering', function() {
     - isEnd
     - isEnd
   */
   */
   function directionallyTestSeg(opts, isRTL) {
   function directionallyTestSeg(opts, isRTL) {
-    var el = $(opts.el || '.fc-event:first');
+    var el = $(opts.el || '.fc-event:first')
 
 
-    var row = opts.row || 0;
-    var rowTds = $('.fc-day-grid .fc-row:eq(' + row + ') .fc-day');
-    expect(rowTds.length).toBeGreaterThan(1);
+    var row = opts.row || 0
+    var rowTds = $('.fc-day-grid .fc-row:eq(' + row + ') .fc-day')
+    expect(rowTds.length).toBeGreaterThan(1)
 
 
-    var leftCol;
-    var rightCol;
+    var leftCol
+    var rightCol
     if (isRTL) {
     if (isRTL) {
-      leftCol = rowTds.length - opts.lastCol - 1;
-      rightCol = rowTds.length - opts.firstCol - 1;
-    }
-    else {
-      leftCol = opts.firstCol;
-      rightCol = opts.lastCol;
+      leftCol = rowTds.length - opts.lastCol - 1
+      rightCol = rowTds.length - opts.firstCol - 1
+    } else {
+      leftCol = opts.firstCol
+      rightCol = opts.lastCol
     }
     }
 
 
-    var col, td;
+    var col, td
 
 
     for (col = leftCol; col <= rightCol; col++) {
     for (col = leftCol; col <= rightCol; col++) {
-      td = rowTds.eq(col);
-      expect(el).toIntersectWith(td);
+      td = rowTds.eq(col)
+      expect(el).toIntersectWith(td)
     }
     }
 
 
     for (col = 0; col < rowTds.length; col++) {
     for (col = 0; col < rowTds.length; col++) {
       if (col < leftCol || col > rightCol) {
       if (col < leftCol || col > rightCol) {
-        td = rowTds.eq(col);
-        expect(el).not.toIntersectWith(td);
+        td = rowTds.eq(col)
+        expect(el).not.toIntersectWith(td)
       }
       }
     }
     }
 
 
     if (opts.isStart) {
     if (opts.isStart) {
-      expect(el).toHaveClass('fc-start');
-    }
-    else {
-      expect(el).not.toHaveClass('fc-start');
+      expect(el).toHaveClass('fc-start')
+    } else {
+      expect(el).not.toHaveClass('fc-start')
     }
     }
 
 
     if (opts.isEnd) {
     if (opts.isEnd) {
-      expect(el).toHaveClass('fc-end');
-    }
-    else {
-      expect(el).not.toHaveClass('fc-end');
+      expect(el).toHaveClass('fc-end')
+    } else {
+      expect(el).not.toHaveClass('fc-end')
     }
     }
   }
   }
 
 
-});
+})

+ 220 - 220
tests/legacy/ListView.js

@@ -1,13 +1,13 @@
 describe('ListView rendering', function() {
 describe('ListView rendering', function() {
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultView: 'listWeek',
       defaultView: 'listWeek',
       now: '2016-08-20'
       now: '2016-08-20'
-    };
-  });
+    }
+  })
 
 
   describe('with all-day events', function() {
   describe('with all-day events', function() {
 
 
@@ -22,36 +22,36 @@ describe('ListView rendering', function() {
             title: 'event 2',
             title: 'event 2',
             start: '2016-08-17'
             start: '2016-08-17'
           }
           }
-        ];
-      });
+        ]
+      })
 
 
       it('renders only days with events', function() {
       it('renders only days with events', function() {
-        $('#cal').fullCalendar(options);
+        $('#cal').fullCalendar(options)
 
 
-        var days = getDayInfo();
-        var events = getEventInfo();
+        var days = getDayInfo()
+        var events = getEventInfo()
 
 
-        expect(days.length).toBe(2);
-        expect(days[0].date.format()).toEqual('2016-08-15');
-        expect(days[1].date.format()).toEqual('2016-08-17');
+        expect(days.length).toBe(2)
+        expect(days[0].date.format()).toEqual('2016-08-15')
+        expect(days[1].date.format()).toEqual('2016-08-17')
 
 
-        expect(events.length).toBe(2);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('all-day');
-        expect(events[1].title).toBe('event 2');
-        expect(events[1].timeText).toBe('all-day');
-      });
+        expect(events.length).toBe(2)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('all-day')
+        expect(events[1].title).toBe('event 2')
+        expect(events[1].timeText).toBe('all-day')
+      })
 
 
       it('filters events through eventRender', function() {
       it('filters events through eventRender', function() {
         options.eventRender = function(event, el) {
         options.eventRender = function(event, el) {
-          el.find('.fc-event-dot').replaceWith('<span class="custom-icon" />');
-        };
+          el.find('.fc-event-dot').replaceWith('<span class="custom-icon" />')
+        }
 
 
-        $('#cal').fullCalendar(options);
+        $('#cal').fullCalendar(options)
 
 
-        expect($('.custom-icon').length).toBe(2);
-      });
-    });
+        expect($('.custom-icon').length).toBe(2)
+      })
+    })
 
 
     describe('when multi-day', function() {
     describe('when multi-day', function() {
       beforeEach(function() {
       beforeEach(function() {
@@ -61,24 +61,24 @@ describe('ListView rendering', function() {
             start: '2016-08-15',
             start: '2016-08-15',
             end: '2016-08-18' // 3 days
             end: '2016-08-18' // 3 days
           }
           }
-        ];
-      });
+        ]
+      })
 
 
       it('renders all-day for every day', function() {
       it('renders all-day for every day', function() {
-        $('#cal').fullCalendar(options);
+        $('#cal').fullCalendar(options)
 
 
-        var events = getEventInfo();
+        var events = getEventInfo()
 
 
-        expect(events.length).toBe(3);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('all-day');
-        expect(events[1].title).toBe('event 1');
-        expect(events[1].timeText).toBe('all-day');
-        expect(events[2].title).toBe('event 1');
-        expect(events[2].timeText).toBe('all-day');
-      });
-    });
-  });
+        expect(events.length).toBe(3)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('all-day')
+        expect(events[1].title).toBe('event 1')
+        expect(events[1].timeText).toBe('all-day')
+        expect(events[2].title).toBe('event 1')
+        expect(events[2].timeText).toBe('all-day')
+      })
+    })
+  })
 
 
   describe('with timed events', function() {
   describe('with timed events', function() {
 
 
@@ -94,75 +94,75 @@ describe('ListView rendering', function() {
             start: '2016-08-17T09:00',
             start: '2016-08-17T09:00',
             end: '2016-08-17T11:00'
             end: '2016-08-17T11:00'
           }
           }
-        ];
-      });
+        ]
+      })
 
 
       it('renders times', function() {
       it('renders times', function() {
-        $('#cal').fullCalendar(options);
+        $('#cal').fullCalendar(options)
 
 
-        var events = getEventInfo();
+        var events = getEventInfo()
 
 
-        expect(events.length).toBe(2);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('7:00am');
-        expect(events[1].title).toBe('event 2');
-        expect(events[1].timeText).toBe('9:00am - 11:00am');
-      });
+        expect(events.length).toBe(2)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('7:00am')
+        expect(events[1].title).toBe('event 2')
+        expect(events[1].timeText).toBe('9:00am - 11:00am')
+      })
 
 
       it('doesn\'t render times when displayEventTime is false', function() {
       it('doesn\'t render times when displayEventTime is false', function() {
-        options.displayEventTime = false;
-        $('#cal').fullCalendar(options);
+        options.displayEventTime = false
+        $('#cal').fullCalendar(options)
 
 
-        var events = getEventInfo();
+        var events = getEventInfo()
 
 
-        expect(events.length).toBe(2);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('');
-        expect(events[1].title).toBe('event 2');
-        expect(events[1].timeText).toBe('');
-      });
+        expect(events.length).toBe(2)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('')
+        expect(events[1].title).toBe('event 2')
+        expect(events[1].timeText).toBe('')
+      })
 
 
       it('doesn\'t render end times when displayEventEnd is false', function() {
       it('doesn\'t render end times when displayEventEnd is false', function() {
-        options.displayEventEnd = false;
-        $('#cal').fullCalendar(options);
+        options.displayEventEnd = false
+        $('#cal').fullCalendar(options)
 
 
-        var events = getEventInfo();
+        var events = getEventInfo()
 
 
-        expect(events.length).toBe(2);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('7:00am');
-        expect(events[1].title).toBe('event 2');
-        expect(events[1].timeText).toBe('9:00am');
-      });
+        expect(events.length).toBe(2)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('7:00am')
+        expect(events[1].title).toBe('event 2')
+        expect(events[1].timeText).toBe('9:00am')
+      })
 
 
       // regression test for when localized event dates get unlocalized and leak into view rendering
       // regression test for when localized event dates get unlocalized and leak into view rendering
       it('renders dates and times in locale', function() {
       it('renders dates and times in locale', function() {
-        options.locale = 'fr';
-        $('#cal').fullCalendar(options);
-
-        var days = getDayInfo();
-        var events = getEventInfo();
-
-        expect(days.length).toBe(2);
-        expect(days[0].date.format()).toEqual('2016-08-15');
-        expect(days[0].mainText).toEqual('lundi');
-        expect(days[0].altText).toEqual('15 août 2016');
-        expect(days[1].date.format()).toEqual('2016-08-17');
-        expect(days[1].mainText).toEqual('mercredi');
-        expect(days[1].altText).toEqual('17 août 2016');
-
-        expect(events.length).toBe(2);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('07:00');
-        expect(events[1].title).toBe('event 2');
-        expect(events[1].timeText).toBe('09:00 - 11:00');
-      });
-    });
+        options.locale = 'fr'
+        $('#cal').fullCalendar(options)
+
+        var days = getDayInfo()
+        var events = getEventInfo()
+
+        expect(days.length).toBe(2)
+        expect(days[0].date.format()).toEqual('2016-08-15')
+        expect(days[0].mainText).toEqual('lundi')
+        expect(days[0].altText).toEqual('15 août 2016')
+        expect(days[1].date.format()).toEqual('2016-08-17')
+        expect(days[1].mainText).toEqual('mercredi')
+        expect(days[1].altText).toEqual('17 août 2016')
+
+        expect(events.length).toBe(2)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('07:00')
+        expect(events[1].title).toBe('event 2')
+        expect(events[1].timeText).toBe('09:00 - 11:00')
+      })
+    })
 
 
     describe('when multi-day', function() {
     describe('when multi-day', function() {
       beforeEach(function() {
       beforeEach(function() {
-        options.nextDayThreshold = '00:00';
-      });
+        options.nextDayThreshold = '00:00'
+      })
 
 
       it('renders partial and full days', function() {
       it('renders partial and full days', function() {
         options.events = [
         options.events = [
@@ -171,19 +171,19 @@ describe('ListView rendering', function() {
             start: '2016-08-15T07:00',
             start: '2016-08-15T07:00',
             end: '2016-08-17T11:00'
             end: '2016-08-17T11:00'
           }
           }
-        ];
-        $('#cal').fullCalendar(options);
+        ]
+        $('#cal').fullCalendar(options)
 
 
-        var events = getEventInfo();
+        var events = getEventInfo()
 
 
-        expect(events.length).toBe(3);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('7:00am - 12:00am');
-        expect(events[1].title).toBe('event 1');
-        expect(events[1].timeText).toBe('all-day');
-        expect(events[2].title).toBe('event 1');
-        expect(events[2].timeText).toBe('12:00am - 11:00am');
-      });
+        expect(events.length).toBe(3)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('7:00am - 12:00am')
+        expect(events[1].title).toBe('event 1')
+        expect(events[1].timeText).toBe('all-day')
+        expect(events[2].title).toBe('event 1')
+        expect(events[2].timeText).toBe('12:00am - 11:00am')
+      })
 
 
       it('truncates an out-of-range start', function() {
       it('truncates an out-of-range start', function() {
         options.events = [
         options.events = [
@@ -192,19 +192,19 @@ describe('ListView rendering', function() {
             start: '2016-08-13T07:00',
             start: '2016-08-13T07:00',
             end: '2016-08-16T11:00'
             end: '2016-08-16T11:00'
           }
           }
-        ];
-        $('#cal').fullCalendar(options);
+        ]
+        $('#cal').fullCalendar(options)
 
 
-        var events = getEventInfo();
+        var events = getEventInfo()
 
 
-        expect(events.length).toBe(3);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('all-day');
-        expect(events[1].title).toBe('event 1');
-        expect(events[1].timeText).toBe('all-day');
-        expect(events[2].title).toBe('event 1');
-        expect(events[2].timeText).toBe('12:00am - 11:00am');
-      });
+        expect(events.length).toBe(3)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('all-day')
+        expect(events[1].title).toBe('event 1')
+        expect(events[1].timeText).toBe('all-day')
+        expect(events[2].title).toBe('event 1')
+        expect(events[2].timeText).toBe('12:00am - 11:00am')
+      })
 
 
       it('truncates an out-of-range start', function() {
       it('truncates an out-of-range start', function() {
         options.events = [
         options.events = [
@@ -213,65 +213,65 @@ describe('ListView rendering', function() {
             start: '2016-08-18T07:00',
             start: '2016-08-18T07:00',
             end: '2016-08-21T11:00'
             end: '2016-08-21T11:00'
           }
           }
-        ];
-        $('#cal').fullCalendar(options);
+        ]
+        $('#cal').fullCalendar(options)
 
 
-        var events = getEventInfo();
+        var events = getEventInfo()
 
 
-        expect(events.length).toBe(3);
-        expect(events[0].title).toBe('event 1');
-        expect(events[0].timeText).toBe('7:00am - 12:00am');
-        expect(events[1].title).toBe('event 1');
-        expect(events[1].timeText).toBe('all-day');
-        expect(events[2].title).toBe('event 1');
-        expect(events[2].timeText).toBe('all-day');
-      });
-    });
+        expect(events.length).toBe(3)
+        expect(events[0].title).toBe('event 1')
+        expect(events[0].timeText).toBe('7:00am - 12:00am')
+        expect(events[1].title).toBe('event 1')
+        expect(events[1].timeText).toBe('all-day')
+        expect(events[2].title).toBe('event 1')
+        expect(events[2].timeText).toBe('all-day')
+      })
+    })
 
 
     it('renders same days when equal to nextDayThreshold', function() {
     it('renders same days when equal to nextDayThreshold', function() {
-      options.nextDayThreshold = '09:00';
+      options.nextDayThreshold = '09:00'
       options.events = [
       options.events = [
         {
         {
           title: 'event 1',
           title: 'event 1',
           start: '2016-08-15T07:00',
           start: '2016-08-15T07:00',
           end: '2016-08-17T09:00'
           end: '2016-08-17T09:00'
         }
         }
-      ];
+      ]
 
 
-      $('#cal').fullCalendar(options);
+      $('#cal').fullCalendar(options)
 
 
-      var events = getEventInfo();
+      var events = getEventInfo()
 
 
-      expect(events.length).toBe(3);
-      expect(events[0].title).toBe('event 1');
-      expect(events[0].timeText).toBe('7:00am - 12:00am');
-      expect(events[1].title).toBe('event 1');
-      expect(events[1].timeText).toBe('all-day');
-      expect(events[2].title).toBe('event 1');
-      expect(events[2].timeText).toBe('12:00am - 9:00am');
-    });
+      expect(events.length).toBe(3)
+      expect(events[0].title).toBe('event 1')
+      expect(events[0].timeText).toBe('7:00am - 12:00am')
+      expect(events[1].title).toBe('event 1')
+      expect(events[1].timeText).toBe('all-day')
+      expect(events[2].title).toBe('event 1')
+      expect(events[2].timeText).toBe('12:00am - 9:00am')
+    })
 
 
     it('renders fewer days when before nextDayThreshold', function() {
     it('renders fewer days when before nextDayThreshold', function() {
-      options.nextDayThreshold = '09:00';
+      options.nextDayThreshold = '09:00'
       options.events = [
       options.events = [
         {
         {
           title: 'event 1',
           title: 'event 1',
           start: '2016-08-15T07:00',
           start: '2016-08-15T07:00',
           end: '2016-08-17T08:00'
           end: '2016-08-17T08:00'
         }
         }
-      ];
+      ]
 
 
-      $('#cal').fullCalendar(options);
+      $('#cal').fullCalendar(options)
 
 
-      var events = getEventInfo();
+      var events = getEventInfo()
 
 
-      expect(events.length).toBe(2);
-      expect(events[0].title).toBe('event 1');
-      expect(events[0].timeText).toBe('7:00am - 12:00am');
-      expect(events[1].title).toBe('event 1');
-      expect(events[1].timeText).toBe('12:00am - 8:00am');
-    });
-  });
+      expect(events.length).toBe(2)
+      expect(events[0].title).toBe('event 1')
+      expect(events[0].timeText).toBe('7:00am - 12:00am')
+      expect(events[1].title).toBe('event 1')
+      expect(events[1].timeText).toBe('12:00am - 8:00am')
+    })
+  })
 
 
   describe('when an event has no title', function() {
   describe('when an event has no title', function() {
     it('renders no text for its title', function() {
     it('renders no text for its title', function() {
@@ -279,26 +279,26 @@ describe('ListView rendering', function() {
         {
         {
           start: '2016-08-15'
           start: '2016-08-15'
         }
         }
-      ];
-      $('#cal').fullCalendar(options);
+      ]
+      $('#cal').fullCalendar(options)
 
 
-      var events = getEventInfo();
+      var events = getEventInfo()
 
 
-      expect(events.length).toBe(1);
-      expect(events[0].title).toBe('');
-      expect(events[0].timeText).toBe('all-day');
-    });
-  });
+      expect(events.length).toBe(1)
+      expect(events[0].title).toBe('')
+      expect(events[0].timeText).toBe('all-day')
+    })
+  })
 
 
   describe('when no events', function() {
   describe('when no events', function() {
     it('renders an empty message', function() {
     it('renders an empty message', function() {
-      $('#cal').fullCalendar(options);
-      expect(getIsEmptyMessage()).toBe(true);
-    });
-  });
+      $('#cal').fullCalendar(options)
+      expect(getIsEmptyMessage()).toBe(true)
+    })
+  })
 
 
   it('sorts events correctly', function() {
   it('sorts events correctly', function() {
-    options.now = '2016-08-29';
+    options.now = '2016-08-29'
     options.events = [
     options.events = [
       {
       {
         title: 'All Day Event',
         title: 'All Day Event',
@@ -338,90 +338,90 @@ describe('ListView rendering', function() {
         url: 'http://google.com/',
         url: 'http://google.com/',
         start: '2016-08-31'
         start: '2016-08-31'
       }
       }
-    ];
-
-    $('#cal').fullCalendar(options);
-
-    var days = getDayInfo();
-    var events = getEventInfo();
-
-    expect(days.length).toBe(7);
-    expect(days[0].date.format()).toEqual('2016-08-28');
-    expect(days[1].date.format()).toEqual('2016-08-29');
-    expect(days[2].date.format()).toEqual('2016-08-30');
-    expect(days[3].date.format()).toEqual('2016-08-31');
-    expect(days[4].date.format()).toEqual('2016-09-01');
-    expect(days[5].date.format()).toEqual('2016-09-02');
-    expect(days[6].date.format()).toEqual('2016-09-03');
-
-    expect(events.length).toBe(13);
-    expect(events[0].title).toBe('Long Event');
-    expect(events[0].timeText).toBe('all-day');
-    expect(events[1].title).toBe('Long Event');
-    expect(events[1].timeText).toBe('all-day');
-    expect(events[2].title).toBe('All Day Event');
-    expect(events[2].timeText).toBe('all-day');
-    expect(events[3].title).toBe('Birthday Party');
-    expect(events[3].timeText).toBe('7:00am');
-    expect(events[4].title).toBe('Meeting');
-    expect(events[4].timeText).toBe('10:30am');
-    expect(events[5].title).toBe('Long Event');
-    expect(events[5].timeText).toBe('all-day');
-    expect(events[6].title).toBe('Lunch');
-    expect(events[6].timeText).toBe('12:00pm');
-    expect(events[7].title).toBe('Meeting');
-    expect(events[7].timeText).toBe('2:30pm');
-    expect(events[8].title).toBe('Long Event');
-    expect(events[8].timeText).toBe('all-day');
-    expect(events[9].title).toBe('Click for Google');
-    expect(events[9].timeText).toBe('all-day');
-    expect(events[10].title).toBe('Long Event');
-    expect(events[10].timeText).toBe('all-day');
-    expect(events[11].title).toBe('Long Event');
-    expect(events[11].timeText).toBe('all-day');
-    expect(events[12].title).toBe('Long Event');
-    expect(events[12].timeText).toBe('all-day');
-  });
+    ]
+
+    $('#cal').fullCalendar(options)
+
+    var days = getDayInfo()
+    var events = getEventInfo()
+
+    expect(days.length).toBe(7)
+    expect(days[0].date.format()).toEqual('2016-08-28')
+    expect(days[1].date.format()).toEqual('2016-08-29')
+    expect(days[2].date.format()).toEqual('2016-08-30')
+    expect(days[3].date.format()).toEqual('2016-08-31')
+    expect(days[4].date.format()).toEqual('2016-09-01')
+    expect(days[5].date.format()).toEqual('2016-09-02')
+    expect(days[6].date.format()).toEqual('2016-09-03')
+
+    expect(events.length).toBe(13)
+    expect(events[0].title).toBe('Long Event')
+    expect(events[0].timeText).toBe('all-day')
+    expect(events[1].title).toBe('Long Event')
+    expect(events[1].timeText).toBe('all-day')
+    expect(events[2].title).toBe('All Day Event')
+    expect(events[2].timeText).toBe('all-day')
+    expect(events[3].title).toBe('Birthday Party')
+    expect(events[3].timeText).toBe('7:00am')
+    expect(events[4].title).toBe('Meeting')
+    expect(events[4].timeText).toBe('10:30am')
+    expect(events[5].title).toBe('Long Event')
+    expect(events[5].timeText).toBe('all-day')
+    expect(events[6].title).toBe('Lunch')
+    expect(events[6].timeText).toBe('12:00pm')
+    expect(events[7].title).toBe('Meeting')
+    expect(events[7].timeText).toBe('2:30pm')
+    expect(events[8].title).toBe('Long Event')
+    expect(events[8].timeText).toBe('all-day')
+    expect(events[9].title).toBe('Click for Google')
+    expect(events[9].timeText).toBe('all-day')
+    expect(events[10].title).toBe('Long Event')
+    expect(events[10].timeText).toBe('all-day')
+    expect(events[11].title).toBe('Long Event')
+    expect(events[11].timeText).toBe('all-day')
+    expect(events[12].title).toBe('Long Event')
+    expect(events[12].timeText).toBe('all-day')
+  })
 
 
   it('updates rendered events despite fetch range being lazy', function() {
   it('updates rendered events despite fetch range being lazy', function() {
-    options.now = '2016-09-12';
-    options.defaultView = 'month';
+    options.now = '2016-09-12'
+    options.defaultView = 'month'
     options.events = [
     options.events = [
       { title: 'event1', start: '2016-09-12' }
       { title: 'event1', start: '2016-09-12' }
-    ];
+    ]
 
 
-    $('#cal').fullCalendar(options);
-    $('#cal').fullCalendar('changeView', 'listWeek');
+    $('#cal').fullCalendar(options)
+    $('#cal').fullCalendar('changeView', 'listWeek')
 
 
-    expect($('.fc-list-item').length).toBe(1);
+    expect($('.fc-list-item').length).toBe(1)
 
 
-    $('#cal').fullCalendar('prev');
+    $('#cal').fullCalendar('prev')
 
 
-    expect($('.fc-list-item').length).toBe(0);
-  });
+    expect($('.fc-list-item').length).toBe(0)
+  })
 
 
   function getDayInfo() {
   function getDayInfo() {
     return $('.fc-list-heading').map(function(i, el) {
     return $('.fc-list-heading').map(function(i, el) {
-      el = $(el);
+      el = $(el)
       return {
       return {
         mainText: el.find('.fc-list-heading-main').text() || '',
         mainText: el.find('.fc-list-heading-main').text() || '',
         altText: el.find('.fc-list-heading-alt').text() || '',
         altText: el.find('.fc-list-heading-alt').text() || '',
         date: $.fullCalendar.moment(el.data('date'))
         date: $.fullCalendar.moment(el.data('date'))
-      };
-    }).get();
+      }
+    }).get()
   }
   }
 
 
   function getEventInfo() { // gets all *segments*
   function getEventInfo() { // gets all *segments*
     return $('.fc-list-item').map(function(i, el) {
     return $('.fc-list-item').map(function(i, el) {
-      el = $(el);
+      el = $(el)
       return {
       return {
         title: el.find('.fc-list-item-title').text() || '', // text!
         title: el.find('.fc-list-item-title').text() || '', // text!
         timeText: el.find('.fc-list-item-time').text() || '' // text!
         timeText: el.find('.fc-list-item-time').text() || '' // text!
-      };
-    }).get();
+      }
+    }).get()
   }
   }
 
 
   function getIsEmptyMessage() {
   function getIsEmptyMessage() {
-    return Boolean($('.fc-list-empty').length);
+    return Boolean($('.fc-list-empty').length)
   }
   }
-});
+})

+ 24 - 24
tests/legacy/TimeGrid-events.js

@@ -5,7 +5,7 @@ describe('TimeGrid event rendering', function() {
     defaultDate: '2014-08-23',
     defaultDate: '2014-08-23',
     defaultView: 'agendaWeek',
     defaultView: 'agendaWeek',
     scrollTime: '00:00:00'
     scrollTime: '00:00:00'
-  });
+  })
 
 
   it('renders the start and end time of an event that spans only 1 day', function() {
   it('renders the start and end time of an event that spans only 1 day', function() {
     initCalendar({
     initCalendar({
@@ -14,9 +14,9 @@ describe('TimeGrid event rendering', function() {
         start: '2014-08-18T02:00:00',
         start: '2014-08-18T02:00:00',
         end: '2014-08-18T22:00:00'
         end: '2014-08-18T22:00:00'
       } ]
       } ]
-    });
-    expect('.fc-event .fc-time').toHaveText('2:00 - 10:00');
-  });
+    })
+    expect('.fc-event .fc-time').toHaveText('2:00 - 10:00')
+  })
 
 
   it('renders time to/from midnight for an event that spans two days', function() {
   it('renders time to/from midnight for an event that spans two days', function() {
     initCalendar({
     initCalendar({
@@ -25,12 +25,12 @@ describe('TimeGrid event rendering', function() {
         start: '2014-08-18T02:00:00',
         start: '2014-08-18T02:00:00',
         end: '2014-08-19T22:00:00'
         end: '2014-08-19T22:00:00'
       } ]
       } ]
-    });
-    var seg1 = $('.fc-event:eq(0)');
-    var seg2 = $('.fc-event:eq(1)');
-    expect(seg1.find('.fc-time')).toHaveText('2:00 - 12:00');
-    expect(seg2.find('.fc-time')).toHaveText('12:00 - 10:00');
-  });
+    })
+    var seg1 = $('.fc-event:eq(0)')
+    var seg2 = $('.fc-event:eq(1)')
+    expect(seg1.find('.fc-time')).toHaveText('2:00 - 12:00')
+    expect(seg2.find('.fc-time')).toHaveText('12:00 - 10:00')
+  })
 
 
   it('renders no time on an event segment that spans through an entire day', function() {
   it('renders no time on an event segment that spans through an entire day', function() {
     initCalendar({
     initCalendar({
@@ -39,11 +39,11 @@ describe('TimeGrid event rendering', function() {
         start: '2014-08-18T02:00:00',
         start: '2014-08-18T02:00:00',
         end: '2014-08-20T22:00:00'
         end: '2014-08-20T22:00:00'
       } ]
       } ]
-    });
-    var seg2 = $('.fc-event:eq(1)');
-    expect(seg2).toBeInDOM();
-    expect(seg2.find('.fc-time')).not.toBeInDOM();
-  });
+    })
+    var seg2 = $('.fc-event:eq(1)')
+    expect(seg2).toBeInDOM()
+    expect(seg2.find('.fc-time')).not.toBeInDOM()
+  })
 
 
   it('renders an event with no url with no <a> href', function() {
   it('renders an event with no url with no <a> href', function() {
     initCalendar({
     initCalendar({
@@ -51,10 +51,10 @@ describe('TimeGrid event rendering', function() {
         title: 'event1',
         title: 'event1',
         start: '2014-08-18T02:00:00'
         start: '2014-08-18T02:00:00'
       } ]
       } ]
-    });
-    var seg = $('.fc-event');
-    expect(seg).not.toHaveAttr('href');
-  });
+    })
+    var seg = $('.fc-event')
+    expect(seg).not.toHaveAttr('href')
+  })
 
 
   it('renders an event with a url with an <a> href', function() {
   it('renders an event with a url with an <a> href', function() {
     initCalendar({
     initCalendar({
@@ -63,9 +63,9 @@ describe('TimeGrid event rendering', function() {
         start: '2014-08-18T02:00:00',
         start: '2014-08-18T02:00:00',
         url: 'http://google.com/'
         url: 'http://google.com/'
       } ]
       } ]
-    });
-    var seg = $('.fc-event');
-    expect(seg).toHaveAttr('href');
-  });
+    })
+    var seg = $('.fc-event')
+    expect(seg).toHaveAttr('href')
+  })
 
 
-});
+})

+ 12 - 12
tests/legacy/View.js

@@ -6,24 +6,24 @@ describe('View object', function() {
 
 
   pushOptions({
   pushOptions({
     defaultDate: '2015-01-01'
     defaultDate: '2015-01-01'
-  });
+  })
 
 
   describe('title', function() {
   describe('title', function() {
 
 
     it('is a correctly defined string', function() {
     it('is a correctly defined string', function() {
-      initCalendar();
-      var view = currentCalendar.getView();
-      expect(view.title).toBe('January 2015');
-    });
+      initCalendar()
+      var view = currentCalendar.getView()
+      expect(view.title).toBe('January 2015')
+    })
 
 
     it('is available in the viewRender callback', function() {
     it('is available in the viewRender callback', function() {
       var viewRenderSpy = spyOnCalendarCallback('viewRender', function(view) {
       var viewRenderSpy = spyOnCalendarCallback('viewRender', function(view) {
-        expect(view.title).toBe('January 2015');
-      });
-      initCalendar();
-      expect(viewRenderSpy).toHaveBeenCalled();
-    });
+        expect(view.title).toBe('January 2015')
+      })
+      initCalendar()
+      expect(viewRenderSpy).toHaveBeenCalled()
+    })
 
 
-  });
+  })
 
 
-});
+})

+ 36 - 36
tests/legacy/addEventSource.js

@@ -1,37 +1,37 @@
-describe('addEventSource', function() { 
+describe('addEventSource', function() {
   var eventArray = [
   var eventArray = [
     { id: 0, title: 'event zero', start: '2014-06-24', className: 'event-zero' },
     { id: 0, title: 'event zero', start: '2014-06-24', className: 'event-zero' },
     { id: 1, title: 'event one', start: '2014-06-24', className: 'event-non-zero event-one' },
     { id: 1, title: 'event one', start: '2014-06-24', className: 'event-non-zero event-one' },
     { id: 2, title: 'event two', start: '2014-06-24', className: 'event-non-zero event-two' }
     { id: 2, title: 'event two', start: '2014-06-24', className: 'event-non-zero event-two' }
-  ];
+  ]
 
 
   pushOptions({
   pushOptions({
     defaultDate: '2014-06-24',
     defaultDate: '2014-06-24',
     defaultView: 'month'
     defaultView: 'month'
-  });
+  })
 
 
 
 
   it('correctly adds an array source', function(done) {
   it('correctly adds an array source', function(done) {
     go(
     go(
       function() {
       function() {
-        currentCalendar.addEventSource(eventArray);
+        currentCalendar.addEventSource(eventArray)
       },
       },
       null,
       null,
       done
       done
-    );
-  });
+    )
+  })
 
 
   it('correctly adds a function source', function(done) {
   it('correctly adds a function source', function(done) {
     go(
     go(
       function() {
       function() {
         currentCalendar.addEventSource(function(start, end, timezone, callback) {
         currentCalendar.addEventSource(function(start, end, timezone, callback) {
-          callback(eventArray);
-        });
+          callback(eventArray)
+        })
       },
       },
       null,
       null,
       done
       done
-    );
-  });
+    )
+  })
 
 
   it('correctly adds an extended array source', function(done) {
   it('correctly adds an extended array source', function(done) {
     go(
     go(
@@ -39,14 +39,14 @@ describe('addEventSource', function() {
         currentCalendar.addEventSource({
         currentCalendar.addEventSource({
           className: 'arraysource',
           className: 'arraysource',
           events: eventArray
           events: eventArray
-        });
+        })
       },
       },
       function() {
       function() {
-        expect($('.arraysource').length).toEqual(3);
+        expect($('.arraysource').length).toEqual(3)
       },
       },
       done
       done
-    );
-  });
+    )
+  })
 
 
   it('correctly adds an extended array source', function(done) {
   it('correctly adds an extended array source', function(done) {
     go(
     go(
@@ -54,57 +54,57 @@ describe('addEventSource', function() {
         currentCalendar.addEventSource({
         currentCalendar.addEventSource({
           className: 'funcsource',
           className: 'funcsource',
           events: function(start, end, timezone, callback) {
           events: function(start, end, timezone, callback) {
-            callback(eventArray);
+            callback(eventArray)
           }
           }
-        });
+        })
       },
       },
       function() {
       function() {
-        expect($('.funcsource').length).toEqual(3);
+        expect($('.funcsource').length).toEqual(3)
       },
       },
       done
       done
-    );
-  });
+    )
+  })
 
 
 
 
   function go(addFunc, extraTestFunc, doneFunc) {
   function go(addFunc, extraTestFunc, doneFunc) {
-    var callCnt = 0;
-    var options = {};
+    var callCnt = 0
+    var options = {}
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      callCnt++;
+      callCnt++
       if (callCnt == 2) { // once for initial render. second time for addEventSource
       if (callCnt == 2) { // once for initial render. second time for addEventSource
-        called = true;
+        called = true
 
 
-        checkAllEvents();
+        checkAllEvents()
         if (extraTestFunc) {
         if (extraTestFunc) {
-          extraTestFunc();
+          extraTestFunc()
         }
         }
 
 
         // move the calendar back out of view, then back in (for issue 2191)
         // move the calendar back out of view, then back in (for issue 2191)
-        currentCalendar.next();
-        currentCalendar.prev();
+        currentCalendar.next()
+        currentCalendar.prev()
 
 
         // otherwise, prev/next would be cancelled out by doneFunc's calendar destroy
         // otherwise, prev/next would be cancelled out by doneFunc's calendar destroy
         setTimeout(function() {
         setTimeout(function() {
 
 
-          checkAllEvents();
+          checkAllEvents()
           if (extraTestFunc) {
           if (extraTestFunc) {
-            extraTestFunc();
+            extraTestFunc()
           }
           }
 
 
-          doneFunc();
+          doneFunc()
         }, 0)
         }, 0)
       }
       }
-    };
+    }
 
 
-    initCalendar(options);
-    addFunc();
+    initCalendar(options)
+    addFunc()
   }
   }
 
 
   // Checks to make sure all events have been rendered and that the calendar
   // Checks to make sure all events have been rendered and that the calendar
   // has internal info on all the events.
   // has internal info on all the events.
   function checkAllEvents() {
   function checkAllEvents() {
-    expect(currentCalendar.clientEvents().length).toEqual(3);
-    expect($('.fc-event').length).toEqual(3);
+    expect(currentCalendar.clientEvents().length).toEqual(3)
+    expect($('.fc-event').length).toEqual(3)
   }
   }
 
 
-});
+})

+ 30 - 30
tests/legacy/agenda-view.js

@@ -2,8 +2,8 @@
 describe('agenda view rendering', function() {
 describe('agenda view rendering', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-  });
+    affix('#cal')
+  })
 
 
   describe('when isRTL is false', function() {
   describe('when isRTL is false', function() {
 
 
@@ -11,21 +11,21 @@ describe('agenda view rendering', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         defaultView: 'agendaWeek',
         defaultView: 'agendaWeek',
         isRTL: false
         isRTL: false
-      });
-    });
+      })
+    })
 
 
     it('should have have days ordered sun to sat', function() {
     it('should have have days ordered sun to sat', function() {
-      var fc = $('#cal').find('.fc-view > table > thead th');
-      expect(fc[0]).toHaveClass('fc-axis');
-      expect(fc[1]).toHaveClass('fc-sun');
-      expect(fc[2]).toHaveClass('fc-mon');
-      expect(fc[3]).toHaveClass('fc-tue');
-      expect(fc[4]).toHaveClass('fc-wed');
-      expect(fc[5]).toHaveClass('fc-thu');
-      expect(fc[6]).toHaveClass('fc-fri');
-      expect(fc[7]).toHaveClass('fc-sat');
-    });
-  });
+      var fc = $('#cal').find('.fc-view > table > thead th')
+      expect(fc[0]).toHaveClass('fc-axis')
+      expect(fc[1]).toHaveClass('fc-sun')
+      expect(fc[2]).toHaveClass('fc-mon')
+      expect(fc[3]).toHaveClass('fc-tue')
+      expect(fc[4]).toHaveClass('fc-wed')
+      expect(fc[5]).toHaveClass('fc-thu')
+      expect(fc[6]).toHaveClass('fc-fri')
+      expect(fc[7]).toHaveClass('fc-sat')
+    })
+  })
 
 
   describe('when isRTL is true', function() {
   describe('when isRTL is true', function() {
 
 
@@ -33,20 +33,20 @@ describe('agenda view rendering', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         defaultView: 'agendaWeek',
         defaultView: 'agendaWeek',
         isRTL: true
         isRTL: true
-      });
-    });
+      })
+    })
 
 
     it('should have have days ordered sat to sun', function() {
     it('should have have days ordered sat to sun', function() {
-      var fc = $('#cal').find('.fc-view > table > thead th');
-      expect(fc[0]).toHaveClass('fc-sat');
-      expect(fc[1]).toHaveClass('fc-fri');
-      expect(fc[2]).toHaveClass('fc-thu');
-      expect(fc[3]).toHaveClass('fc-wed');
-      expect(fc[4]).toHaveClass('fc-tue');
-      expect(fc[5]).toHaveClass('fc-mon');
-      expect(fc[6]).toHaveClass('fc-sun');
-      expect(fc[7]).toHaveClass('fc-axis');
-    });
-  });
-
-});
+      var fc = $('#cal').find('.fc-view > table > thead th')
+      expect(fc[0]).toHaveClass('fc-sat')
+      expect(fc[1]).toHaveClass('fc-fri')
+      expect(fc[2]).toHaveClass('fc-thu')
+      expect(fc[3]).toHaveClass('fc-wed')
+      expect(fc[4]).toHaveClass('fc-tue')
+      expect(fc[5]).toHaveClass('fc-mon')
+      expect(fc[6]).toHaveClass('fc-sun')
+      expect(fc[7]).toHaveClass('fc-axis')
+    })
+  })
+
+})

+ 56 - 56
tests/legacy/allDayDefault.js

@@ -2,8 +2,8 @@
 describe('allDayDefault', function() {
 describe('allDayDefault', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-  });
+    affix('#cal')
+  })
 
 
   describe('when undefined', function() {
   describe('when undefined', function() {
 
 
@@ -15,10 +15,10 @@ describe('allDayDefault', function() {
             start: '2014-05-01T06:00:00'
             start: '2014-05-01T06:00:00'
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(false);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(false)
+    })
 
 
     it('guesses false if T in ISO8601 end date', function() {
     it('guesses false if T in ISO8601 end date', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
@@ -29,10 +29,10 @@ describe('allDayDefault', function() {
             end: '2014-05-01T08:00:00'
             end: '2014-05-01T08:00:00'
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(false);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(false)
+    })
 
 
     it('guesses true if ISO8601 start date with no time and unspecified end date', function() {
     it('guesses true if ISO8601 start date with no time and unspecified end date', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
@@ -42,10 +42,10 @@ describe('allDayDefault', function() {
             start: '2014-05-01'
             start: '2014-05-01'
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(true);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(true)
+    })
 
 
     it('guesses true if ISO8601 start and end date with no times', function() {
     it('guesses true if ISO8601 start and end date with no times', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
@@ -56,10 +56,10 @@ describe('allDayDefault', function() {
             end: '2014-05-03'
             end: '2014-05-03'
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(true);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(true)
+    })
 
 
     it('guesses false if start is a unix timestamp (which implies it has a time)', function() {
     it('guesses false if start is a unix timestamp (which implies it has a time)', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
@@ -70,10 +70,10 @@ describe('allDayDefault', function() {
             end: '2014-05-03'
             end: '2014-05-03'
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(false);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(false)
+    })
 
 
     it('guesses false if end is a unix timestamp (which implies it has a time)', function() {
     it('guesses false if end is a unix timestamp (which implies it has a time)', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
@@ -84,12 +84,12 @@ describe('allDayDefault', function() {
             end: 1399075200000
             end: 1399075200000
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(false);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(false)
+    })
 
 
-  });
+  })
 
 
   describe('when specified', function() {
   describe('when specified', function() {
 
 
@@ -102,10 +102,10 @@ describe('allDayDefault', function() {
             start: '2014-05-01'
             start: '2014-05-01'
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(false);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(false)
+    })
 
 
     it('has no effect when an event\'s allDay is specified', function() {
     it('has no effect when an event\'s allDay is specified', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
@@ -117,20 +117,20 @@ describe('allDayDefault', function() {
             allDay: true
             allDay: true
           }
           }
         ]
         ]
-      });
-      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-      expect(eventObj.allDay).toEqual(true);
-    });
+      })
+      var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+      expect(eventObj.allDay).toEqual(true)
+    })
 
 
-  });
+  })
 
 
-});
+})
 
 
 describe('source.allDayDefault', function() {
 describe('source.allDayDefault', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-  });
+    affix('#cal')
+  })
 
 
   it('has an effect when an event\'s allDay is not specified', function() {
   it('has an effect when an event\'s allDay is not specified', function() {
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
@@ -145,10 +145,10 @@ describe('source.allDayDefault', function() {
           ]
           ]
         }
         }
       ]
       ]
-    });
-    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-    expect(eventObj.allDay).toEqual(false);
-  });
+    })
+    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+    expect(eventObj.allDay).toEqual(false)
+  })
 
 
   it('a true value can override the global allDayDefault', function() {
   it('a true value can override the global allDayDefault', function() {
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
@@ -164,10 +164,10 @@ describe('source.allDayDefault', function() {
           ]
           ]
         }
         }
       ]
       ]
-    });
-    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-    expect(eventObj.allDay).toEqual(true);
-  });
+    })
+    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+    expect(eventObj.allDay).toEqual(true)
+  })
 
 
   it('a false value can override the global allDayDefault', function() {
   it('a false value can override the global allDayDefault', function() {
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
@@ -183,10 +183,10 @@ describe('source.allDayDefault', function() {
           ]
           ]
         }
         }
       ]
       ]
-    });
-    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-    expect(eventObj.allDay).toEqual(false);
-  });
+    })
+    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+    expect(eventObj.allDay).toEqual(false)
+  })
 
 
   it('has no effect when an event\'s allDay is specified', function() {
   it('has no effect when an event\'s allDay is specified', function() {
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
@@ -202,9 +202,9 @@ describe('source.allDayDefault', function() {
           ]
           ]
         }
         }
       ]
       ]
-    });
-    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0];
-    expect(eventObj.allDay).toEqual(false);
-  });
+    })
+    var eventObj = $('#cal').fullCalendar('clientEvents', '1')[0]
+    expect(eventObj.allDay).toEqual(false)
+  })
 
 
-});
+})

+ 40 - 40
tests/legacy/allDaySlot.js

@@ -6,23 +6,23 @@ describe('allDaySlots', function() {
       it('should default to having an allDaySlots table', function() {
       it('should default to having an allDaySlots table', function() {
         var options = {
         var options = {
           defaultView: 'agendaWeek'
           defaultView: 'agendaWeek'
-        };
-        initCalendar(options);
-        var allDaySlotCount = $('.fc-day-grid').length;
-        expect(allDaySlotCount).toEqual(1);
-      });
-    });
+        }
+        initCalendar(options)
+        var allDaySlotCount = $('.fc-day-grid').length
+        expect(allDaySlotCount).toEqual(1)
+      })
+    })
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should default to having an allDaySlots table', function() {
       it('should default to having an allDaySlots table', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay'
           defaultView: 'agendaDay'
-        };
-        initCalendar(options);
-        var allDaySlotCount = $('.fc-day-grid').length;
-        expect(allDaySlotCount).toEqual(1);
-      });
-    });
-  });
+        }
+        initCalendar(options)
+        var allDaySlotCount = $('.fc-day-grid').length
+        expect(allDaySlotCount).toEqual(1)
+      })
+    })
+  })
 
 
   describe('when allDaySlots is set true', function() {
   describe('when allDaySlots is set true', function() {
     describe('in agendaWeek', function() {
     describe('in agendaWeek', function() {
@@ -30,24 +30,24 @@ describe('allDaySlots', function() {
         var options = {
         var options = {
           defaultView: 'agendaWeek',
           defaultView: 'agendaWeek',
           allDaySlot: true
           allDaySlot: true
-        };
-        initCalendar(options);
-        var allDaySlotCount = $('.fc-day-grid').length;
-        expect(allDaySlotCount).toEqual(1);
-      });
-    });
+        }
+        initCalendar(options)
+        var allDaySlotCount = $('.fc-day-grid').length
+        expect(allDaySlotCount).toEqual(1)
+      })
+    })
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should default to having an allDaySlots table', function() {
       it('should default to having an allDaySlots table', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay',
           defaultView: 'agendaDay',
           allDaySlot: true
           allDaySlot: true
-        };
-        initCalendar(options);
-        var allDaySlotCount = $('.fc-day-grid').length;
-        expect(allDaySlotCount).toEqual(1);
-      });
-    });
-  });
+        }
+        initCalendar(options)
+        var allDaySlotCount = $('.fc-day-grid').length
+        expect(allDaySlotCount).toEqual(1)
+      })
+    })
+  })
 
 
   describe('when allDaySlots is set false', function() {
   describe('when allDaySlots is set false', function() {
     describe('in agendaWeek', function() {
     describe('in agendaWeek', function() {
@@ -55,22 +55,22 @@ describe('allDaySlots', function() {
         var options = {
         var options = {
           defaultView: 'agendaWeek',
           defaultView: 'agendaWeek',
           allDaySlot: false
           allDaySlot: false
-        };
-        initCalendar(options);
-        var allDaySlotCount = $('.fc-day-grid').length;
-        expect(allDaySlotCount).toEqual(0);
-      });
-    });
+        }
+        initCalendar(options)
+        var allDaySlotCount = $('.fc-day-grid').length
+        expect(allDaySlotCount).toEqual(0)
+      })
+    })
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should default to having an allDaySlots table', function() {
       it('should default to having an allDaySlots table', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay',
           defaultView: 'agendaDay',
           allDaySlot: false
           allDaySlot: false
-        };
-        initCalendar(options);
-        var allDaySlotCount = $('.fc-day-grid').length;
-        expect(allDaySlotCount).toEqual(0);
-      });
-    });
-  });
-});
+        }
+        initCalendar(options)
+        var allDaySlotCount = $('.fc-day-grid').length
+        expect(allDaySlotCount).toEqual(0)
+      })
+    })
+  })
+})

+ 53 - 53
tests/legacy/allDayText.js

@@ -6,23 +6,23 @@ describe('allDayText', function() {
       it('should default allDayText to using \'all-day\'', function() {
       it('should default allDayText to using \'all-day\'', function() {
         var options = {
         var options = {
           defaultView: 'agendaWeek'
           defaultView: 'agendaWeek'
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('all-day');
-      });
-    });
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('all-day')
+      })
+    })
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should default allDayText to using \'all-day\'', function() {
       it('should default allDayText to using \'all-day\'', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay'
           defaultView: 'agendaDay'
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('all-day');
-      });
-    });
-  });
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('all-day')
+      })
+    })
+  })
 
 
   describe('when allDaySlots is set true', function() {
   describe('when allDaySlots is set true', function() {
     describe('in agendaWeek', function() {
     describe('in agendaWeek', function() {
@@ -30,24 +30,24 @@ describe('allDayText', function() {
         var options = {
         var options = {
           defaultView: 'agendaWeek',
           defaultView: 'agendaWeek',
           allDaySlot: true
           allDaySlot: true
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('all-day');
-      });
-    });
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('all-day')
+      })
+    })
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should default allDayText to using \'all-day\'', function() {
       it('should default allDayText to using \'all-day\'', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay',
           defaultView: 'agendaDay',
           allDaySlot: true
           allDaySlot: true
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('all-day');
-      });
-    });
-  });
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('all-day')
+      })
+    })
+  })
 
 
   describe('when allDaySlots is set true and locale is not default', function() {
   describe('when allDaySlots is set true and locale is not default', function() {
     describe('in agendaWeek', function() {
     describe('in agendaWeek', function() {
@@ -56,25 +56,25 @@ describe('allDayText', function() {
           defaultView: 'agendaWeek',
           defaultView: 'agendaWeek',
           allDaySlot: true,
           allDaySlot: true,
           locale: 'pt-br'
           locale: 'pt-br'
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('dia inteiro');
-      });
-    });
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('dia inteiro')
+      })
+    })
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should use the locale\'s all-day value', function() {
       it('should use the locale\'s all-day value', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay',
           defaultView: 'agendaDay',
           allDaySlot: true,
           allDaySlot: true,
           locale: 'pt-br'
           locale: 'pt-br'
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('dia inteiro');
-      });
-    });
-  });
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('dia inteiro')
+      })
+    })
+  })
 
 
   describe('when allDaySlots is set true and allDayText is specified', function() {
   describe('when allDaySlots is set true and allDayText is specified', function() {
     describe('in agendaWeek', function() {
     describe('in agendaWeek', function() {
@@ -83,22 +83,22 @@ describe('allDayText', function() {
           defaultView: 'agendaWeek',
           defaultView: 'agendaWeek',
           allDaySlot: true,
           allDaySlot: true,
           allDayText: 'axis-phosy'
           allDayText: 'axis-phosy'
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('axis-phosy');
-      });
-    });
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('axis-phosy')
+      })
+    })
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should show specified all day text', function() {
       it('should show specified all day text', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay',
           defaultView: 'agendaDay',
           allDayText: 'axis-phosy'
           allDayText: 'axis-phosy'
-        };
-        initCalendar(options);
-        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
-        expect(allDayText).toEqual('axis-phosy');
-      });
-    });
-  });
-});
+        }
+        initCalendar(options)
+        var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text()
+        expect(allDayText).toEqual('axis-phosy')
+      })
+    })
+  })
+})

+ 86 - 86
tests/legacy/aspectRatio.js

@@ -2,163 +2,163 @@
 describe('aspectRatio', function() {
 describe('aspectRatio', function() {
 
 
   function getCalendarElement(width) {
   function getCalendarElement(width) {
-    return $('<div id="calendar">').appendTo('body').width(width)[0];
+    return $('<div id="calendar">').appendTo('body').width(width)[0]
   }
   }
 
 
   describe('when default settings are used', function() {
   describe('when default settings are used', function() {
 
 
-    var elementWidth = 675;
+    var elementWidth = 675
 
 
     it('fc-content should use the ratio 1:35 to set height', function() {
     it('fc-content should use the ratio 1:35 to set height', function() {
-      initCalendar({}, getCalendarElement(elementWidth));
-      var height = $('.fc-view-container').height();
-      expect(Math.round(height)).toEqual(500);
-    });
+      initCalendar({}, getCalendarElement(elementWidth))
+      var height = $('.fc-view-container').height()
+      expect(Math.round(height)).toEqual(500)
+    })
 
 
     it('fc-content should have width of div', function() {
     it('fc-content should have width of div', function() {
-      initCalendar({}, getCalendarElement(elementWidth));
-      var width = $('.fc-view-container').width();
-      expect(Math.round(width)).toEqual(elementWidth);
-    });
+      initCalendar({}, getCalendarElement(elementWidth))
+      var width = $('.fc-view-container').width()
+      expect(Math.round(width)).toEqual(elementWidth)
+    })
 
 
-  });
+  })
 
 
   describe('when initializing the aspectRatio', function() {
   describe('when initializing the aspectRatio', function() {
 
 
-    var elementWidth = 1000;
+    var elementWidth = 1000
 
 
     describe('to 2', function() {
     describe('to 2', function() {
 
 
       pushOptions({
       pushOptions({
         aspectRatio: 2
         aspectRatio: 2
-      });
+      })
 
 
       it('should not change the width', function() {
       it('should not change the width', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        expect(Math.round(width)).toEqual(elementWidth);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        expect(Math.round(width)).toEqual(elementWidth)
+      })
 
 
       it('should set the height to width sizes very close to ratio of 2', function() {
       it('should set the height to width sizes very close to ratio of 2', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        var height = $('.fc-view-container').height();
-        var ratio = Math.round(width / height * 100);
-        expect(Math.round(ratio)).toEqual(200);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        var height = $('.fc-view-container').height()
+        var ratio = Math.round(width / height * 100)
+        expect(Math.round(ratio)).toEqual(200)
+      })
 
 
-    });
+    })
 
 
     describe('to 1', function() {
     describe('to 1', function() {
 
 
       pushOptions({
       pushOptions({
         aspectRatio: 1
         aspectRatio: 1
-      });
+      })
 
 
       it('should not change the width', function() {
       it('should not change the width', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        expect(Math.round(width)).toEqual(elementWidth);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        expect(Math.round(width)).toEqual(elementWidth)
+      })
 
 
       it('should set the height to width sizes very close to ratio of 2', function() {
       it('should set the height to width sizes very close to ratio of 2', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        var height = $('.fc-view-container').height();
-        var ratio = Math.round(width / height * 100);
-        expect(Math.round(ratio)).toEqual(100);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        var height = $('.fc-view-container').height()
+        var ratio = Math.round(width / height * 100)
+        expect(Math.round(ratio)).toEqual(100)
+      })
 
 
-    });
+    })
 
 
     describe('to less than 0.5', function() {
     describe('to less than 0.5', function() {
 
 
       pushOptions({
       pushOptions({
         aspectRatio: 0.4
         aspectRatio: 0.4
-      });
+      })
 
 
       it('should not change the width', function() {
       it('should not change the width', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        expect(Math.round(width)).toEqual(elementWidth);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        expect(Math.round(width)).toEqual(elementWidth)
+      })
 
 
       it('should set the height to width ratio to 0.5', function() {
       it('should set the height to width ratio to 0.5', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        var height = $('.fc-view-container').height();
-        var ratio = Math.round(width / height * 100);
-        expect(Math.round(ratio)).toEqual(50);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        var height = $('.fc-view-container').height()
+        var ratio = Math.round(width / height * 100)
+        expect(Math.round(ratio)).toEqual(50)
+      })
 
 
-    });
+    })
 
 
     describe('to negative', function() {
     describe('to negative', function() {
 
 
       pushOptions({
       pushOptions({
         aspectRatio: -2
         aspectRatio: -2
-      });
+      })
 
 
       it('should not change the width', function() {
       it('should not change the width', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        expect(Math.round(width)).toEqual(elementWidth);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        expect(Math.round(width)).toEqual(elementWidth)
+      })
 
 
       it('should set the height to width ratio to 0.5', function() {
       it('should set the height to width ratio to 0.5', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        var height = $('.fc-view-container').height();
-        var ratio = Math.round(width / height * 100);
-        expect(Math.round(ratio)).toEqual(50);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        var height = $('.fc-view-container').height()
+        var ratio = Math.round(width / height * 100)
+        expect(Math.round(ratio)).toEqual(50)
+      })
 
 
-    });
+    })
 
 
     describe('to zero', function() {
     describe('to zero', function() {
 
 
       pushOptions({
       pushOptions({
         aspectRatio: 0
         aspectRatio: 0
-      });
+      })
 
 
       it('should not change the width', function() {
       it('should not change the width', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        expect(Math.round(width)).toEqual(elementWidth);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        expect(Math.round(width)).toEqual(elementWidth)
+      })
 
 
       it('should set the height to width ratio to 0.5', function() {
       it('should set the height to width ratio to 0.5', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        var height = $('.fc-view-container').height();
-        var ratio = Math.round(width / height * 100);
-        expect(Math.round(ratio)).toEqual(50);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        var height = $('.fc-view-container').height()
+        var ratio = Math.round(width / height * 100)
+        expect(Math.round(ratio)).toEqual(50)
+      })
 
 
-    });
+    })
 
 
     describe('to very large', function() {
     describe('to very large', function() {
 
 
       pushOptions({
       pushOptions({
         aspectRatio: 4000
         aspectRatio: 4000
-      });
+      })
 
 
       it('should not change the width', function() {
       it('should not change the width', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var width = $('.fc-view-container').width();
-        expect(Math.round(width)).toEqual(elementWidth);
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var width = $('.fc-view-container').width()
+        expect(Math.round(width)).toEqual(elementWidth)
+      })
 
 
       it('should cause rows to be natural height', function() {
       it('should cause rows to be natural height', function() {
-        initCalendar({}, getCalendarElement(elementWidth));
-        var actualHeight = $('.fc-view-container').height();
-        $('tr.fc-week td:first-child > div').css('min-height', '').css('background', 'red');
-        var naturalHeight = $('.fc-view-container').height();
-        expect(Math.round(actualHeight)).toEqual(Math.round(naturalHeight));
-      });
+        initCalendar({}, getCalendarElement(elementWidth))
+        var actualHeight = $('.fc-view-container').height()
+        $('tr.fc-week td:first-child > div').css('min-height', '').css('background', 'red')
+        var naturalHeight = $('.fc-view-container').height()
+        expect(Math.round(actualHeight)).toEqual(Math.round(naturalHeight))
+      })
 
 
-    });
+    })
 
 
-  });
+  })
 
 
-});
+})

Разница между файлами не показана из-за своего большого размера
+ 373 - 373
tests/legacy/background-events.js


+ 27 - 27
tests/legacy/basic-view.js

@@ -3,44 +3,44 @@ describe('basic view rendering', function() {
 
 
   pushOptions({
   pushOptions({
     defaultView: 'month'
     defaultView: 'month'
-  });
+  })
 
 
   describe('when isRTL is false', function() {
   describe('when isRTL is false', function() {
 
 
     pushOptions({
     pushOptions({
       isRTL: false
       isRTL: false
-    });
+    })
 
 
     it('should have days ordered sun to sat', function() {
     it('should have days ordered sun to sat', function() {
-      initCalendar();
-      var fc = $(currentCalendar.el).find('.fc-day-header');
-      expect(fc[0]).toHaveClass('fc-sun');
-      expect(fc[1]).toHaveClass('fc-mon');
-      expect(fc[2]).toHaveClass('fc-tue');
-      expect(fc[3]).toHaveClass('fc-wed');
-      expect(fc[4]).toHaveClass('fc-thu');
-      expect(fc[5]).toHaveClass('fc-fri');
-      expect(fc[6]).toHaveClass('fc-sat');
-    });
-  });
+      initCalendar()
+      var fc = $(currentCalendar.el).find('.fc-day-header')
+      expect(fc[0]).toHaveClass('fc-sun')
+      expect(fc[1]).toHaveClass('fc-mon')
+      expect(fc[2]).toHaveClass('fc-tue')
+      expect(fc[3]).toHaveClass('fc-wed')
+      expect(fc[4]).toHaveClass('fc-thu')
+      expect(fc[5]).toHaveClass('fc-fri')
+      expect(fc[6]).toHaveClass('fc-sat')
+    })
+  })
 
 
   describe('when isRTL is true', function() {
   describe('when isRTL is true', function() {
 
 
     pushOptions({
     pushOptions({
       isRTL: true
       isRTL: true
-    });
+    })
 
 
     it('should have days ordered sat to sun', function() {
     it('should have days ordered sat to sun', function() {
-      initCalendar();
-      var fc = $(currentCalendar.el).find('.fc-day-header');
-      expect(fc[0]).toHaveClass('fc-sat');
-      expect(fc[1]).toHaveClass('fc-fri');
-      expect(fc[2]).toHaveClass('fc-thu');
-      expect(fc[3]).toHaveClass('fc-wed');
-      expect(fc[4]).toHaveClass('fc-tue');
-      expect(fc[5]).toHaveClass('fc-mon');
-      expect(fc[6]).toHaveClass('fc-sun');
-    });
-  });
-
-});
+      initCalendar()
+      var fc = $(currentCalendar.el).find('.fc-day-header')
+      expect(fc[0]).toHaveClass('fc-sat')
+      expect(fc[1]).toHaveClass('fc-fri')
+      expect(fc[2]).toHaveClass('fc-thu')
+      expect(fc[3]).toHaveClass('fc-wed')
+      expect(fc[4]).toHaveClass('fc-tue')
+      expect(fc[5]).toHaveClass('fc-mon')
+      expect(fc[6]).toHaveClass('fc-sun')
+    })
+  })
+
+})

+ 85 - 89
tests/legacy/businessHours.js

@@ -1,23 +1,23 @@
 // most other businessHours tests are in background-events.js
 // most other businessHours tests are in background-events.js
 
 
-import { doElsMatchSegs, getBoundingRect } from '../lib/dom-utils';
-import { getTimeGridTop, getTimeGridDayEls, getTimeGridSlotEls } from '../lib/time-grid';
+import { doElsMatchSegs, getBoundingRect } from '../lib/dom-utils'
+import { getTimeGridTop, getTimeGridDayEls, getTimeGridSlotEls } from '../lib/time-grid'
 
 
-describe('businessHours', function() {  
+describe('businessHours', function() {
   pushOptions({
   pushOptions({
     defaultDate: '2014-11-25',
     defaultDate: '2014-11-25',
     defaultView: 'month',
     defaultView: 'month',
     businessHours: true
     businessHours: true
-  });     
+  })
 
 
   it('doesn\'t break when starting out in a larger month time range', function() {
   it('doesn\'t break when starting out in a larger month time range', function() {
-    initCalendar(); // start out in the month range
-    currentCalendar.changeView('agendaWeek');
-    currentCalendar.next(); // move out of the original month range...
-    currentCalendar.next(); // ... out. should render correctly.
+    initCalendar() // start out in the month range
+    currentCalendar.changeView('agendaWeek')
+    currentCalendar.next() // move out of the original month range...
+    currentCalendar.next() // ... out. should render correctly.
 
 
     // whole days
     // whole days
-    expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // each multi-day stretch is one element
+    expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2) // each multi-day stretch is one element
 
 
     // timed area
     // timed area
     expect(isTimeGridNonBusinessSegsRendered([
     expect(isTimeGridNonBusinessSegsRendered([
@@ -40,8 +40,8 @@ describe('businessHours', function() {
       { start: '2014-12-12T17:00', end: '2014-12-13T00:00' },
       { start: '2014-12-12T17:00', end: '2014-12-13T00:00' },
       // sat
       // sat
       { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }
       { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }
-    ])).toBe(true);
-  });
+    ])).toBe(true)
+  })
 
 
 
 
   describe('when used as a dynamic option', function() {
   describe('when used as a dynamic option', function() {
@@ -51,33 +51,33 @@ describe('businessHours', function() {
         initCalendar({
         initCalendar({
           defaultView: viewName,
           defaultView: viewName,
           businessHours: false
           businessHours: false
-        });
-        var rootEl = $('.fc-view > *:first');
-        expect(rootEl.length).toBe(1);
+        })
+        var rootEl = $('.fc-view > *:first')
+        expect(rootEl.length).toBe(1)
 
 
-        expect(queryNonBusinessSegs().length).toBe(0);
-        currentCalendar.option('businessHours', true);
-        expect(queryNonBusinessSegs().length).toBeGreaterThan(0);
+        expect(queryNonBusinessSegs().length).toBe(0)
+        currentCalendar.option('businessHours', true)
+        expect(queryNonBusinessSegs().length).toBeGreaterThan(0)
 
 
-        expect($('.fc-view > *:first')[0]).toBe(rootEl[0]); // same element. didn't completely rerender
-      });
+        expect($('.fc-view > *:first')[0]).toBe(rootEl[0]) // same element. didn't completely rerender
+      })
 
 
       it('allows dynamic turning off', function() {
       it('allows dynamic turning off', function() {
         initCalendar({
         initCalendar({
           defaultView: viewName,
           defaultView: viewName,
           businessHours: true
           businessHours: true
-        });
-        var rootEl = $('.fc-view > *:first');
-        expect(rootEl.length).toBe(1);
+        })
+        var rootEl = $('.fc-view > *:first')
+        expect(rootEl.length).toBe(1)
 
 
-        expect(queryNonBusinessSegs().length).toBeGreaterThan(0);
-        currentCalendar.option('businessHours', false);
-        expect(queryNonBusinessSegs().length).toBe(0);
+        expect(queryNonBusinessSegs().length).toBeGreaterThan(0)
+        currentCalendar.option('businessHours', false)
+        expect(queryNonBusinessSegs().length).toBe(0)
 
 
-        expect($('.fc-view > *:first')[0]).toBe(rootEl[0]); // same element. didn't completely rerender
-      });
-    });
-  });
+        expect($('.fc-view > *:first')[0]).toBe(rootEl[0]) // same element. didn't completely rerender
+      })
+    })
+  })
 
 
 
 
   describe('for multiple day-of-week definitions', function() {
   describe('for multiple day-of-week definitions', function() {
@@ -98,7 +98,7 @@ describe('businessHours', function() {
             end: '16:00'
             end: '16:00'
           }
           }
         ]
         ]
-      });
+      })
 
 
       // timed area
       // timed area
       expect(isTimeGridNonBusinessSegsRendered([
       expect(isTimeGridNonBusinessSegsRendered([
@@ -121,8 +121,8 @@ describe('businessHours', function() {
         { start: '2014-12-12T16:00', end: '2014-12-13T00:00' },
         { start: '2014-12-12T16:00', end: '2014-12-13T00:00' },
         // sat
         // sat
         { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }
         { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }
-      ])).toBe(true);
-    });
+      ])).toBe(true)
+    })
 
 
     it('wont\'t process businessHour items that omit dow', function() {
     it('wont\'t process businessHour items that omit dow', function() {
       initCalendar({
       initCalendar({
@@ -140,7 +140,7 @@ describe('businessHours', function() {
             end: '16:00'
             end: '16:00'
           }
           }
         ]
         ]
-      });
+      })
 
 
       // timed area
       // timed area
       expect(isTimeGridNonBusinessSegsRendered([
       expect(isTimeGridNonBusinessSegsRendered([
@@ -160,9 +160,9 @@ describe('businessHours', function() {
         { start: '2014-12-12T16:00', end: '2014-12-13T00:00' },
         { start: '2014-12-12T16:00', end: '2014-12-13T00:00' },
         // sat
         // sat
         { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }
         { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }
-      ])).toBe(true);
-    });
-  });
+      ])).toBe(true)
+    })
+  })
 
 
 
 
   it('will grey-out a totally non-business-hour view', function() {
   it('will grey-out a totally non-business-hour view', function() {
@@ -170,108 +170,104 @@ describe('businessHours', function() {
       defaultDate: '2016-07-23', // sat
       defaultDate: '2016-07-23', // sat
       defaultView: 'agendaDay',
       defaultView: 'agendaDay',
       businessHours: true
       businessHours: true
-    });
+    })
 
 
     // timed area
     // timed area
     expect(isTimeGridNonBusinessSegsRendered([
     expect(isTimeGridNonBusinessSegsRendered([
       { start: '2016-07-23T00:00', end: '2016-07-24T00:00' }
       { start: '2016-07-23T00:00', end: '2016-07-24T00:00' }
-    ])).toBe(true);
-  });
+    ])).toBe(true)
+  })
 
 
 
 
   function queryNonBusinessSegs() {
   function queryNonBusinessSegs() {
-    return $('.fc-nonbusiness');
+    return $('.fc-nonbusiness')
   }
   }
 
 
   /* inspired by other proj...
   /* inspired by other proj...
-  ------------------------------------------------------------------------------------------------------------------*/
+  ------------------------------------------------------------------------------------------------------------------ */
 
 
   function isTimeGridNonBusinessSegsRendered(segs) {
   function isTimeGridNonBusinessSegsRendered(segs) {
-    return doElsMatchSegs($('.fc-time-grid .fc-nonbusiness'), segs, getTimeGridRect);
+    return doElsMatchSegs($('.fc-time-grid .fc-nonbusiness'), segs, getTimeGridRect)
   }
   }
 
 
   function getTimeGridRect(start, end) {
   function getTimeGridRect(start, end) {
-    var obj;
+    var obj
     if (typeof start === 'object') {
     if (typeof start === 'object') {
-      obj = start;
-      start = obj.start;
-      end = obj.end;
+      obj = start
+      start = obj.start
+      end = obj.end
     }
     }
 
 
-    start = $.fullCalendar.moment.parseZone(start);
-    end = $.fullCalendar.moment.parseZone(end);
+    start = $.fullCalendar.moment.parseZone(start)
+    end = $.fullCalendar.moment.parseZone(end)
 
 
-    var startTime = start.time();
-    var endTime;
+    var startTime = start.time()
+    var endTime
     if (end.isSame(start, 'day')) {
     if (end.isSame(start, 'day')) {
-      endTime = end.time();
-    }
-    else if (end < start) {
-      endTime = startTime;
-    }
-    else {
-      endTime = moment.duration({ hours: 24 });
+      endTime = end.time()
+    } else if (end < start) {
+      endTime = startTime
+    } else {
+      endTime = moment.duration({ hours: 24 })
     }
     }
 
 
-    var dayEls = getTimeGridDayEls(start);
-    var dayRect = getBoundingRect(dayEls);
+    var dayEls = getTimeGridDayEls(start)
+    var dayRect = getBoundingRect(dayEls)
     return {
     return {
       left: dayRect.left,
       left: dayRect.left,
       right: dayRect.right,
       right: dayRect.right,
       top: getTimeGridTop(startTime),
       top: getTimeGridTop(startTime),
       bottom: getTimeGridTop(endTime)
       bottom: getTimeGridTop(endTime)
-    };
+    }
   }
   }
 
 
   /* copied from other proj...
   /* copied from other proj...
-  ------------------------------------------------------------------------------------------------------------------*/
+  ------------------------------------------------------------------------------------------------------------------ */
 
 
   function getTimeGridTop(targetTime) {
   function getTimeGridTop(targetTime) {
-    var i, j, len, prevSlotEl, prevSlotTime, slotEl, slotEls, slotMsDuration, slotTime, topBorderWidth;
-    targetTime = moment.duration(targetTime);
-    slotEls = getTimeGridSlotEls(targetTime);
-    topBorderWidth = 1;
+    var i, j, len, prevSlotEl, prevSlotTime, slotEl, slotEls, slotMsDuration, slotTime, topBorderWidth
+    targetTime = moment.duration(targetTime)
+    slotEls = getTimeGridSlotEls(targetTime)
+    topBorderWidth = 1
     if (slotEls.length === 1) {
     if (slotEls.length === 1) {
-      return slotEls.eq(0).offset().top + topBorderWidth;
+      return slotEls.eq(0).offset().top + topBorderWidth
     }
     }
-    slotEls = $('.fc-time-grid .fc-slats tr[data-time]');
-    slotTime = null;
-    prevSlotTime = null;
+    slotEls = $('.fc-time-grid .fc-slats tr[data-time]')
+    slotTime = null
+    prevSlotTime = null
     for (i = j = 0, len = slotEls.length; j < len; i = ++j) {
     for (i = j = 0, len = slotEls.length; j < len; i = ++j) {
-      slotEl = slotEls[i];
-      slotEl = $(slotEl);
-      prevSlotTime = slotTime;
-      slotTime = moment.duration(slotEl.data('time'));
+      slotEl = slotEls[i]
+      slotEl = $(slotEl)
+      prevSlotTime = slotTime
+      slotTime = moment.duration(slotEl.data('time'))
       if (targetTime < slotTime) {
       if (targetTime < slotTime) {
         if (!prevSlotTime) {
         if (!prevSlotTime) {
-          return slotEl.offset().top + topBorderWidth;
-        }
-        else {
-          prevSlotEl = slotEls.eq(i - 1);
+          return slotEl.offset().top + topBorderWidth
+        } else {
+          prevSlotEl = slotEls.eq(i - 1)
           return prevSlotEl.offset().top + topBorderWidth +
           return prevSlotEl.offset().top + topBorderWidth +
-            prevSlotEl.outerHeight() * ((targetTime - prevSlotTime) / (slotTime - prevSlotTime));
+            prevSlotEl.outerHeight() * ((targetTime - prevSlotTime) / (slotTime - prevSlotTime))
         }
         }
       }
       }
     }
     }
-    slotMsDuration = slotTime - prevSlotTime;
+    slotMsDuration = slotTime - prevSlotTime
     return slotEl.offset().top + topBorderWidth +
     return slotEl.offset().top + topBorderWidth +
-      slotEl.outerHeight() * Math.min(1, (targetTime - slotTime) / slotMsDuration);
+      slotEl.outerHeight() * Math.min(1, (targetTime - slotTime) / slotMsDuration)
   }
   }
 
 
   function getTimeGridDayEls(date) {
   function getTimeGridDayEls(date) {
-    date = $.fullCalendar.moment.parseZone(date);
-    return $('.fc-time-grid .fc-day[data-date="' + date.format('YYYY-MM-DD') + '"]');
+    date = $.fullCalendar.moment.parseZone(date)
+    return $('.fc-time-grid .fc-day[data-date="' + date.format('YYYY-MM-DD') + '"]')
   }
   }
 
 
   function getTimeGridSlotEls(timeDuration) {
   function getTimeGridSlotEls(timeDuration) {
-    timeDuration = moment.duration(timeDuration);
-    var date = $.fullCalendar.moment.utc('2016-01-01').time(timeDuration);
+    timeDuration = moment.duration(timeDuration)
+    var date = $.fullCalendar.moment.utc('2016-01-01').time(timeDuration)
     if (date.date() == 1) { // ensure no time overflow/underflow
     if (date.date() == 1) { // ensure no time overflow/underflow
-      return $('.fc-time-grid .fc-slats tr[data-time="' + date.format('HH:mm:ss') + '"]');
-    }
-    else {
-      return $();
+      return $('.fc-time-grid .fc-slats tr[data-time="' + date.format('HH:mm:ss') + '"]')
+    } else {
+      return $()
     }
     }
   }
   }
 
 
-});
+})

+ 39 - 39
tests/legacy/buttonIcons.js

@@ -6,24 +6,24 @@ describe('buttonIcons', function() {
       center: 'title',
       center: 'title',
       right: 'prevYear, nextYear'
       right: 'prevYear, nextYear'
     }
     }
-  });
+  })
 
 
   describe('when buttonIcons is not set', function() {
   describe('when buttonIcons is not set', function() {
 
 
     it('should have default values', function() {
     it('should have default values', function() {
-      initCalendar();
-      var $cal = $(currentCalendar.el);
-      var prevBtn = $cal.find('.fc-prev-button');
-      var nextBtn = $cal.find('.fc-next-button');
-      var nextYearBtn = $cal.find('.fc-nextYear-button');
-      var prevYearBtn = $cal.find('.fc-prevYear-button');
+      initCalendar()
+      var $cal = $(currentCalendar.el)
+      var prevBtn = $cal.find('.fc-prev-button')
+      var nextBtn = $cal.find('.fc-next-button')
+      var nextYearBtn = $cal.find('.fc-nextYear-button')
+      var prevYearBtn = $cal.find('.fc-prevYear-button')
 
 
-      expect(prevBtn.find('span:first')).toHaveClass('fc-icon-left-single-arrow');
-      expect(nextBtn.find('span:first')).toHaveClass('fc-icon-right-single-arrow');
-      expect(nextYearBtn.find('span:first')).toHaveClass('fc-icon-right-double-arrow');
-      expect(prevYearBtn.find('span:first')).toHaveClass('fc-icon-left-double-arrow');
-    });
-  });
+      expect(prevBtn.find('span:first')).toHaveClass('fc-icon-left-single-arrow')
+      expect(nextBtn.find('span:first')).toHaveClass('fc-icon-right-single-arrow')
+      expect(nextYearBtn.find('span:first')).toHaveClass('fc-icon-right-double-arrow')
+      expect(prevYearBtn.find('span:first')).toHaveClass('fc-icon-left-double-arrow')
+    })
+  })
 
 
   describe('when buttonIcons is set and theme is falsy', function() {
   describe('when buttonIcons is set and theme is falsy', function() {
 
 
@@ -34,43 +34,43 @@ describe('buttonIcons', function() {
         prevYear: 'some-icon-leftYear',
         prevYear: 'some-icon-leftYear',
         nextYear: 'some-icon-rightYear'
         nextYear: 'some-icon-rightYear'
       }
       }
-    });
+    })
 
 
     it('should have the set values', function() {
     it('should have the set values', function() {
-      initCalendar();
-      var $cal = $(currentCalendar.el);
-      var prevBtn = $cal.find('.fc-prev-button');
-      var nextBtn = $cal.find('.fc-next-button');
-      var prevYearBtn = $cal.find('.fc-prevYear-button');
-      var nextYearBtn = $cal.find('.fc-nextYear-button');
+      initCalendar()
+      var $cal = $(currentCalendar.el)
+      var prevBtn = $cal.find('.fc-prev-button')
+      var nextBtn = $cal.find('.fc-next-button')
+      var prevYearBtn = $cal.find('.fc-prevYear-button')
+      var nextYearBtn = $cal.find('.fc-nextYear-button')
 
 
-      expect(prevBtn.find('span:first')).toHaveClass('fc-icon-some-icon-left');
-      expect(prevBtn.find('span:first')).toHaveClass('fc-icon-some-icon-left');
-      expect(prevYearBtn.find('span:first')).toHaveClass('fc-icon-some-icon-leftYear');
-      expect(nextYearBtn.find('span:first')).toHaveClass('fc-icon-some-icon-rightYear');
-    });
-  });
+      expect(prevBtn.find('span:first')).toHaveClass('fc-icon-some-icon-left')
+      expect(prevBtn.find('span:first')).toHaveClass('fc-icon-some-icon-left')
+      expect(prevYearBtn.find('span:first')).toHaveClass('fc-icon-some-icon-leftYear')
+      expect(nextYearBtn.find('span:first')).toHaveClass('fc-icon-some-icon-rightYear')
+    })
+  })
 
 
   describe('when theme is true', function() {
   describe('when theme is true', function() {
 
 
     pushOptions({
     pushOptions({
       theme: true
       theme: true
-    });
+    })
 
 
     it('buttonIcons is ignored', function() {
     it('buttonIcons is ignored', function() {
-      initCalendar();
-      var $cal = $(currentCalendar.el);
-      var prevBtn = $cal.find('.fc-prev-button');
-      var nextBtn = $cal.find('.fc-next-button');
-      var prevYearBtn = $cal.find('.fc-prevYear-button');
-      var nextYearBtn = $cal.find('.fc-nextYear-button');
+      initCalendar()
+      var $cal = $(currentCalendar.el)
+      var prevBtn = $cal.find('.fc-prev-button')
+      var nextBtn = $cal.find('.fc-next-button')
+      var prevYearBtn = $cal.find('.fc-prevYear-button')
+      var nextYearBtn = $cal.find('.fc-nextYear-button')
       var classesToSearch = [ '.fc-icon-left-single-arrow', '.fc-icon-right-double-arrow',
       var classesToSearch = [ '.fc-icon-left-single-arrow', '.fc-icon-right-double-arrow',
-                  '.fc-icon-right-single-arrow', '.fc-icon-left-double-arrow' ];
+        '.fc-icon-right-single-arrow', '.fc-icon-left-double-arrow' ]
 
 
       for (var i = 0; i < classesToSearch.length; i++) {
       for (var i = 0; i < classesToSearch.length; i++) {
-        var cls = classesToSearch[i];
-        expect($cal.find(cls).length).toBe(0);
+        var cls = classesToSearch[i]
+        expect($cal.find(cls).length).toBe(0)
       };
       };
-    });
-  });
-});
+    })
+  })
+})

+ 112 - 112
tests/legacy/buttonText.js

@@ -6,28 +6,28 @@ describe('button text', function() {
       center: '',
       center: '',
       right: 'month,basicWeek,basicDay,agendaWeek,agendaDay'
       right: 'month,basicWeek,basicDay,agendaWeek,agendaDay'
     }
     }
-  });
+  })
 
 
   describe('with default locale', function() {
   describe('with default locale', function() {
 
 
     describe('with default buttonIcons', function() {
     describe('with default buttonIcons', function() {
 
 
       it('should contain default text values', function() {
       it('should contain default text values', function() {
-        initCalendar();
+        initCalendar()
 
 
         // will have button icons, to text will be empty
         // will have button icons, to text will be empty
-        expect($('.fc-next-button')).toHaveText('');
-        expect($('.fc-nextYear-button')).toHaveText('');
-        expect($('.fc-prev-button')).toHaveText('');
-        expect($('.fc-prevYear-button')).toHaveText('');
-
-        expect($('.fc-today-button')).toHaveText('today');
-        expect($('.fc-month-button')).toHaveText('month');
-        expect($('.fc-basicWeek-button')).toHaveText('week');
-        expect($('.fc-agendaWeek-button')).toHaveText('week');
-        expect($('.fc-basicDay-button')).toHaveText('day');
-        expect($('.fc-agendaDay-button')).toHaveText('day');
-      });
+        expect($('.fc-next-button')).toHaveText('')
+        expect($('.fc-nextYear-button')).toHaveText('')
+        expect($('.fc-prev-button')).toHaveText('')
+        expect($('.fc-prevYear-button')).toHaveText('')
+
+        expect($('.fc-today-button')).toHaveText('today')
+        expect($('.fc-month-button')).toHaveText('month')
+        expect($('.fc-basicWeek-button')).toHaveText('week')
+        expect($('.fc-agendaWeek-button')).toHaveText('week')
+        expect($('.fc-basicDay-button')).toHaveText('day')
+        expect($('.fc-agendaDay-button')).toHaveText('day')
+      })
 
 
       it('should contain specified text values', function() {
       it('should contain specified text values', function() {
         initCalendar({
         initCalendar({
@@ -41,45 +41,45 @@ describe('button text', function() {
             week: 'wiki',
             week: 'wiki',
             day: 'dei'
             day: 'dei'
           }
           }
-        });
+        })
 
 
-        expect($('.fc-next-button')).toHaveText('->');
-        expect($('.fc-nextYear-button')).toHaveText('-->');
-        expect($('.fc-prev-button')).toHaveText('<-');
-        expect($('.fc-prevYear-button')).toHaveText('<--');
+        expect($('.fc-next-button')).toHaveText('->')
+        expect($('.fc-nextYear-button')).toHaveText('-->')
+        expect($('.fc-prev-button')).toHaveText('<-')
+        expect($('.fc-prevYear-button')).toHaveText('<--')
 
 
-        expect($('.fc-today-button')).toHaveText('tidei');
-        expect($('.fc-month-button')).toHaveText('mun');
-        expect($('.fc-agendaDay-button')).toHaveText('dei');
-        expect($('.fc-agendaWeek-button')).toHaveText('wiki');
-        expect($('.fc-basicDay-button')).toHaveText('dei');
-        expect($('.fc-basicWeek-button')).toHaveText('wiki');
-      });
+        expect($('.fc-today-button')).toHaveText('tidei')
+        expect($('.fc-month-button')).toHaveText('mun')
+        expect($('.fc-agendaDay-button')).toHaveText('dei')
+        expect($('.fc-agendaWeek-button')).toHaveText('wiki')
+        expect($('.fc-basicDay-button')).toHaveText('dei')
+        expect($('.fc-basicWeek-button')).toHaveText('wiki')
+      })
 
 
-    });
+    })
 
 
     describe('with buttonIcons turned off', function() {
     describe('with buttonIcons turned off', function() {
 
 
       pushOptions({
       pushOptions({
         buttonIcons: false
         buttonIcons: false
-      });
+      })
 
 
       it('should contain default text values', function() {
       it('should contain default text values', function() {
-        initCalendar();
+        initCalendar()
 
 
         // will have actual text now
         // will have actual text now
-        expect($('.fc-next-button')).toHaveText('next');
-        expect($('.fc-nextYear-button')).toHaveText('next year');
-        expect($('.fc-prev-button')).toHaveText('prev');
-        expect($('.fc-prevYear-button')).toHaveText('prev year');
-
-        expect($('.fc-today-button')).toHaveText('today');
-        expect($('.fc-month-button')).toHaveText('month');
-        expect($('.fc-basicWeek-button')).toHaveText('week');
-        expect($('.fc-agendaWeek-button')).toHaveText('week');
-        expect($('.fc-basicDay-button')).toHaveText('day');
-        expect($('.fc-agendaDay-button')).toHaveText('day');
-      });
+        expect($('.fc-next-button')).toHaveText('next')
+        expect($('.fc-nextYear-button')).toHaveText('next year')
+        expect($('.fc-prev-button')).toHaveText('prev')
+        expect($('.fc-prevYear-button')).toHaveText('prev year')
+
+        expect($('.fc-today-button')).toHaveText('today')
+        expect($('.fc-month-button')).toHaveText('month')
+        expect($('.fc-basicWeek-button')).toHaveText('week')
+        expect($('.fc-agendaWeek-button')).toHaveText('week')
+        expect($('.fc-basicDay-button')).toHaveText('day')
+        expect($('.fc-agendaDay-button')).toHaveText('day')
+      })
 
 
       it('should contain specified text values', function() {
       it('should contain specified text values', function() {
         initCalendar({
         initCalendar({
@@ -93,49 +93,49 @@ describe('button text', function() {
             week: 'wiki',
             week: 'wiki',
             day: 'dei'
             day: 'dei'
           }
           }
-        });
+        })
 
 
-        expect($('.fc-next-button')).toHaveText('->');
-        expect($('.fc-nextYear-button')).toHaveText('-->');
-        expect($('.fc-prev-button')).toHaveText('<-');
-        expect($('.fc-prevYear-button')).toHaveText('<--');
+        expect($('.fc-next-button')).toHaveText('->')
+        expect($('.fc-nextYear-button')).toHaveText('-->')
+        expect($('.fc-prev-button')).toHaveText('<-')
+        expect($('.fc-prevYear-button')).toHaveText('<--')
 
 
-        expect($('.fc-today-button')).toHaveText('tidei');
-        expect($('.fc-month-button')).toHaveText('mun');
-        expect($('.fc-agendaDay-button')).toHaveText('dei');
-        expect($('.fc-agendaWeek-button')).toHaveText('wiki');
-        expect($('.fc-basicDay-button')).toHaveText('dei');
-        expect($('.fc-basicWeek-button')).toHaveText('wiki');
-      });
+        expect($('.fc-today-button')).toHaveText('tidei')
+        expect($('.fc-month-button')).toHaveText('mun')
+        expect($('.fc-agendaDay-button')).toHaveText('dei')
+        expect($('.fc-agendaWeek-button')).toHaveText('wiki')
+        expect($('.fc-basicDay-button')).toHaveText('dei')
+        expect($('.fc-basicWeek-button')).toHaveText('wiki')
+      })
 
 
-    });
+    })
 
 
-  });
+  })
 
 
   describe('when locale is not default', function() {
   describe('when locale is not default', function() {
 
 
     pushOptions({
     pushOptions({
       locale: 'fr'
       locale: 'fr'
-    });
+    })
 
 
     describe('with default buttonIcons', function() {
     describe('with default buttonIcons', function() {
 
 
       it('should contain default text values', function() {
       it('should contain default text values', function() {
-        initCalendar();
+        initCalendar()
 
 
         // will contain icons, so will contain no text
         // will contain icons, so will contain no text
-        expect($('.fc-next-button')).toHaveText('');
-        expect($('.fc-nextYear-button')).toHaveText('');
-        expect($('.fc-prev-button')).toHaveText('');
-        expect($('.fc-prevYear-button')).toHaveText('');
-
-        expect($('.fc-today-button')).toHaveText('Aujourd\'hui');
-        expect($('.fc-month-button')).toHaveText('Mois');
-        expect($('.fc-basicWeek-button')).toHaveText('Semaine');
-        expect($('.fc-agendaWeek-button')).toHaveText('Semaine');
-        expect($('.fc-basicDay-button')).toHaveText('Jour');
-        expect($('.fc-agendaDay-button')).toHaveText('Jour');
-      });
+        expect($('.fc-next-button')).toHaveText('')
+        expect($('.fc-nextYear-button')).toHaveText('')
+        expect($('.fc-prev-button')).toHaveText('')
+        expect($('.fc-prevYear-button')).toHaveText('')
+
+        expect($('.fc-today-button')).toHaveText('Aujourd\'hui')
+        expect($('.fc-month-button')).toHaveText('Mois')
+        expect($('.fc-basicWeek-button')).toHaveText('Semaine')
+        expect($('.fc-agendaWeek-button')).toHaveText('Semaine')
+        expect($('.fc-basicDay-button')).toHaveText('Jour')
+        expect($('.fc-agendaDay-button')).toHaveText('Jour')
+      })
 
 
       it('should contain specified text values', function() {
       it('should contain specified text values', function() {
         initCalendar({
         initCalendar({
@@ -149,46 +149,46 @@ describe('button text', function() {
             week: 'wiki',
             week: 'wiki',
             day: 'dei'
             day: 'dei'
           }
           }
-        });
+        })
 
 
-        expect($('.fc-next-button')).toHaveText('->');
-        expect($('.fc-nextYear-button')).toHaveText('-->');
-        expect($('.fc-prev-button')).toHaveText('<-');
-        expect($('.fc-prevYear-button')).toHaveText('<--');
+        expect($('.fc-next-button')).toHaveText('->')
+        expect($('.fc-nextYear-button')).toHaveText('-->')
+        expect($('.fc-prev-button')).toHaveText('<-')
+        expect($('.fc-prevYear-button')).toHaveText('<--')
 
 
-        expect($('.fc-today-button')).toHaveText('tidei');
-        expect($('.fc-month-button')).toHaveText('mun');
-        expect($('.fc-agendaDay-button')).toHaveText('dei');
-        expect($('.fc-agendaWeek-button')).toHaveText('wiki');
-        expect($('.fc-basicDay-button')).toHaveText('dei');
-        expect($('.fc-basicWeek-button')).toHaveText('wiki');
-      });
+        expect($('.fc-today-button')).toHaveText('tidei')
+        expect($('.fc-month-button')).toHaveText('mun')
+        expect($('.fc-agendaDay-button')).toHaveText('dei')
+        expect($('.fc-agendaWeek-button')).toHaveText('wiki')
+        expect($('.fc-basicDay-button')).toHaveText('dei')
+        expect($('.fc-basicWeek-button')).toHaveText('wiki')
+      })
 
 
-    });
+    })
 
 
     describe('with buttonIcons turned off', function() {
     describe('with buttonIcons turned off', function() {
 
 
       pushOptions({
       pushOptions({
         buttonIcons: false
         buttonIcons: false
-      });
+      })
 
 
       it('should contain default text values', function() {
       it('should contain default text values', function() {
-        initCalendar();
+        initCalendar()
 
 
         // will have the locale's actual text now
         // will have the locale's actual text now
-        expect($('.fc-next-button')).toHaveText('Suivant');
-        expect($('.fc-prev-button')).toHaveText('Précédent');
-        //// locales files don't have data for prev/next *year*
-        //expect($('.fc-nextYear-button')).toHaveText('Suivant');
-        //expect($('.fc-prevYear-button')).toHaveText('Précédent');
-
-        expect($('.fc-today-button')).toHaveText('Aujourd\'hui');
-        expect($('.fc-month-button')).toHaveText('Mois');
-        expect($('.fc-basicWeek-button')).toHaveText('Semaine');
-        expect($('.fc-agendaWeek-button')).toHaveText('Semaine');
-        expect($('.fc-basicDay-button')).toHaveText('Jour');
-        expect($('.fc-agendaDay-button')).toHaveText('Jour');
-      });
+        expect($('.fc-next-button')).toHaveText('Suivant')
+        expect($('.fc-prev-button')).toHaveText('Précédent')
+        /// / locales files don't have data for prev/next *year*
+        // expect($('.fc-nextYear-button')).toHaveText('Suivant');
+        // expect($('.fc-prevYear-button')).toHaveText('Précédent');
+
+        expect($('.fc-today-button')).toHaveText('Aujourd\'hui')
+        expect($('.fc-month-button')).toHaveText('Mois')
+        expect($('.fc-basicWeek-button')).toHaveText('Semaine')
+        expect($('.fc-agendaWeek-button')).toHaveText('Semaine')
+        expect($('.fc-basicDay-button')).toHaveText('Jour')
+        expect($('.fc-agendaDay-button')).toHaveText('Jour')
+      })
 
 
       it('should contain specified text values', function() {
       it('should contain specified text values', function() {
         initCalendar({
         initCalendar({
@@ -202,23 +202,23 @@ describe('button text', function() {
             week: 'wiki',
             week: 'wiki',
             day: 'dei'
             day: 'dei'
           }
           }
-        });
+        })
 
 
-        expect($('.fc-next-button')).toHaveText('->');
-        expect($('.fc-nextYear-button')).toHaveText('-->');
-        expect($('.fc-prev-button')).toHaveText('<-');
-        expect($('.fc-prevYear-button')).toHaveText('<--');
+        expect($('.fc-next-button')).toHaveText('->')
+        expect($('.fc-nextYear-button')).toHaveText('-->')
+        expect($('.fc-prev-button')).toHaveText('<-')
+        expect($('.fc-prevYear-button')).toHaveText('<--')
 
 
-        expect($('.fc-today-button')).toHaveText('tidei');
-        expect($('.fc-month-button')).toHaveText('mun');
-        expect($('.fc-agendaDay-button')).toHaveText('dei');
-        expect($('.fc-agendaWeek-button')).toHaveText('wiki');
-        expect($('.fc-basicDay-button')).toHaveText('dei');
-        expect($('.fc-basicWeek-button')).toHaveText('wiki');
-      });
+        expect($('.fc-today-button')).toHaveText('tidei')
+        expect($('.fc-month-button')).toHaveText('mun')
+        expect($('.fc-agendaDay-button')).toHaveText('dei')
+        expect($('.fc-agendaWeek-button')).toHaveText('wiki')
+        expect($('.fc-basicDay-button')).toHaveText('dei')
+        expect($('.fc-basicWeek-button')).toHaveText('wiki')
+      })
 
 
-    });
+    })
 
 
-  });
+  })
 
 
-});
+})

+ 189 - 189
tests/legacy/columnHeaderFormat.js

@@ -1,191 +1,191 @@
 
 
 describe('columnHeaderFormat', function() {
 describe('columnHeaderFormat', function() {
-    
-    describe('when columnFormat is not set', function() {
-
-        var viewWithFormat = [ { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'basicWeek', expected: 'Sun 5/11', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaWeek', expected: 'Sun 5/11', selector: 'th.fc-widget-header.fc-sun' },
-            { view: 'basicDay', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' } ];
-
-        beforeEach(function() {
-            initCalendar({
-                defaultDate: '2014-05-11'
-            });
-        });
-
-        it('should have default values', function() {            
-
-            for (var i = 0; i <  viewWithFormat.length; i++) {
-                var crtView = viewWithFormat[i];
-                currentCalendar.changeView(crtView.view);
-                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
-            };
-        });
-    });
-
-    describe('when columnHeaderFormat is set on a per-view basis', function() {
-
-        var viewWithFormat = [ { view: 'month', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'basicWeek', expected: 'Sunday 11 - 5', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaWeek', expected: 'Sunday 11 , 5', selector: 'th.fc-widget-header.fc-sun' },
-            { view: 'basicDay', expected: 'Sunday 11 | 5', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaDay', expected: 'Sunday 5/11', selector: 'th.fc-widget-header.fc-sun' } ];
-
-        beforeEach(function() {
-            initCalendar({
-                defaultDate: '2014-05-11',
-                views: {
-                    month: { columnHeaderFormat: 'dddd' },
-                    agendaDay: { columnHeaderFormat: 'dddd M/D' },
-                    agendaWeek: { columnHeaderFormat: 'dddd D , M' },
-                    basicDay: { columnHeaderFormat: 'dddd D | M' },
-                    basicWeek: { columnHeaderFormat: 'dddd D - M' }
-                }
-            });
-        });
-
-        it('should have the correct values', function() {            
-
-            for (var i = 0; i <  viewWithFormat.length; i++) {
-                var crtView = viewWithFormat[i];
-                currentCalendar.changeView(crtView.view);
-                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
-            };
-        });
-    });
-
-    describe('when locale is French', function() {
-
-        var viewWithFormat = [ { view: 'month', expected: 'dim.', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'basicWeek', expected: 'dim. 11/5', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaWeek', expected: 'dim. 11/5', selector: 'th.fc-widget-header.fc-sun' },
-            { view: 'basicDay', expected: 'dimanche', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaDay', expected: 'dimanche', selector: 'th.fc-widget-header.fc-sun' } ];
-
-        beforeEach(function() {
-            initCalendar({
-                defaultDate: '2014-05-11',
-                locale: 'fr'
-            });
-        });
-
-        it('should have the translated dates', function() {            
-
-            for (var i = 0; i <  viewWithFormat.length; i++) {
-                var crtView = viewWithFormat[i];
-                currentCalendar.changeView(crtView.view);
-                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
-            };
-        });
-    });
-
-    describe('when locale is en-gb', function() {
-
-        var viewWithFormat = [ { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'basicWeek', expected: 'Sun 11/5', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaWeek', expected: 'Sun 11/5', selector: 'th.fc-widget-header.fc-sun' },
-            { view: 'basicDay', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' } ];
-
-        beforeEach(function() {
-            initCalendar({
-                defaultDate: '2014-05-11',
-                locale: 'en-gb'
-            });
-        });
-
-        it('should have the translated dates', function() {            
-
-            for (var i = 0; i <  viewWithFormat.length; i++) {
-                var crtView = viewWithFormat[i];
-                currentCalendar.changeView(crtView.view);
-                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
-            };
-        });
-    });
-
-    describe('when locale is Korean', function() {
-
-        var viewWithFormat = [ { view: 'month', expected: '일', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'basicWeek', expected: '일 05.11', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaWeek', expected: '일 05.11', selector: 'th.fc-widget-header.fc-sun' },
-            { view: 'basicDay', expected: '일요일', selector: 'th.fc-day-header.fc-sun' },
-            { view: 'agendaDay', expected: '일요일', selector: 'th.fc-widget-header.fc-sun' } ];
-
-        beforeEach(function() {
-            initCalendar({
-                defaultDate: '2014-05-11',
-                locale: 'ko'
-            });
-        });
-
-        it('should have the translated dates and columnHeaderFormat should be computed differently', function() {
-            for (var i = 0; i <  viewWithFormat.length; i++) {
-                var crtView = viewWithFormat[i];
-                currentCalendar.changeView(crtView.view);
-                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
-            };
-        });
-    });
-
-    describe('using custom views', function() {
-
-        it('multi-year default only displays day-of-week', function() {
-            initCalendar({
-                views: {
-                    multiYear: {
-                        type: 'basic',
-                        duration: { years: 2 }
-                    }
-                },
-                defaultView: 'multiYear',
-                defaultDate: '2014-12-25'
-            });
-            expect($('.fc-day-header:first')).toHaveText('Sun');
-        });
-
-        it('multi-month default only displays day-of-week', function() {
-            initCalendar({
-                views: {
-                    multiMonth: {
-                        type: 'basic',
-                        duration: { months: 2 }
-                    }
-                },
-                defaultView: 'multiMonth',
-                defaultDate: '2014-12-25'
-            });
-            expect($('.fc-day-header:first')).toHaveText('Sun');
-        });
-
-        it('multi-week default only displays day-of-week', function() {
-            initCalendar({
-                views: {
-                    multiWeek: {
-                        type: 'basic',
-                        duration: { weeks: 2 }
-                    }
-                },
-                defaultView: 'multiWeek',
-                defaultDate: '2014-12-25'
-            });
-            expect($('.fc-day-header:first')).toHaveText('Sun');
-        });
-
-        it('multi-day default displays short full date', function() {
-            initCalendar({
-                views: {
-                    multiDay: {
-                        type: 'basic',
-                        duration: { days: 2 }
-                    }
-                },
-                defaultView: 'multiDay',
-                defaultDate: '2014-12-25'
-            });
-            expect($('.fc-day-header:first')).toHaveText('Thu 12/25');
-        });
-    });
-});
+
+  describe('when columnFormat is not set', function() {
+
+    var viewWithFormat = [ { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'basicWeek', expected: 'Sun 5/11', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaWeek', expected: 'Sun 5/11', selector: 'th.fc-widget-header.fc-sun' },
+      { view: 'basicDay', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' } ]
+
+    beforeEach(function() {
+      initCalendar({
+        defaultDate: '2014-05-11'
+      })
+    })
+
+    it('should have default values', function() {
+
+      for (var i = 0; i < viewWithFormat.length; i++) {
+        var crtView = viewWithFormat[i]
+        currentCalendar.changeView(crtView.view)
+        expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected)
+      };
+    })
+  })
+
+  describe('when columnHeaderFormat is set on a per-view basis', function() {
+
+    var viewWithFormat = [ { view: 'month', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'basicWeek', expected: 'Sunday 11 - 5', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaWeek', expected: 'Sunday 11 , 5', selector: 'th.fc-widget-header.fc-sun' },
+      { view: 'basicDay', expected: 'Sunday 11 | 5', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaDay', expected: 'Sunday 5/11', selector: 'th.fc-widget-header.fc-sun' } ]
+
+    beforeEach(function() {
+      initCalendar({
+        defaultDate: '2014-05-11',
+        views: {
+          month: { columnHeaderFormat: 'dddd' },
+          agendaDay: { columnHeaderFormat: 'dddd M/D' },
+          agendaWeek: { columnHeaderFormat: 'dddd D , M' },
+          basicDay: { columnHeaderFormat: 'dddd D | M' },
+          basicWeek: { columnHeaderFormat: 'dddd D - M' }
+        }
+      })
+    })
+
+    it('should have the correct values', function() {
+
+      for (var i = 0; i < viewWithFormat.length; i++) {
+        var crtView = viewWithFormat[i]
+        currentCalendar.changeView(crtView.view)
+        expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected)
+      };
+    })
+  })
+
+  describe('when locale is French', function() {
+
+    var viewWithFormat = [ { view: 'month', expected: 'dim.', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'basicWeek', expected: 'dim. 11/5', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaWeek', expected: 'dim. 11/5', selector: 'th.fc-widget-header.fc-sun' },
+      { view: 'basicDay', expected: 'dimanche', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaDay', expected: 'dimanche', selector: 'th.fc-widget-header.fc-sun' } ]
+
+    beforeEach(function() {
+      initCalendar({
+        defaultDate: '2014-05-11',
+        locale: 'fr'
+      })
+    })
+
+    it('should have the translated dates', function() {
+
+      for (var i = 0; i < viewWithFormat.length; i++) {
+        var crtView = viewWithFormat[i]
+        currentCalendar.changeView(crtView.view)
+        expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected)
+      };
+    })
+  })
+
+  describe('when locale is en-gb', function() {
+
+    var viewWithFormat = [ { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'basicWeek', expected: 'Sun 11/5', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaWeek', expected: 'Sun 11/5', selector: 'th.fc-widget-header.fc-sun' },
+      { view: 'basicDay', expected: 'Sunday', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' } ]
+
+    beforeEach(function() {
+      initCalendar({
+        defaultDate: '2014-05-11',
+        locale: 'en-gb'
+      })
+    })
+
+    it('should have the translated dates', function() {
+
+      for (var i = 0; i < viewWithFormat.length; i++) {
+        var crtView = viewWithFormat[i]
+        currentCalendar.changeView(crtView.view)
+        expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected)
+      };
+    })
+  })
+
+  describe('when locale is Korean', function() {
+
+    var viewWithFormat = [ { view: 'month', expected: '일', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'basicWeek', expected: '일 05.11', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaWeek', expected: '일 05.11', selector: 'th.fc-widget-header.fc-sun' },
+      { view: 'basicDay', expected: '일요일', selector: 'th.fc-day-header.fc-sun' },
+      { view: 'agendaDay', expected: '일요일', selector: 'th.fc-widget-header.fc-sun' } ]
+
+    beforeEach(function() {
+      initCalendar({
+        defaultDate: '2014-05-11',
+        locale: 'ko'
+      })
+    })
+
+    it('should have the translated dates and columnHeaderFormat should be computed differently', function() {
+      for (var i = 0; i < viewWithFormat.length; i++) {
+        var crtView = viewWithFormat[i]
+        currentCalendar.changeView(crtView.view)
+        expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected)
+      };
+    })
+  })
+
+  describe('using custom views', function() {
+
+    it('multi-year default only displays day-of-week', function() {
+      initCalendar({
+        views: {
+          multiYear: {
+            type: 'basic',
+            duration: { years: 2 }
+          }
+        },
+        defaultView: 'multiYear',
+        defaultDate: '2014-12-25'
+      })
+      expect($('.fc-day-header:first')).toHaveText('Sun')
+    })
+
+    it('multi-month default only displays day-of-week', function() {
+      initCalendar({
+        views: {
+          multiMonth: {
+            type: 'basic',
+            duration: { months: 2 }
+          }
+        },
+        defaultView: 'multiMonth',
+        defaultDate: '2014-12-25'
+      })
+      expect($('.fc-day-header:first')).toHaveText('Sun')
+    })
+
+    it('multi-week default only displays day-of-week', function() {
+      initCalendar({
+        views: {
+          multiWeek: {
+            type: 'basic',
+            duration: { weeks: 2 }
+          }
+        },
+        defaultView: 'multiWeek',
+        defaultDate: '2014-12-25'
+      })
+      expect($('.fc-day-header:first')).toHaveText('Sun')
+    })
+
+    it('multi-day default displays short full date', function() {
+      initCalendar({
+        views: {
+          multiDay: {
+            type: 'basic',
+            duration: { days: 2 }
+          }
+        },
+        defaultView: 'multiDay',
+        defaultDate: '2014-12-25'
+      })
+      expect($('.fc-day-header:first')).toHaveText('Thu 12/25')
+    })
+  })
+})

+ 388 - 388
tests/legacy/constraint.js

@@ -1,17 +1,17 @@
-import { testEventDrag, testEventResize, testSelection } from '../lib/dnd-resize-utils';
+import { testEventDrag, testEventResize, testSelection } from '../lib/dnd-resize-utils'
 
 
 describe('event constraint', function() {
 describe('event constraint', function() {
 
 
   pushOptions({
   pushOptions({
     defaultDate: '2014-11-10',
     defaultDate: '2014-11-10',
     defaultView: 'agendaWeek',
     defaultView: 'agendaWeek',
-    scrollTime: '00:00',        
-  });
+    scrollTime: '00:00'
+  })
   describe('when used with a specific date range', function() {
   describe('when used with a specific date range', function() {
     describe('when an event is being dragged', function() {
     describe('when an event is being dragged', function() {
       describe('to the middle of the constraint range', function() {
       describe('to the middle of the constraint range', function() {
         it('allows a drag', function(done) {
         it('allows a drag', function(done) {
-          var options = {};
+          var options = {}
           options.events = [ {
           options.events = [ {
             start: '2014-11-10T01:00:00',
             start: '2014-11-10T01:00:00',
             end: '2014-11-10T02:00:00',
             end: '2014-11-10T02:00:00',
@@ -19,14 +19,14 @@ describe('event constraint', function() {
               start: '2014-11-10T03:00:00',
               start: '2014-11-10T03:00:00',
               end: '2014-11-10T06:00:00'
               end: '2014-11-10T06:00:00'
             }
             }
-          } ];
-          testEventDrag(options, '2014-11-10T04:00:00', true, done);
-        });
+          } ]
+          testEventDrag(options, '2014-11-10T04:00:00', true, done)
+        })
 
 
         describe('when in month view with timed event', function() {
         describe('when in month view with timed event', function() {
           it('allows a drag, respects time of day', function(done) {
           it('allows a drag, respects time of day', function(done) {
-            var options = {};       
-            options.defaultView = 'month';
+            var options = {}
+            options.defaultView = 'month'
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T05:00:00',
               start: '2014-11-10T05:00:00',
               end: '2014-11-10T07:00:00',
               end: '2014-11-10T07:00:00',
@@ -34,20 +34,20 @@ describe('event constraint', function() {
                 start: '04:00',
                 start: '04:00',
                 end: '20:00'
                 end: '20:00'
               }
               }
-            } ];
+            } ]
             testEventDrag(options, '2014-11-14', true, function() {
             testEventDrag(options, '2014-11-14', true, function() {
-              var event = currentCalendar.clientEvents()[0];
-              expect(event.start).toEqualMoment('2014-11-14T05:00:00');
-              expect(event.end).toEqualMoment('2014-11-14T07:00:00');
-              done();
-            });
-          });
-        });
-      });
+              var event = currentCalendar.clientEvents()[0]
+              expect(event.start).toEqualMoment('2014-11-14T05:00:00')
+              expect(event.end).toEqualMoment('2014-11-14T07:00:00')
+              done()
+            })
+          })
+        })
+      })
 
 
       describe('to the start of the constraint range', function() {
       describe('to the start of the constraint range', function() {
         it('allows a drag', function(done) {
         it('allows a drag', function(done) {
-          var options = {};         
+          var options = {}
           options.events = [ {
           options.events = [ {
             start: '2014-11-10T01:00:00',
             start: '2014-11-10T01:00:00',
             end: '2014-11-10T02:00:00',
             end: '2014-11-10T02:00:00',
@@ -55,16 +55,16 @@ describe('event constraint', function() {
               start: '2014-11-10T03:00:00',
               start: '2014-11-10T03:00:00',
               end: '2014-11-10T06:00:00'
               end: '2014-11-10T06:00:00'
             }
             }
-          } ];
-          testEventDrag(options, '2014-11-10T03:00:00', true, done);
-        });
-      });
+          } ]
+          testEventDrag(options, '2014-11-10T03:00:00', true, done)
+        })
+      })
 
 
       describe('to the end of the constraint range', function() {
       describe('to the end of the constraint range', function() {
         describe('when the event has an explicit end', function() {
         describe('when the event has an explicit end', function() {
           it('allows a drag', function(done) {
           it('allows a drag', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T01:00:00',
               start: '2014-11-10T01:00:00',
               end: '2014-11-10T02:00:00',
               end: '2014-11-10T02:00:00',
@@ -72,31 +72,31 @@ describe('event constraint', function() {
                 start: '2014-11-10T03:00:00',
                 start: '2014-11-10T03:00:00',
                 end: '2014-11-10T06:00:00'
                 end: '2014-11-10T06:00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T05:00:00', true, done);
-          });
-        });
+            } ]
+            testEventDrag(options, '2014-11-10T05:00:00', true, done)
+          })
+        })
         describe('when the event has an implied end', function() {
         describe('when the event has an implied end', function() {
           it('allows a drag', function(done) {
           it('allows a drag', function(done) {
-            var options = {};
-          
-            options.defaultTimedEventDuration = '01:30:00';
+            var options = {}
+
+            options.defaultTimedEventDuration = '01:30:00'
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T01:00:00',
               start: '2014-11-10T01:00:00',
               constraint: {
               constraint: {
                 start: '2014-11-10T03:00:00',
                 start: '2014-11-10T03:00:00',
                 end: '2014-11-10T06:00:00'
                 end: '2014-11-10T06:00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T04:30:00', true, done);
-          });
-        });
-      });
+            } ]
+            testEventDrag(options, '2014-11-10T04:30:00', true, done)
+          })
+        })
+      })
 
 
       describe('before a constraint range', function() {
       describe('before a constraint range', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-10T01:00:00',
             start: '2014-11-10T01:00:00',
             end: '2014-11-10T02:00:00',
             end: '2014-11-10T02:00:00',
@@ -104,17 +104,17 @@ describe('event constraint', function() {
               start: '2014-11-10T03:00:00',
               start: '2014-11-10T03:00:00',
               end: '2014-11-10T06:00:00'
               end: '2014-11-10T06:00:00'
             }
             }
-          } ];
-          testEventDrag(options, '2014-11-10T02:00:00', false, done);
-        });
-      });
+          } ]
+          testEventDrag(options, '2014-11-10T02:00:00', false, done)
+        })
+      })
 
 
       describe('after a constraint range', function() {
       describe('after a constraint range', function() {
         describe('using an event object\'s constraint', function() {
         describe('using an event object\'s constraint', function() {
           describe('when in agendaWeek view with timed events', function() {
           describe('when in agendaWeek view with timed events', function() {
             it('does not allow a drag', function(done) {
             it('does not allow a drag', function(done) {
-              var options = {};
-              
+              var options = {}
+
               options.events = [ {
               options.events = [ {
                 start: '2014-11-10T01:00:00',
                 start: '2014-11-10T01:00:00',
                 end: '2014-11-10T02:00:00',
                 end: '2014-11-10T02:00:00',
@@ -122,16 +122,16 @@ describe('event constraint', function() {
                   start: '2014-11-10T03:00:00',
                   start: '2014-11-10T03:00:00',
                   end: '2014-11-10T06:00:00'
                   end: '2014-11-10T06:00:00'
                 }
                 }
-              } ];
-              testEventDrag(options, '2014-11-10T06:00:00', false, done);
-            });
-          });
-          describe('when in month view', function() {           
-            pushOptions({defaultView:'month'});
+              } ]
+              testEventDrag(options, '2014-11-10T06:00:00', false, done)
+            })
+          })
+          describe('when in month view', function() {
+            pushOptions({defaultView: 'month'})
             describe('with timed event and all-day constraint', function() {
             describe('with timed event and all-day constraint', function() {
               it('does not allow a drag', function(done) {
               it('does not allow a drag', function(done) {
-                var options = {};
-          
+                var options = {}
+
                 options.events = [ {
                 options.events = [ {
                   start: '2014-11-10T01:00:00',
                   start: '2014-11-10T01:00:00',
                   end: '2014-11-10T02:00:00',
                   end: '2014-11-10T02:00:00',
@@ -139,14 +139,14 @@ describe('event constraint', function() {
                     start: '2014-11-10',
                     start: '2014-11-10',
                     end: '2014-11-11'
                     end: '2014-11-11'
                   }
                   }
-                } ];
-                testEventDrag(options, '2014-11-12', false, done);
-              });
-            });
+                } ]
+                testEventDrag(options, '2014-11-12', false, done)
+              })
+            })
             describe('with timed event and timed constraint', function() {
             describe('with timed event and timed constraint', function() {
               it('does not allow a drag', function(done) {
               it('does not allow a drag', function(done) {
-                var options = {};
-          
+                var options = {}
+
                 options.events = [ {
                 options.events = [ {
                   start: '2014-11-10T01:00:00',
                   start: '2014-11-10T01:00:00',
                   end: '2014-11-10T02:00:00',
                   end: '2014-11-10T02:00:00',
@@ -154,14 +154,14 @@ describe('event constraint', function() {
                     start: '2014-11-10T00:00:00',
                     start: '2014-11-10T00:00:00',
                     end: '2014-11-11T12:00:00'
                     end: '2014-11-11T12:00:00'
                   }
                   }
-                } ];
-                testEventDrag(options, '2014-11-12', false, done);
-              });
-            });
+                } ]
+                testEventDrag(options, '2014-11-12', false, done)
+              })
+            })
             describe('with all-day event and all-day constraint', function() {
             describe('with all-day event and all-day constraint', function() {
               it('does not allow a drag', function(done) {
               it('does not allow a drag', function(done) {
-                var options = {};
-          
+                var options = {}
+
                 options.events = [ {
                 options.events = [ {
                   start: '2014-11-10',
                   start: '2014-11-10',
                   end: '2014-11-12',
                   end: '2014-11-12',
@@ -169,14 +169,14 @@ describe('event constraint', function() {
                     start: '2014-11-09',
                     start: '2014-11-09',
                     end: '2014-11-13'
                     end: '2014-11-13'
                   }
                   }
-                } ];
-                testEventDrag(options, '2014-11-13', false, done);
-              });
-            });
+                } ]
+                testEventDrag(options, '2014-11-13', false, done)
+              })
+            })
             describe('with all-day event and timed constraint', function() {
             describe('with all-day event and timed constraint', function() {
               it('does not allow a drag', function(done) {
               it('does not allow a drag', function(done) {
-                var options = {};
-          
+                var options = {}
+
                 options.events = [ {
                 options.events = [ {
                   start: '2014-11-10',
                   start: '2014-11-10',
                   end: '2014-11-12',
                   end: '2014-11-12',
@@ -184,16 +184,16 @@ describe('event constraint', function() {
                     start: '2014-11-09T01:00:00',
                     start: '2014-11-09T01:00:00',
                     end: '2014-11-12T23:00:00'
                     end: '2014-11-12T23:00:00'
                   }
                   }
-                } ];
-                testEventDrag(options, '2014-11-13', false, done);
-              });
-            });
-          });
-        });
+                } ]
+                testEventDrag(options, '2014-11-13', false, done)
+              })
+            })
+          })
+        })
         describe('using an event source\'s constraint', function() {
         describe('using an event source\'s constraint', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.eventSources = [ {
             options.eventSources = [ {
               events: [ {
               events: [ {
                 start: '2014-11-10T01:00:00',
                 start: '2014-11-10T01:00:00',
@@ -203,43 +203,43 @@ describe('event constraint', function() {
                 start: '2014-11-10T03:00:00',
                 start: '2014-11-10T03:00:00',
                 end: '2014-11-10T06:00:00'
                 end: '2014-11-10T06:00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T06:00:00', false, done);
-          });
-        });
+            } ]
+            testEventDrag(options, '2014-11-10T06:00:00', false, done)
+          })
+        })
         describe('using eventConstraint', function() {
         describe('using eventConstraint', function() {
           it('does not allow a drag and doesnt call eventDataTransform', function(done) {
           it('does not allow a drag and doesnt call eventDataTransform', function(done) {
-            var options = {};
-            
+            var options = {}
+
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T01:00:00',
               start: '2014-11-10T01:00:00',
               end: '2014-11-10T02:00:00'
               end: '2014-11-10T02:00:00'
-            } ];
+            } ]
 
 
             options.eventConstraint = {
             options.eventConstraint = {
               start: '2014-11-10T03:00:00',
               start: '2014-11-10T03:00:00',
               end: '2014-11-10T06:00:00'
               end: '2014-11-10T06:00:00'
-            };
+            }
 
 
             options.eventDataTransform = function(inData) {
             options.eventDataTransform = function(inData) {
-              return inData;
-            };
+              return inData
+            }
 
 
-            spyOn(options, 'eventDataTransform').and.callThrough();
+            spyOn(options, 'eventDataTransform').and.callThrough()
 
 
             testEventDrag(options, '2014-11-10T06:00:00', false, function() {
             testEventDrag(options, '2014-11-10T06:00:00', false, function() {
-              expect(options.eventDataTransform.calls.count()).toBe(1); // only initial parse
-              done();
-            });
-          });
-        });
-      });
+              expect(options.eventDataTransform.calls.count()).toBe(1) // only initial parse
+              done()
+            })
+          })
+        })
+      })
 
 
       describe('intersecting the constraint start', function() {
       describe('intersecting the constraint start', function() {
         describe('with no timezone', function() {
         describe('with no timezone', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T03:00:00',
               start: '2014-11-10T03:00:00',
               end: '2014-11-10T05:00:00',
               end: '2014-11-10T05:00:00',
@@ -247,15 +247,15 @@ describe('event constraint', function() {
                 start: '2014-11-10T03:00:00',
                 start: '2014-11-10T03:00:00',
                 end: '2014-11-10T06:00:00'
                 end: '2014-11-10T06:00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T02:00:00', false, done);
-          });
-        });
+            } ]
+            testEventDrag(options, '2014-11-10T02:00:00', false, done)
+          })
+        })
         describe('with UTC timezone', function() {
         describe('with UTC timezone', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
-            options.timezone = 'UTC';
+            var options = {}
+
+            options.timezone = 'UTC'
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T03:00:00+00:00',
               start: '2014-11-10T03:00:00+00:00',
               end: '2014-11-10T05:00:00+00:00',
               end: '2014-11-10T05:00:00+00:00',
@@ -263,17 +263,17 @@ describe('event constraint', function() {
                 start: '2014-11-10T03:00:00+00:00',
                 start: '2014-11-10T03:00:00+00:00',
                 end: '2014-11-10T06:00:00+00:00'
                 end: '2014-11-10T06:00:00+00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T02:00:00+00:00', false, done);
-          });
-        });
-      });
+            } ]
+            testEventDrag(options, '2014-11-10T02:00:00+00:00', false, done)
+          })
+        })
+      })
 
 
       describe('intersecting the constraint end', function() {
       describe('intersecting the constraint end', function() {
         describe('when the event has an explicit end', function() {
         describe('when the event has an explicit end', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T03:00:00',
               start: '2014-11-10T03:00:00',
               end: '2014-11-10T05:00:00',
               end: '2014-11-10T05:00:00',
@@ -281,30 +281,30 @@ describe('event constraint', function() {
                 start: '2014-11-10T03:00:00',
                 start: '2014-11-10T03:00:00',
                 end: '2014-11-10T06:00:00'
                 end: '2014-11-10T06:00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T05:00:00', false, done);
-          });
-        });
+            } ]
+            testEventDrag(options, '2014-11-10T05:00:00', false, done)
+          })
+        })
         describe('when the event has an implied end', function() {
         describe('when the event has an implied end', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
-            options.defaultTimedEventDuration = '02:30';
+            var options = {}
+
+            options.defaultTimedEventDuration = '02:30'
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T03:00:00',
               start: '2014-11-10T03:00:00',
               constraint: {
               constraint: {
                 start: '2014-11-10T03:00:00',
                 start: '2014-11-10T03:00:00',
                 end: '2014-11-10T12:00:00'
                 end: '2014-11-10T12:00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T10:00:00', false, done);
-          });
-        });
+            } ]
+            testEventDrag(options, '2014-11-10T10:00:00', false, done)
+          })
+        })
         describe('with UTC timezone', function() {
         describe('with UTC timezone', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
-            options.timezone = 'UTC';
+            var options = {}
+
+            options.timezone = 'UTC'
             options.events = [ {
             options.events = [ {
               start: '2014-11-10T03:00:00+00:00',
               start: '2014-11-10T03:00:00+00:00',
               end: '2014-11-10T05:00:00+00:00',
               end: '2014-11-10T05:00:00+00:00',
@@ -312,16 +312,16 @@ describe('event constraint', function() {
                 start: '2014-11-10T03:00:00+00:00',
                 start: '2014-11-10T03:00:00+00:00',
                 end: '2014-11-10T06:00:00+00:00'
                 end: '2014-11-10T06:00:00+00:00'
               }
               }
-            } ];
-            testEventDrag(options, '2014-11-10T05:00:00+00:00', false, done);
-          });
-        });
-      });
+            } ]
+            testEventDrag(options, '2014-11-10T05:00:00+00:00', false, done)
+          })
+        })
+      })
 
 
       describe('into a constraint it encompasses', function() {
       describe('into a constraint it encompasses', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-10T01:00:00',
             start: '2014-11-10T01:00:00',
             end: '2014-11-10T05:00:00',
             end: '2014-11-10T05:00:00',
@@ -329,19 +329,19 @@ describe('event constraint', function() {
               start: '2014-11-10T12:00:00',
               start: '2014-11-10T12:00:00',
               end: '2014-11-10T14:00:00'
               end: '2014-11-10T14:00:00'
             }
             }
-          } ];
-          testEventDrag(options, '2014-11-10T10:00:00', false, done);
-        });
-      });
+          } ]
+          testEventDrag(options, '2014-11-10T10:00:00', false, done)
+        })
+      })
 
 
-    });
+    })
 
 
     describe('when an event is being resized', function() {
     describe('when an event is being resized', function() {
 
 
       describe('when the start is already outside the constraint', function() {
       describe('when the start is already outside the constraint', function() {
         it('does not allow a resize', function(done) {
         it('does not allow a resize', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T01:00:00',
             start: '2014-11-12T01:00:00',
             end: '2014-11-12T03:00:00',
             end: '2014-11-12T03:00:00',
@@ -349,15 +349,15 @@ describe('event constraint', function() {
               start: '2014-11-12T02:00:00',
               start: '2014-11-12T02:00:00',
               end: '2014-11-12T22:00:00'
               end: '2014-11-12T22:00:00'
             }
             }
-          } ];
-          testEventResize(options, '2014-11-12T10:00:00', false, done);
-        });
-      });
+          } ]
+          testEventResize(options, '2014-11-12T10:00:00', false, done)
+        })
+      })
 
 
       describe('when resized well within the constraint', function() {
       describe('when resized well within the constraint', function() {
         it('allows a resize', function(done) {
         it('allows a resize', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T02:00:00',
             start: '2014-11-12T02:00:00',
             end: '2014-11-12T04:00:00',
             end: '2014-11-12T04:00:00',
@@ -365,15 +365,15 @@ describe('event constraint', function() {
               start: '2014-11-12T01:00:00',
               start: '2014-11-12T01:00:00',
               end: '2014-11-12T22:00:00'
               end: '2014-11-12T22:00:00'
             }
             }
-          } ];
-          testEventResize(options, '2014-11-12T10:00:00', true, done);
-        });
-      });
+          } ]
+          testEventResize(options, '2014-11-12T10:00:00', true, done)
+        })
+      })
 
 
       describe('when resized to the end of the constraint', function() {
       describe('when resized to the end of the constraint', function() {
         it('allows a resize', function(done) {
         it('allows a resize', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T02:00:00',
             start: '2014-11-12T02:00:00',
             end: '2014-11-12T04:00:00',
             end: '2014-11-12T04:00:00',
@@ -381,15 +381,15 @@ describe('event constraint', function() {
               start: '2014-11-12T01:00:00',
               start: '2014-11-12T01:00:00',
               end: '2014-11-12T06:00:00'
               end: '2014-11-12T06:00:00'
             }
             }
-          } ];
-          testEventResize(options, '2014-11-12T06:00:00', true, done);
-        });
-      });
+          } ]
+          testEventResize(options, '2014-11-12T06:00:00', true, done)
+        })
+      })
 
 
       describe('when resized past the end of the constraint', function() {
       describe('when resized past the end of the constraint', function() {
         it('does not allow a resize', function(done) {
         it('does not allow a resize', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T02:00:00',
             start: '2014-11-12T02:00:00',
             end: '2014-11-12T04:00:00',
             end: '2014-11-12T04:00:00',
@@ -397,13 +397,13 @@ describe('event constraint', function() {
               start: '2014-11-12T01:00:00',
               start: '2014-11-12T01:00:00',
               end: '2014-11-12T06:00:00'
               end: '2014-11-12T06:00:00'
             }
             }
-          } ];
-          testEventResize(options, '2014-11-12T07:00:00', false, done);
-        });
-      });
+          } ]
+          testEventResize(options, '2014-11-12T07:00:00', false, done)
+        })
+      })
 
 
-    });
-  });
+    })
+  })
 
 
   describe('when used with a recurring date range', function() {
   describe('when used with a recurring date range', function() {
 
 
@@ -412,8 +412,8 @@ describe('event constraint', function() {
       describe('to the middle of the constraint range', function() {
       describe('to the middle of the constraint range', function() {
 
 
         it('allows a drag', function(done) {
         it('allows a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T01:00:00',
             start: '2014-11-12T01:00:00',
             end: '2014-11-12T03:00:00',
             end: '2014-11-12T03:00:00',
@@ -421,15 +421,15 @@ describe('event constraint', function() {
               start: '04:00:00',
               start: '04:00:00',
               end: '08:00:00'
               end: '08:00:00'
             }
             }
-          } ];
-          testEventDrag(options, '2014-11-12T05:00:00', true, done);
-        });
-      });
+          } ]
+          testEventDrag(options, '2014-11-12T05:00:00', true, done)
+        })
+      })
 
 
       describe('outside of a constraint range', function() {
       describe('outside of a constraint range', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T01:00:00',
             start: '2014-11-12T01:00:00',
             end: '2014-11-12T03:00:00',
             end: '2014-11-12T03:00:00',
@@ -437,15 +437,15 @@ describe('event constraint', function() {
               start: '04:00:00',
               start: '04:00:00',
               end: '08:00:00'
               end: '08:00:00'
             }
             }
-          } ];
-          testEventDrag(options, '2014-11-12T07:00:00', false, done);
-        });
-      });
+          } ]
+          testEventDrag(options, '2014-11-12T07:00:00', false, done)
+        })
+      })
 
 
       describe('on an off-day of a constraint range', function() {
       describe('on an off-day of a constraint range', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T01:00:00',
             start: '2014-11-12T01:00:00',
             end: '2014-11-12T03:00:00',
             end: '2014-11-12T03:00:00',
@@ -454,71 +454,71 @@ describe('event constraint', function() {
               end: '08:00:00',
               end: '08:00:00',
               dow: [ 0, 1, 2, 3, 5, 6 ] // except Thursday
               dow: [ 0, 1, 2, 3, 5, 6 ] // except Thursday
             }
             }
-          } ];
-          testEventDrag(options, '2014-11-13T05:00:00', false, done); // drag to Thursday
-        });
-      });
-    });
-  });
+          } ]
+          testEventDrag(options, '2014-11-13T05:00:00', false, done) // drag to Thursday
+        })
+      })
+    })
+  })
 
 
   describe('when used with businessHours', function() {
   describe('when used with businessHours', function() {
 
 
     describe('when an event is being dragged', function() {
     describe('when an event is being dragged', function() {
 
 
       describe('to the middle of the constraint range', function() {
       describe('to the middle of the constraint range', function() {
-        
+
         it('allows a drag', function(done) {
         it('allows a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.businessHours = {
           options.businessHours = {
             start: '02:00',
             start: '02:00',
             end: '06:00'
             end: '06:00'
-          };
+          }
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T01:00:00',
             start: '2014-11-12T01:00:00',
             end: '2014-11-12T02:00:00',
             end: '2014-11-12T02:00:00',
             constraint: 'businessHours'
             constraint: 'businessHours'
-          } ];
-          testEventDrag(options, '2014-11-12T03:00:00', true, done);
-        });
-      });
+          } ]
+          testEventDrag(options, '2014-11-12T03:00:00', true, done)
+        })
+      })
 
 
       describe('outside of a constraint range', function() {
       describe('outside of a constraint range', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.businessHours = {
           options.businessHours = {
             start: '02:00',
             start: '02:00',
             end: '06:00'
             end: '06:00'
-          };
+          }
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T01:00:00',
             start: '2014-11-12T01:00:00',
             end: '2014-11-12T02:30:00',
             end: '2014-11-12T02:30:00',
             constraint: 'businessHours'
             constraint: 'businessHours'
-          } ];
-          testEventDrag(options, '2014-11-12T05:00:00', false, done);
-        });
-      });
+          } ]
+          testEventDrag(options, '2014-11-12T05:00:00', false, done)
+        })
+      })
 
 
       describe('on an off-day of a constraint range', function() {
       describe('on an off-day of a constraint range', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.businessHours = {
           options.businessHours = {
             start: '02:00',
             start: '02:00',
             end: '06:00',
             end: '06:00',
             dow: [ 1, 2, 3, 4 ] // Mon - Thurs
             dow: [ 1, 2, 3, 4 ] // Mon - Thurs
-          };
+          }
           options.events = [ {
           options.events = [ {
             start: '2014-11-12T01:00:00',
             start: '2014-11-12T01:00:00',
             end: '2014-11-12T02:30:00',
             end: '2014-11-12T02:30:00',
             constraint: 'businessHours'
             constraint: 'businessHours'
-          } ];
-          testEventDrag(options, '2014-11-14T03:00:00', false, done); // Friday
-        });
-      });
-    });
-  });
+          } ]
+          testEventDrag(options, '2014-11-14T03:00:00', false, done) // Friday
+        })
+      })
+    })
+  })
 
 
   describe('when used with an event ID', function() {
   describe('when used with an event ID', function() {
 
 
@@ -526,8 +526,8 @@ describe('event constraint', function() {
 
 
       describe('to the middle of the constraint range', function() {
       describe('to the middle of the constraint range', function() {
         it('allows a drag', function(done) {
         it('allows a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [
           options.events = [
             {
             {
               start: '2014-11-12T01:00:00',
               start: '2014-11-12T01:00:00',
@@ -540,16 +540,16 @@ describe('event constraint', function() {
               start: '2014-11-13T01:00:00',
               start: '2014-11-13T01:00:00',
               end: '2014-11-13T05:00:00'
               end: '2014-11-13T05:00:00'
             }
             }
-          ];
-          testEventDrag(options, '2014-11-13T02:00:00', true, done, 'dragging-event');
-        });
-      });
+          ]
+          testEventDrag(options, '2014-11-13T02:00:00', true, done, 'dragging-event')
+        })
+      })
 
 
       describe('outside of a foreground event constraint', function() {
       describe('outside of a foreground event constraint', function() {
         describe('with an explicit end time', function() {
         describe('with an explicit end time', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.events = [
             options.events = [
               {
               {
                 start: '2014-11-12T01:00:00',
                 start: '2014-11-12T01:00:00',
@@ -562,15 +562,15 @@ describe('event constraint', function() {
                 start: '2014-11-13T01:00:00',
                 start: '2014-11-13T01:00:00',
                 end: '2014-11-13T04:00:00'
                 end: '2014-11-13T04:00:00'
               }
               }
-            ];
-            testEventDrag(options, '2014-11-13T04:00:00', false, done, 'dragging-event');
-          });
-        });
+            ]
+            testEventDrag(options, '2014-11-13T04:00:00', false, done, 'dragging-event')
+          })
+        })
         describe('when an implied end time', function() {
         describe('when an implied end time', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-            
-            options.defaultTimedEventDuration = '01:00:00';
+            var options = {}
+
+            options.defaultTimedEventDuration = '01:00:00'
             options.events = [
             options.events = [
               {
               {
                 start: '2014-11-12T01:00:00',
                 start: '2014-11-12T01:00:00',
@@ -582,16 +582,16 @@ describe('event constraint', function() {
                 id: 'yo',
                 id: 'yo',
                 start: '2014-11-13T01:00:00'
                 start: '2014-11-13T01:00:00'
               }
               }
-            ];
-            testEventDrag(options, '2014-11-13T01:00:00', false, done, 'dragging-event');
-          });
-        });
-      });
+            ]
+            testEventDrag(options, '2014-11-13T01:00:00', false, done, 'dragging-event')
+          })
+        })
+      })
 
 
       describe('outside of a background-event constraint', function() {
       describe('outside of a background-event constraint', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [
           options.events = [
             {
             {
               start: '2014-11-12T01:00:00',
               start: '2014-11-12T01:00:00',
@@ -605,297 +605,297 @@ describe('event constraint', function() {
               end: '2014-11-13T04:00:00',
               end: '2014-11-13T04:00:00',
               rendering: 'background'
               rendering: 'background'
             }
             }
-          ];
-          testEventDrag(options, '2014-11-13T04:00:00', false, done, 'dragging-event');
-        });
-      });
+          ]
+          testEventDrag(options, '2014-11-13T04:00:00', false, done, 'dragging-event')
+        })
+      })
 
 
       describe('when the event ID constraint matches no events', function() {
       describe('when the event ID constraint matches no events', function() {
         it('does not allow a drag', function(done) {
         it('does not allow a drag', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.events = [
           options.events = [
             {
             {
               start: '2014-11-12T01:00:00',
               start: '2014-11-12T01:00:00',
               end: '2014-11-12T03:00:00',
               end: '2014-11-12T03:00:00',
               constraint: 'yo'
               constraint: 'yo'
             }
             }
-          ];
-          testEventDrag(options, '2014-11-13T04:00:00', false, done);
-        });
-      });
+          ]
+          testEventDrag(options, '2014-11-13T04:00:00', false, done)
+        })
+      })
 
 
-      describe('when in month view', function() {       
-        pushOptions({defaultView: 'month'});
+      describe('when in month view', function() {
+        pushOptions({defaultView: 'month'})
         describe('when the event ID constraint matches no events', function() {
         describe('when the event ID constraint matches no events', function() {
           it('does not allow a drag', function(done) {
           it('does not allow a drag', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.events = [
             options.events = [
               {
               {
                 start: '2014-11-12',
                 start: '2014-11-12',
                 end: '2014-11-12',
                 end: '2014-11-12',
                 constraint: 'yo'
                 constraint: 'yo'
               }
               }
-            ];
-            testEventDrag(options, '2014-11-13', false, done);
-          });
-        });
-      });
-    });
-  });
-});
-
-describe('selectConstraint', function() { 
-      
+            ]
+            testEventDrag(options, '2014-11-13', false, done)
+          })
+        })
+      })
+    })
+  })
+})
+
+describe('selectConstraint', function() {
+
   pushOptions({
   pushOptions({
-    defaultDate:'2014-11-10',     
-    defaultView:'agendaWeek',
-    scrollTime:'00:00',       
-  });
+    defaultDate: '2014-11-10',
+    defaultView: 'agendaWeek',
+    scrollTime: '00:00'
+  })
 
 
   describe('when used with a specific date range', function() {
   describe('when used with a specific date range', function() {
 
 
     describe('when dragged clearly within', function() {
     describe('when dragged clearly within', function() {
       it('allows a selection', function(done) {
       it('allows a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '2014-11-12T01:00:00',
           start: '2014-11-12T01:00:00',
           end: '2014-11-12T20:00:00'
           end: '2014-11-12T20:00:00'
-        };
-        testSelection(options, '03:00', '2014-11-12T10:00:00', true, done);
-      });
-    });
+        }
+        testSelection(options, '03:00', '2014-11-12T10:00:00', true, done)
+      })
+    })
 
 
     describe('when dragged within, starting with the constraint start', function() {
     describe('when dragged within, starting with the constraint start', function() {
       it('allows a selection', function(done) {
       it('allows a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '2014-11-12T01:00:00',
           start: '2014-11-12T01:00:00',
           end: '2014-11-12T20:00:00'
           end: '2014-11-12T20:00:00'
-        };
-        testSelection(options, '01:00', '2014-11-12T05:00:00', true, done);
-      });
-    });
+        }
+        testSelection(options, '01:00', '2014-11-12T05:00:00', true, done)
+      })
+    })
 
 
     describe('when dragged within, ending with the constraint end', function() {
     describe('when dragged within, ending with the constraint end', function() {
       it('allows a selection', function(done) {
       it('allows a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '2014-11-12T01:00:00',
           start: '2014-11-12T01:00:00',
           end: '2014-11-12T05:00:00'
           end: '2014-11-12T05:00:00'
-        };
-        testSelection(options, '03:00', '2014-11-12T05:00:00', true, done);
-      });
-    });
+        }
+        testSelection(options, '03:00', '2014-11-12T05:00:00', true, done)
+      })
+    })
 
 
     describe('when dragged intersecting the constraint start', function() {
     describe('when dragged intersecting the constraint start', function() {
       it('does not allow a selection', function(done) {
       it('does not allow a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '2014-11-12T03:00:00',
           start: '2014-11-12T03:00:00',
           end: '2014-11-12T20:00:00'
           end: '2014-11-12T20:00:00'
-        };
-        testSelection(options, '02:00', '2014-11-12T04:00:00', false, done);
-      });
-    });
+        }
+        testSelection(options, '02:00', '2014-11-12T04:00:00', false, done)
+      })
+    })
 
 
     describe('when dragged intersecting the constraint end', function() {
     describe('when dragged intersecting the constraint end', function() {
       it('does not allow a selection', function(done) {
       it('does not allow a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '2014-11-12T03:00:00',
           start: '2014-11-12T03:00:00',
           end: '2014-11-12T07:00:00'
           end: '2014-11-12T07:00:00'
-        };
-        testSelection(options, '04:00', '2014-11-12T08:00:00', false, done);
-      });
-    });
+        }
+        testSelection(options, '04:00', '2014-11-12T08:00:00', false, done)
+      })
+    })
 
 
     describe('when dragged after the constraint', function() {
     describe('when dragged after the constraint', function() {
       describe('when in agendaWeek view with timed events', function() {
       describe('when in agendaWeek view with timed events', function() {
         it('does not allow a selection', function(done) {
         it('does not allow a selection', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.selectConstraint = {
           options.selectConstraint = {
             start: '2014-11-12T03:00:00',
             start: '2014-11-12T03:00:00',
             end: '2014-11-12T05:00:00'
             end: '2014-11-12T05:00:00'
-          };
-          testSelection(options, '05:00', '2014-11-12T07:00:00', false, done);
-        });
-      });
-      describe('when in month view', function() {       
-        pushOptions({defaultView: 'month'});
+          }
+          testSelection(options, '05:00', '2014-11-12T07:00:00', false, done)
+        })
+      })
+      describe('when in month view', function() {
+        pushOptions({defaultView: 'month'})
         describe('when an all-day constraint', function() {
         describe('when an all-day constraint', function() {
           it('does not allow a selection', function(done) {
           it('does not allow a selection', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.selectConstraint = {
             options.selectConstraint = {
               start: '2014-11-13',
               start: '2014-11-13',
               end: '2014-11-14'
               end: '2014-11-14'
-            };
-            testSelection(options, null, '2014-11-14', false, done);
-          });
-        });
+            }
+            testSelection(options, null, '2014-11-14', false, done)
+          })
+        })
         describe('when a timed constraint, out of bounds', function() {
         describe('when a timed constraint, out of bounds', function() {
           it('does not allow a selection', function(done) {
           it('does not allow a selection', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.selectConstraint = {
             options.selectConstraint = {
               start: '2014-11-12T01:00:00',
               start: '2014-11-12T01:00:00',
               end: '2014-11-14T00:00:00'
               end: '2014-11-14T00:00:00'
-            };
-            testSelection(options, null, '2014-11-14', false, done);
-          });
-        });
+            }
+            testSelection(options, null, '2014-11-14', false, done)
+          })
+        })
         describe('when a timed constraint, in bounds', function() {
         describe('when a timed constraint, in bounds', function() {
           it('allows a selection', function(done) {
           it('allows a selection', function(done) {
-            var options = {};
-          
+            var options = {}
+
             options.selectConstraint = {
             options.selectConstraint = {
               start: '2014-11-12T00:00:00',
               start: '2014-11-12T00:00:00',
               end: '2014-11-14T00:00:00'
               end: '2014-11-14T00:00:00'
-            };
-            testSelection(options, null, '2014-11-14', true, done);
-          });
-        });
-      });
-    });
-  });
+            }
+            testSelection(options, null, '2014-11-14', true, done)
+          })
+        })
+      })
+    })
+  })
 
 
   describe('when used with a recurring date range', function() {
   describe('when used with a recurring date range', function() {
 
 
     describe('to the middle of the constraint range', function() {
     describe('to the middle of the constraint range', function() {
       it('allows a selection when in bounds', function(done) {
       it('allows a selection when in bounds', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '01:00:00',
           start: '01:00:00',
           end: '05:00:00'
           end: '05:00:00'
-        };
-        testSelection(options, '02:00', '2014-11-12T04:00:00', true, done);
-      });
-    });
+        }
+        testSelection(options, '02:00', '2014-11-12T04:00:00', true, done)
+      })
+    })
 
 
     describe('outside of a constraint range', function() {
     describe('outside of a constraint range', function() {
       it('does not allow a selection when single day', function(done) {
       it('does not allow a selection when single day', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '01:00:00',
           start: '01:00:00',
           end: '05:00:00'
           end: '05:00:00'
-        };
-        testSelection(options, '02:00', '2014-11-12T06:00:00', false, done);
-      });
+        }
+        testSelection(options, '02:00', '2014-11-12T06:00:00', false, done)
+      })
       it('does not allow a selection when multiday', function(done) {
       it('does not allow a selection when multiday', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.selectConstraint = {
         options.selectConstraint = {
           start: '01:00:00',
           start: '01:00:00',
           end: '05:00:00'
           end: '05:00:00'
-        };
-        testSelection(options, '02:00', '2014-11-14T04:00:00', false, done);
-      });
-    });
-  });
+        }
+        testSelection(options, '02:00', '2014-11-14T04:00:00', false, done)
+      })
+    })
+  })
 
 
   describe('when used with businessHours', function() {
   describe('when used with businessHours', function() {
 
 
     describe('to the middle of the constraint range', function() {
     describe('to the middle of the constraint range', function() {
       it('allows a selection', function(done) {
       it('allows a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.businessHours = {
         options.businessHours = {
           start: '01:00:00',
           start: '01:00:00',
           end: '05:00:00'
           end: '05:00:00'
-        };
-        options.selectConstraint = 'businessHours';
-        testSelection(options, '02:00', '2014-11-12T04:00:00', true, done);
-      });
-    });
+        }
+        options.selectConstraint = 'businessHours'
+        testSelection(options, '02:00', '2014-11-12T04:00:00', true, done)
+      })
+    })
 
 
     describe('outside of a constraint range', function() {
     describe('outside of a constraint range', function() {
       it('does not allow a selection', function(done) {
       it('does not allow a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.businessHours = {
         options.businessHours = {
           start: '01:00:00',
           start: '01:00:00',
           end: '05:00:00'
           end: '05:00:00'
-        };
-        options.selectConstraint = 'businessHours';
-        testSelection(options, '02:00', '2014-11-12T06:00:00', false, done);
-      });
-    });
+        }
+        options.selectConstraint = 'businessHours'
+        testSelection(options, '02:00', '2014-11-12T06:00:00', false, done)
+      })
+    })
 
 
     describe('with a custom dow when dragged to a dead day', function() {
     describe('with a custom dow when dragged to a dead day', function() {
       it('does not allow a selection', function(done) {
       it('does not allow a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.businessHours = {
         options.businessHours = {
           start: '01:00:00',
           start: '01:00:00',
           end: '05:00:00',
           end: '05:00:00',
           dow: [ 1, 2, 4, 5 ] // Mon,Tue,Thu,Fri
           dow: [ 1, 2, 4, 5 ] // Mon,Tue,Thu,Fri
-        };
-        options.selectConstraint = 'businessHours';
-        testSelection(options, '02:00', '2014-11-12T04:00:00', false, done); // Wed
-      });
-    });
-  });
+        }
+        options.selectConstraint = 'businessHours'
+        testSelection(options, '02:00', '2014-11-12T04:00:00', false, done) // Wed
+      })
+    })
+  })
 
 
   describe('when used with an event ID', function() {
   describe('when used with an event ID', function() {
 
 
     describe('to the middle of the constraint range', function() {
     describe('to the middle of the constraint range', function() {
       it('allows a selection', function(done) {
       it('allows a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.events = [ {
         options.events = [ {
           id: 'yo',
           id: 'yo',
           start: '2014-11-12T02:00:00',
           start: '2014-11-12T02:00:00',
           end: '2014-11-12T05:00:00',
           end: '2014-11-12T05:00:00',
           rendering: 'background'
           rendering: 'background'
-        } ];
-        options.selectConstraint = 'yo';
-        testSelection(options, '03:00', '2014-11-12T04:00:00', true, done);
-      });
-    });
+        } ]
+        options.selectConstraint = 'yo'
+        testSelection(options, '03:00', '2014-11-12T04:00:00', true, done)
+      })
+    })
 
 
     describe('outside of a constraint range', function() {
     describe('outside of a constraint range', function() {
       it('does not allow a selection', function(done) {
       it('does not allow a selection', function(done) {
-        var options = {};
-        
+        var options = {}
+
         options.events = [ {
         options.events = [ {
           id: 'yo',
           id: 'yo',
           start: '2014-11-12T02:00:00',
           start: '2014-11-12T02:00:00',
           end: '2014-11-12T05:00:00',
           end: '2014-11-12T05:00:00',
           rendering: 'background'
           rendering: 'background'
-        } ];
-        options.selectConstraint = 'yo';
-        testSelection(options, '03:00', '2014-11-12T06:00:00', false, done);
-      });
-    });
+        } ]
+        options.selectConstraint = 'yo'
+        testSelection(options, '03:00', '2014-11-12T06:00:00', false, done)
+      })
+    })
 
 
     describe('when event ID does not match any events', function() {
     describe('when event ID does not match any events', function() {
       describe('when in agendaWeek view', function() {
       describe('when in agendaWeek view', function() {
         it('does not allow a selection', function(done) {
         it('does not allow a selection', function(done) {
-          var options = {};
-          
-          options.selectConstraint = 'yooo';
-          testSelection(options, '03:00', '2014-11-12T06:00:00', false, done);
-        });
-      });
+          var options = {}
+
+          options.selectConstraint = 'yooo'
+          testSelection(options, '03:00', '2014-11-12T06:00:00', false, done)
+        })
+      })
       describe('when in month view', function() {
       describe('when in month view', function() {
         it('does not allow a selection', function(done) {
         it('does not allow a selection', function(done) {
-          var options = {};
-          
-          options.defaultView = 'month';
-          options.selectConstraint = 'yooo';
-          testSelection(options, null, '2014-11-15', false, done);
-        });
-      });
-    });
-  });
-});
+          var options = {}
+
+          options.defaultView = 'month'
+          options.selectConstraint = 'yooo'
+          testSelection(options, null, '2014-11-15', false, done)
+        })
+      })
+    })
+  })
+})

+ 40 - 40
tests/legacy/constructor.js

@@ -1,23 +1,23 @@
 
 
-describe('constructor', function() {  
-  beforeEach(function(){
-    initCalendar();
+describe('constructor', function() {
+  beforeEach(function() {
+    initCalendar()
   })
   })
   it('should return a jQuery object for chaining', function() {
   it('should return a jQuery object for chaining', function() {
-    var res = $(currentCalendar.el);
-    expect(res instanceof jQuery).toBe(true);
-  });
+    var res = $(currentCalendar.el)
+    expect(res instanceof jQuery).toBe(true)
+  })
 
 
   it('should not modify the options object', function() {
   it('should not modify the options object', function() {
     var options = {
     var options = {
       defaultView: 'agendaWeek',
       defaultView: 'agendaWeek',
       scrollTime: '09:00:00',
       scrollTime: '09:00:00',
       slotDuration: { minutes: 45 }
       slotDuration: { minutes: 45 }
-    };
-    var optionsCopy = $.extend({}, options, true);
-    initCalendar(options);
-    expect(options).toEqual(optionsCopy);
-  });
+    }
+    var optionsCopy = $.extend({}, options, true)
+    initCalendar(options)
+    expect(options).toEqual(optionsCopy)
+  })
 
 
   it('should not modify the events array', function() {
   it('should not modify the events array', function() {
     var options = {
     var options = {
@@ -29,11 +29,11 @@ describe('constructor', function() {
           start: '2014-05-27'
           start: '2014-05-27'
         }
         }
       ]
       ]
-    };
-    var optionsCopy = $.extend(true, {}, options); // recursive copy
-    initCalendar(options);
-    expect(options).toEqual(optionsCopy);
-  });
+    }
+    var optionsCopy = $.extend(true, {}, options) // recursive copy
+    initCalendar(options)
+    expect(options).toEqual(optionsCopy)
+  })
 
 
   it('should not modify the eventSources array', function() {
   it('should not modify the eventSources array', function() {
     var options = {
     var options = {
@@ -47,37 +47,37 @@ describe('constructor', function() {
           }
           }
         ] }
         ] }
       ]
       ]
-    };
-    var optionsCopy = $.extend(true, {}, options); // recursive copy
-    initCalendar(options);
-    expect(options).toEqual(optionsCopy);
-  });
+    }
+    var optionsCopy = $.extend(true, {}, options) // recursive copy
+    initCalendar(options)
+    expect(options).toEqual(optionsCopy)
+  })
 
 
-  describe('when called on a div', function() {   
-    beforeEach(function(){
-      initCalendar();
+  describe('when called on a div', function() {
+    beforeEach(function() {
+      initCalendar()
     })
     })
     it('should contain a table fc-toolbar', function() {
     it('should contain a table fc-toolbar', function() {
-      var header = $(currentCalendar.el).find('.fc-toolbar');
-      expect(header[0]).not.toBeUndefined();
-    });
+      var header = $(currentCalendar.el).find('.fc-toolbar')
+      expect(header[0]).not.toBeUndefined()
+    })
 
 
     it('should contain a div fc-view-container', function() {
     it('should contain a div fc-view-container', function() {
-      var content = $(currentCalendar.el).find('.fc-view-container');
-      expect(content[0]).not.toBeUndefined();
-    });
+      var content = $(currentCalendar.el).find('.fc-view-container')
+      expect(content[0]).not.toBeUndefined()
+    })
 
 
     it('should only contain 2 elements', function() {
     it('should only contain 2 elements', function() {
-      var calenderNodeCount = $(currentCalendar.el).find('>').length;
-      expect(calenderNodeCount).toEqual(2);
-    });
+      var calenderNodeCount = $(currentCalendar.el).find('>').length
+      expect(calenderNodeCount).toEqual(2)
+    })
 
 
     describe('and then called again', function() {
     describe('and then called again', function() {
       it('should still only have a single set of calendar [header,content]', function() {
       it('should still only have a single set of calendar [header,content]', function() {
-        initCalendar();
-        var count = $(currentCalendar.el).find('>').length;
-        expect(count).toEqual(2);
-      });
-    });
-  });
-});
+        initCalendar()
+        var count = $(currentCalendar.el).find('>').length
+        expect(count).toEqual(2)
+      })
+    })
+  })
+})

+ 181 - 182
tests/legacy/current-date.js

@@ -1,259 +1,259 @@
 describe('current date', function() {
 describe('current date', function() {
 
 
-  var TITLE_FORMAT = 'MMMM D YYYY';   
+  var TITLE_FORMAT = 'MMMM D YYYY'
   pushOptions({
   pushOptions({
     titleFormat: TITLE_FORMAT,
     titleFormat: TITLE_FORMAT,
     titleRangeSeparator: ' - ',
     titleRangeSeparator: ' - ',
     defaultDate: '2014-06-01'
     defaultDate: '2014-06-01'
-  }); 
+  })
 
 
   describe('defaultDate & getDate', function() { // keep getDate
   describe('defaultDate & getDate', function() { // keep getDate
     describeWhenInMonth(function() {
     describeWhenInMonth(function() {
       it('should initialize at the date', function() {
       it('should initialize at the date', function() {
-        var options = {};
-        options.defaultDate = '2011-03-10';
-        initCalendar(options);
-        expectViewDates('2011-02-27', '2011-04-10', '2011-03-01', '2011-04-01');
-        var currentDate = currentCalendar.getDate();
-        expect(moment.isMoment(currentDate)).toEqual(true); // test the type, but only here
-        expect(currentDate).toEqualMoment('2011-03-10');
-      });
-    });
+        var options = {}
+        options.defaultDate = '2011-03-10'
+        initCalendar(options)
+        expectViewDates('2011-02-27', '2011-04-10', '2011-03-01', '2011-04-01')
+        var currentDate = currentCalendar.getDate()
+        expect(moment.isMoment(currentDate)).toEqual(true) // test the type, but only here
+        expect(currentDate).toEqualMoment('2011-03-10')
+      })
+    })
     describeWhenInWeek(function() {
     describeWhenInWeek(function() {
       it('should initialize at the date, given a date string', function() {
       it('should initialize at the date, given a date string', function() {
-        var options = {};       
-        options.defaultDate = '2011-03-10';
-        initCalendar(options);
-        expectViewDates('2011-03-06', '2011-03-13');
-        expect(currentCalendar.getDate()).toEqualMoment('2011-03-10');
-      });
+        var options = {}
+        options.defaultDate = '2011-03-10'
+        initCalendar(options)
+        expectViewDates('2011-03-06', '2011-03-13')
+        expect(currentCalendar.getDate()).toEqualMoment('2011-03-10')
+      })
       it('should initialize at the date, given a Moment object', function() {
       it('should initialize at the date, given a Moment object', function() {
-        var options = {};       
-        options.defaultDate = $.fullCalendar.moment('2011-03-10');
-        initCalendar(options);
-        expectViewDates('2011-03-06', '2011-03-13');
-        expect(currentCalendar.getDate()).toEqualMoment('2011-03-10');
-      });
-    });
+        var options = {}
+        options.defaultDate = $.fullCalendar.moment('2011-03-10')
+        initCalendar(options)
+        expectViewDates('2011-03-06', '2011-03-13')
+        expect(currentCalendar.getDate()).toEqualMoment('2011-03-10')
+      })
+    })
     describeWhenInDay(function() {
     describeWhenInDay(function() {
       it('should initialize at the date', function() {
       it('should initialize at the date', function() {
-        var options = {};       
-        options.defaultDate = '2011-03-10';
-        initCalendar(options);
-        expectViewDates('2011-03-10');
-        expect(currentCalendar.getDate()).toEqualMoment('2011-03-10');
-      });
-    });
-  });
+        var options = {}
+        options.defaultDate = '2011-03-10'
+        initCalendar(options)
+        expectViewDates('2011-03-10')
+        expect(currentCalendar.getDate()).toEqualMoment('2011-03-10')
+      })
+    })
+  })
 
 
   describe('gotoDate', function() {
   describe('gotoDate', function() {
     describeWhenInMonth(function() {
     describeWhenInMonth(function() {
       it('should go to a date when given a date string', function() {
       it('should go to a date when given a date string', function() {
-        initCalendar();
-        currentCalendar.gotoDate('2015-04-01');
-        expectViewDates('2015-03-29', '2015-05-10', '2015-04-01', '2015-05-01');
-      });
-    });
+        initCalendar()
+        currentCalendar.gotoDate('2015-04-01')
+        expectViewDates('2015-03-29', '2015-05-10', '2015-04-01', '2015-05-01')
+      })
+    })
     describeWhenInWeek(function() {
     describeWhenInWeek(function() {
       it('should go to a date when given a date string', function() {
       it('should go to a date when given a date string', function() {
-        initCalendar();
-        currentCalendar.gotoDate('2015-04-01');
-        expectViewDates('2015-03-29', '2015-04-05');
-      });
+        initCalendar()
+        currentCalendar.gotoDate('2015-04-01')
+        expectViewDates('2015-03-29', '2015-04-05')
+      })
       it('should go to a date when given a date string with a time', function() {
       it('should go to a date when given a date string with a time', function() {
-        initCalendar();
-        currentCalendar.gotoDate('2015-04-01T12:00:00');
-        expectViewDates('2015-03-29', '2015-04-05');
-      });
+        initCalendar()
+        currentCalendar.gotoDate('2015-04-01T12:00:00')
+        expectViewDates('2015-03-29', '2015-04-05')
+      })
       it('should go to a date when given a moment object', function() {
       it('should go to a date when given a moment object', function() {
-        initCalendar();
-        currentCalendar.gotoDate($.fullCalendar.moment('2015-04-01'));
-        expectViewDates('2015-03-29', '2015-04-05');
-      });
-    });
+        initCalendar()
+        currentCalendar.gotoDate($.fullCalendar.moment('2015-04-01'))
+        expectViewDates('2015-03-29', '2015-04-05')
+      })
+    })
     describeWhenInDay(function() {
     describeWhenInDay(function() {
       it('should go to a date when given a date string', function() {
       it('should go to a date when given a date string', function() {
-        initCalendar();
-        currentCalendar.gotoDate('2015-04-01');
-        expectViewDates('2015-04-01');
-      });
-    });
-  });
+        initCalendar()
+        currentCalendar.gotoDate('2015-04-01')
+        expectViewDates('2015-04-01')
+      })
+    })
+  })
 
 
   describe('incrementDate', function() {
   describe('incrementDate', function() {
     describeWhenInMonth(function() {
     describeWhenInMonth(function() {
       it('should increment the date when given a Duration object', function() {
       it('should increment the date when given a Duration object', function() {
-        initCalendar();
-        currentCalendar.incrementDate({ months: -1 });
-        expectViewDates('2014-04-27', '2014-06-08', '2014-05-01', '2014-06-01');
-      });
-    });
+        initCalendar()
+        currentCalendar.incrementDate({ months: -1 })
+        expectViewDates('2014-04-27', '2014-06-08', '2014-05-01', '2014-06-01')
+      })
+    })
     describeWhenInWeek(function() {
     describeWhenInWeek(function() {
       it('should increment the date when given a Duration object', function() {
       it('should increment the date when given a Duration object', function() {
-        initCalendar();
-        currentCalendar.incrementDate({ weeks: -2 });
-        expectViewDates('2014-05-18', '2014-05-25');
-      });
-    });
+        initCalendar()
+        currentCalendar.incrementDate({ weeks: -2 })
+        expectViewDates('2014-05-18', '2014-05-25')
+      })
+    })
     describeWhenInDay(function() {
     describeWhenInDay(function() {
       it('should increment the date when given a Duration object', function() {
       it('should increment the date when given a Duration object', function() {
-        initCalendar();
-        currentCalendar.incrementDate({ days: 2 });
-        expectViewDates('2014-06-03');
-      });
+        initCalendar()
+        currentCalendar.incrementDate({ days: 2 })
+        expectViewDates('2014-06-03')
+      })
       it('should increment the date when given a Duration string', function() {
       it('should increment the date when given a Duration string', function() {
-        initCalendar();
-        currentCalendar.incrementDate('2.00:00:00');
-        expectViewDates('2014-06-03');
-      });
+        initCalendar()
+        currentCalendar.incrementDate('2.00:00:00')
+        expectViewDates('2014-06-03')
+      })
       it('should increment the date when given a Duration string with a time', function() {
       it('should increment the date when given a Duration string with a time', function() {
-        initCalendar();
-        currentCalendar.incrementDate('2.05:30:00');
-        expectViewDates('2014-06-03');
-      });
-    });
-  });
+        initCalendar()
+        currentCalendar.incrementDate('2.05:30:00')
+        expectViewDates('2014-06-03')
+      })
+    })
+  })
 
 
   describe('prevYear', function() {
   describe('prevYear', function() {
     describeWhenInMonth(function() {
     describeWhenInMonth(function() {
       it('should move the calendar back a year', function() {
       it('should move the calendar back a year', function() {
-        initCalendar();
-        currentCalendar.prevYear();
-        expectViewDates('2013-05-26', '2013-07-07', '2013-06-01', '2013-07-01');
-      });
-    });
+        initCalendar()
+        currentCalendar.prevYear()
+        expectViewDates('2013-05-26', '2013-07-07', '2013-06-01', '2013-07-01')
+      })
+    })
     describeWhenInWeek(function() {
     describeWhenInWeek(function() {
       it('should move the calendar back a year', function() {
       it('should move the calendar back a year', function() {
-        initCalendar();
-        currentCalendar.prevYear();
-        expectViewDates('2013-05-26', '2013-06-02');
-      });
-    });
+        initCalendar()
+        currentCalendar.prevYear()
+        expectViewDates('2013-05-26', '2013-06-02')
+      })
+    })
     describeWhenInDay(function() {
     describeWhenInDay(function() {
       it('should move the calendar back a year', function() {
       it('should move the calendar back a year', function() {
-        initCalendar();
-        currentCalendar.prevYear();
-        expectViewDates('2013-06-01');
-      });
-    });
-  });
+        initCalendar()
+        currentCalendar.prevYear()
+        expectViewDates('2013-06-01')
+      })
+    })
+  })
 
 
   describe('nextYear', function() {
   describe('nextYear', function() {
     describeWhenInMonth(function() {
     describeWhenInMonth(function() {
       it('should move the calendar forward a year', function() {
       it('should move the calendar forward a year', function() {
-        initCalendar();
-        currentCalendar.nextYear();
-        expectViewDates('2015-05-31', '2015-07-12', '2015-06-01', '2015-07-01');
-      });
-    });
+        initCalendar()
+        currentCalendar.nextYear()
+        expectViewDates('2015-05-31', '2015-07-12', '2015-06-01', '2015-07-01')
+      })
+    })
     describeWhenInWeek(function() {
     describeWhenInWeek(function() {
       it('should move the calendar forward a year', function() {
       it('should move the calendar forward a year', function() {
-        initCalendar();
-        currentCalendar.nextYear();
-        expectViewDates('2015-05-31', '2015-06-07');
-      });
-    });
+        initCalendar()
+        currentCalendar.nextYear()
+        expectViewDates('2015-05-31', '2015-06-07')
+      })
+    })
     describeWhenInDay(function() {
     describeWhenInDay(function() {
       it('should move the calendar forward a year', function() {
       it('should move the calendar forward a year', function() {
-        initCalendar();
-        currentCalendar.nextYear();
-        expectViewDates('2015-06-01');
-      });
-    });
-  });
+        initCalendar()
+        currentCalendar.nextYear()
+        expectViewDates('2015-06-01')
+      })
+    })
+  })
 
 
   describe('when current date is a hidden day', function() {
   describe('when current date is a hidden day', function() {
     describeWhenInMonth(function() {
     describeWhenInMonth(function() {
       it('should display the current month even if first day of month', function() {
       it('should display the current month even if first day of month', function() {
-        var options = {};
-        options.now = options.defaultDate = '2014-06-01'; // a Sunday
-        options.weekends = false;
-        initCalendar(options);
-        var view = currentCalendar.getView();
-        expect(view.start).toEqualMoment('2014-06-02');
-        expect(view.end).toEqualMoment('2014-07-12');
-        expect(view.intervalStart).toEqualMoment('2014-06-01');
-        expect(view.intervalEnd).toEqualMoment('2014-07-01');
-      });
+        var options = {}
+        options.now = options.defaultDate = '2014-06-01' // a Sunday
+        options.weekends = false
+        initCalendar(options)
+        var view = currentCalendar.getView()
+        expect(view.start).toEqualMoment('2014-06-02')
+        expect(view.end).toEqualMoment('2014-07-12')
+        expect(view.intervalStart).toEqualMoment('2014-06-01')
+        expect(view.intervalEnd).toEqualMoment('2014-07-01')
+      })
       it('should display the current month', function() {
       it('should display the current month', function() {
-        var options = {};
-        options.now = options.defaultDate = '2014-05-04'; // a Sunday
-        options.weekends = false;
-        initCalendar(options);
-        var view = currentCalendar.getView();
-        expect(view.start).toEqualMoment('2014-04-28');
-        expect(view.end).toEqualMoment('2014-06-07');
-        expect(view.intervalStart).toEqualMoment('2014-05-01');
-        expect(view.intervalEnd).toEqualMoment('2014-06-01');
-      });
+        var options = {}
+        options.now = options.defaultDate = '2014-05-04' // a Sunday
+        options.weekends = false
+        initCalendar(options)
+        var view = currentCalendar.getView()
+        expect(view.start).toEqualMoment('2014-04-28')
+        expect(view.end).toEqualMoment('2014-06-07')
+        expect(view.intervalStart).toEqualMoment('2014-05-01')
+        expect(view.intervalEnd).toEqualMoment('2014-06-01')
+      })
       describe('when navigating back a month', function() {
       describe('when navigating back a month', function() {
         it('should not skip months', function() {
         it('should not skip months', function() {
-          var options = {};
-          options.defaultDate = '2014-07-07';         
-          options.weekends = false;
-          initCalendar(options);
-          var view = currentCalendar.getView();
-          expect(view.intervalStart).toEqualMoment('2014-07-01');
-          expect(view.intervalEnd).toEqualMoment('2014-08-01');
-          currentCalendar.prev(); // will move to Jun 1, which is a Sunday
-          view = currentCalendar.getView();
-          expect(view.intervalStart).toEqualMoment('2014-06-01');
-          expect(view.intervalEnd).toEqualMoment('2014-07-01');
-        });
-      });
-    });
+          var options = {}
+          options.defaultDate = '2014-07-07'
+          options.weekends = false
+          initCalendar(options)
+          var view = currentCalendar.getView()
+          expect(view.intervalStart).toEqualMoment('2014-07-01')
+          expect(view.intervalEnd).toEqualMoment('2014-08-01')
+          currentCalendar.prev() // will move to Jun 1, which is a Sunday
+          view = currentCalendar.getView()
+          expect(view.intervalStart).toEqualMoment('2014-06-01')
+          expect(view.intervalEnd).toEqualMoment('2014-07-01')
+        })
+      })
+    })
     describeWhenInDay(function() {
     describeWhenInDay(function() {
       it('should display the next visible day', function() {
       it('should display the next visible day', function() {
-        var options = {};
-        options.now = options.defaultDate = '2014-06-01'; // a Sunday
-        options.weekends = false;
-        initCalendar(options);
-        view = currentCalendar.getView();
-        expect(view.start).toEqualMoment('2014-06-02');
-        expect(view.end).toEqualMoment('2014-06-03');
-        expect(view.intervalStart).toEqualMoment('2014-06-02');
-        expect(view.intervalEnd).toEqualMoment('2014-06-03');
-      });
-    });
-  });
+        var options = {}
+        options.now = options.defaultDate = '2014-06-01' // a Sunday
+        options.weekends = false
+        initCalendar(options)
+        view = currentCalendar.getView()
+        expect(view.start).toEqualMoment('2014-06-02')
+        expect(view.end).toEqualMoment('2014-06-03')
+        expect(view.intervalStart).toEqualMoment('2014-06-02')
+        expect(view.intervalEnd).toEqualMoment('2014-06-03')
+      })
+    })
+  })
 
 
 
 
   // UTILS
   // UTILS
   // -----
   // -----
 
 
   function describeWhenInMonth(func) {
   function describeWhenInMonth(func) {
-    describeWhenIn('month', func);
+    describeWhenIn('month', func)
   }
   }
 
 
   function describeWhenInWeek(func) {
   function describeWhenInWeek(func) {
-    describeWhenIn('basicWeek', func);
-    describeWhenIn('agendaWeek', func);
+    describeWhenIn('basicWeek', func)
+    describeWhenIn('agendaWeek', func)
   }
   }
 
 
   function describeWhenInDay(func) {
   function describeWhenInDay(func) {
-    describeWhenIn('basicDay', func);
-    describeWhenIn('agendaDay', func);
+    describeWhenIn('basicDay', func)
+    describeWhenIn('agendaDay', func)
   }
   }
 
 
   function describeWhenIn(viewName, func) {
   function describeWhenIn(viewName, func) {
-    describe('when in ' + viewName, function() {      
-      pushOptions({defaultView:viewName});
-      func();
-    });
+    describe('when in ' + viewName, function() {
+      pushOptions({defaultView: viewName})
+      func()
+    })
   }
   }
 
 
   function expectViewDates(start, end, titleStart, titleEnd) {
   function expectViewDates(start, end, titleStart, titleEnd) {
-    var view = currentCalendar.getView();
-    var calculatedEnd;
-    var title;
+    var view = currentCalendar.getView()
+    var calculatedEnd
+    var title
 
 
-    start = $.fullCalendar.moment(start);
-    calculatedEnd = end ? $.fullCalendar.moment(end) : start.clone().add(1, 'days');
-    expect(start).toEqualMoment(view.start);
-    expect(calculatedEnd).toEqualMoment(view.end);
+    start = $.fullCalendar.moment(start)
+    calculatedEnd = end ? $.fullCalendar.moment(end) : start.clone().add(1, 'days')
+    expect(start).toEqualMoment(view.start)
+    expect(calculatedEnd).toEqualMoment(view.end)
 
 
-    titleStart = titleStart ? $.fullCalendar.moment(titleStart) : start;
-    titleEnd = titleEnd ? $.fullCalendar.moment(titleEnd) : calculatedEnd;
+    titleStart = titleStart ? $.fullCalendar.moment(titleStart) : start
+    titleEnd = titleEnd ? $.fullCalendar.moment(titleEnd) : calculatedEnd
 
 
     if (titleEnd) {
     if (titleEnd) {
       title = $.fullCalendar.formatRange(
       title = $.fullCalendar.formatRange(
@@ -261,13 +261,12 @@ describe('current date', function() {
         titleEnd.clone().add(-1, 'ms'),
         titleEnd.clone().add(-1, 'ms'),
         TITLE_FORMAT,
         TITLE_FORMAT,
         ' - '
         ' - '
-      );
-    }
-    else {
-      title = titleStart.format(TITLE_FORMAT);
+      )
+    } else {
+      title = titleStart.format(TITLE_FORMAT)
     }
     }
 
 
-    expect($('.fc-toolbar h2')).toContainText(title);
+    expect($('.fc-toolbar h2')).toContainText(title)
   }
   }
 
 
-});
+})

+ 36 - 36
tests/legacy/custom-view-class.js

@@ -1,9 +1,9 @@
 describe('custom view class', function() {
 describe('custom view class', function() {
 
 
   it('calls all standard methods with correct parameters', function() {
   it('calls all standard methods with correct parameters', function() {
-    var FC = $.fullCalendar;
-    var View = FC.View;
-    var CustomView;
+    var FC = $.fullCalendar
+    var View = FC.View
+    var CustomView
 
 
     var methods = {
     var methods = {
       initialize: function() {
       initialize: function() {
@@ -11,36 +11,36 @@ describe('custom view class', function() {
       render: function() {
       render: function() {
       },
       },
       setHeight: function(height, isAuto) {
       setHeight: function(height, isAuto) {
-        expect(typeof height).toBe('number');
-        expect(typeof isAuto).toBe('boolean');
+        expect(typeof height).toBe('number')
+        expect(typeof isAuto).toBe('boolean')
       },
       },
       renderEvents: function(events) {
       renderEvents: function(events) {
-        expect($.type(events)).toBe('array');
-        expect(events.length).toBe(1);
-        expect(moment.isMoment(events[0].start)).toBe(true);
-        expect(moment.isMoment(events[0].end)).toBe(true);
+        expect($.type(events)).toBe('array')
+        expect(events.length).toBe(1)
+        expect(moment.isMoment(events[0].start)).toBe(true)
+        expect(moment.isMoment(events[0].end)).toBe(true)
       },
       },
       destroyEvents: function() {
       destroyEvents: function() {
       },
       },
       renderSelection: function(range) {
       renderSelection: function(range) {
-        expect($.type(range)).toBe('object');
-        expect(moment.isMoment(range.start)).toBe(true);
-        expect(moment.isMoment(range.end)).toBe(true);
+        expect($.type(range)).toBe('object')
+        expect(moment.isMoment(range.start)).toBe(true)
+        expect(moment.isMoment(range.end)).toBe(true)
       },
       },
       destroySelection: function() {
       destroySelection: function() {
       }
       }
-    };
+    }
 
 
-    spyOn(methods, 'initialize').and.callThrough();
-    spyOn(methods, 'render').and.callThrough();
-    spyOn(methods, 'setHeight').and.callThrough();
-    spyOn(methods, 'renderEvents').and.callThrough();
-    spyOn(methods, 'destroyEvents').and.callThrough();
-    spyOn(methods, 'renderSelection').and.callThrough();
-    spyOn(methods, 'destroySelection').and.callThrough();
+    spyOn(methods, 'initialize').and.callThrough()
+    spyOn(methods, 'render').and.callThrough()
+    spyOn(methods, 'setHeight').and.callThrough()
+    spyOn(methods, 'renderEvents').and.callThrough()
+    spyOn(methods, 'destroyEvents').and.callThrough()
+    spyOn(methods, 'renderSelection').and.callThrough()
+    spyOn(methods, 'destroySelection').and.callThrough()
 
 
-    CustomView = View.extend(methods);
-    FC.views.custom = CustomView;
+    CustomView = View.extend(methods)
+    FC.views.custom = CustomView
 
 
     initCalendar({
     initCalendar({
       defaultView: 'custom',
       defaultView: 'custom',
@@ -52,26 +52,26 @@ describe('custom view class', function() {
           end: '2014-12-25T11:00:00'
           end: '2014-12-25T11:00:00'
         }
         }
       ]
       ]
-    });
+    })
 
 
-    expect(methods.initialize).toHaveBeenCalled();
-    expect(methods.render).toHaveBeenCalled();
-    expect(methods.setHeight).toHaveBeenCalled();
-    expect(methods.renderEvents).toHaveBeenCalled();
+    expect(methods.initialize).toHaveBeenCalled()
+    expect(methods.render).toHaveBeenCalled()
+    expect(methods.setHeight).toHaveBeenCalled()
+    expect(methods.renderEvents).toHaveBeenCalled()
 
 
-    currentCalendar.rerenderEvents();
+    currentCalendar.rerenderEvents()
 
 
-    expect(methods.destroyEvents).toHaveBeenCalled();
+    expect(methods.destroyEvents).toHaveBeenCalled()
 
 
-    currentCalendar.select('2014-12-25', '2014-01-01');
+    currentCalendar.select('2014-12-25', '2014-01-01')
 
 
-    expect(methods.renderSelection).toHaveBeenCalled();
+    expect(methods.renderSelection).toHaveBeenCalled()
 
 
-    currentCalendar.unselect();
+    currentCalendar.unselect()
 
 
-    expect(methods.destroySelection).toHaveBeenCalled();
+    expect(methods.destroySelection).toHaveBeenCalled()
 
 
-    delete FC.views.custom;
-  });
+    delete FC.views.custom
+  })
 
 
-});
+})

+ 194 - 194
tests/legacy/custom-view-duration.js

@@ -1,399 +1,399 @@
-describe('custom view', function() {  
+describe('custom view', function() {
   it('renders a 4 day basic view', function() {
   it('renders a 4 day basic view', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.basicFourDay = {
     options.views.basicFourDay = {
       type: 'basic',
       type: 'basic',
       duration: { days: 4 }
       duration: { days: 4 }
-    };
-    options.defaultView = 'basicFourDay';
-    options.defaultDate = '2014-12-25';
-    initCalendar(options);
-    expect($('.fc-day-grid .fc-row').length).toBe(1);
-    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(4);
+    }
+    options.defaultView = 'basicFourDay'
+    options.defaultDate = '2014-12-25'
+    initCalendar(options)
+    expect($('.fc-day-grid .fc-row').length).toBe(1)
+    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(4)
     expect($('.fc-day-grid .fc-row .fc-day:first'))
     expect($('.fc-day-grid .fc-row .fc-day:first'))
-      .toBeMatchedBy('[data-date="2014-12-25"]'); // starts on defaultDate
-  });
+      .toBeMatchedBy('[data-date="2014-12-25"]') // starts on defaultDate
+  })
 
 
   it('renders a 2 week basic view', function() {
   it('renders a 2 week basic view', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.basicTwoWeek = {
     options.views.basicTwoWeek = {
       type: 'basic',
       type: 'basic',
       duration: { weeks: 2 }
       duration: { weeks: 2 }
-    };
-    options.defaultView = 'basicTwoWeek';
-    options.defaultDate = '2014-12-25';
-    options.firstDay = 2; // Tues
-    initCalendar(options);
-    expect($('.fc-day-grid .fc-row').length).toBe(2);
-    expect($('.fc-day-grid .fc-day').length).toBe(14);
-    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('.fc-tue'); // respects start-of-week
-    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-12-23"]'); // week start. tues
-  });
+    }
+    options.defaultView = 'basicTwoWeek'
+    options.defaultDate = '2014-12-25'
+    options.firstDay = 2 // Tues
+    initCalendar(options)
+    expect($('.fc-day-grid .fc-row').length).toBe(2)
+    expect($('.fc-day-grid .fc-day').length).toBe(14)
+    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('.fc-tue') // respects start-of-week
+    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-12-23"]') // week start. tues
+  })
 
 
   it('will use the provided options', function() {
   it('will use the provided options', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.basicFourDay = {
     options.views.basicFourDay = {
       type: 'basic',
       type: 'basic',
       duration: { days: 4 },
       duration: { days: 4 },
       titleFormat: '[special]'
       titleFormat: '[special]'
-    };
-    options.defaultView = 'basicFourDay';
-    initCalendar(options);
-    expect($('h2')).toHaveText('special');
-  });
+    }
+    options.defaultView = 'basicFourDay'
+    initCalendar(options)
+    expect($('h2')).toHaveText('special')
+  })
 
 
   it('will inherit options from the parent view type', function() {
   it('will inherit options from the parent view type', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.basic = {
     options.views.basic = {
       titleFormat: '[basictitle]'
       titleFormat: '[basictitle]'
-    };
+    }
     options.views.basicFourDay = {
     options.views.basicFourDay = {
       type: 'basic',
       type: 'basic',
       duration: { days: 4 }
       duration: { days: 4 }
-    };
-    options.defaultView = 'basicFourDay';
-    initCalendar(options);
-    expect($('h2')).toHaveText('basictitle');
-  });
+    }
+    options.defaultView = 'basicFourDay'
+    initCalendar(options)
+    expect($('h2')).toHaveText('basictitle')
+  })
 
 
   it('will override an option from the parent view type', function() {
   it('will override an option from the parent view type', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.basic = {
     options.views.basic = {
       titleFormat: '[basictitle]'
       titleFormat: '[basictitle]'
-    };
+    }
     options.views.basicFourDay = {
     options.views.basicFourDay = {
       type: 'basic',
       type: 'basic',
       duration: { days: 4 },
       duration: { days: 4 },
       titleFormat: '[basicfourweekttitle]'
       titleFormat: '[basicfourweekttitle]'
-    };
-    options.defaultView = 'basicFourDay';
-    initCalendar(options);
-    expect($('h2')).toHaveText('basicfourweekttitle');
-  });
+    }
+    options.defaultView = 'basicFourDay'
+    initCalendar(options)
+    expect($('h2')).toHaveText('basicfourweekttitle')
+  })
 
 
   it('will inherit options from generic "week" type', function() {
   it('will inherit options from generic "week" type', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.week = {
     options.views.week = {
       titleFormat: '[weektitle]'
       titleFormat: '[weektitle]'
-    };
+    }
     options.views.basicOneWeek = {
     options.views.basicOneWeek = {
       type: 'basic',
       type: 'basic',
       duration: { weeks: 1 }
       duration: { weeks: 1 }
-    };
-    options.defaultView = 'basicOneWeek';
-    initCalendar(options);
-    expect($('h2')).toHaveText('weektitle');
-  });
+    }
+    options.defaultView = 'basicOneWeek'
+    initCalendar(options)
+    expect($('h2')).toHaveText('weektitle')
+  })
 
 
   it('generic type options for "basic" will override generic "week" options', function() {
   it('generic type options for "basic" will override generic "week" options', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.week = {
     options.views.week = {
       titleFormat: '[weektitle]'
       titleFormat: '[weektitle]'
-    };
+    }
     options.views.basic = {
     options.views.basic = {
       titleFormat: '[basictitle]'
       titleFormat: '[basictitle]'
-    };
+    }
     options.views.basicOneWeek = {
     options.views.basicOneWeek = {
       type: 'basic',
       type: 'basic',
       duration: { weeks: 1 }
       duration: { weeks: 1 }
-    };
-    options.defaultView = 'basicOneWeek';
-    initCalendar(options);
-    expect($('h2')).toHaveText('basictitle');
-  });
+    }
+    options.defaultView = 'basicOneWeek'
+    initCalendar(options)
+    expect($('h2')).toHaveText('basictitle')
+  })
 
 
   it('will not inherit "week" options if more than a single week', function() {
   it('will not inherit "week" options if more than a single week', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
-    options.titleFormat = '[defaultitle]';
+    }
+    options.titleFormat = '[defaultitle]'
     options.views.week = {
     options.views.week = {
       titleFormat: '[weektitle]'
       titleFormat: '[weektitle]'
-    };
+    }
     options.views.basicTwoWeek = {
     options.views.basicTwoWeek = {
       type: 'basic',
       type: 'basic',
       duration: { weeks: 2 }
       duration: { weeks: 2 }
-    };
-    options.defaultView = 'basicTwoWeek';
-    initCalendar(options);
-    expect($('h2')).toHaveText('defaultitle');
-  });
+    }
+    options.defaultView = 'basicTwoWeek'
+    initCalendar(options)
+    expect($('h2')).toHaveText('defaultitle')
+  })
 
 
   it('renders a 4 day agenda view', function() {
   it('renders a 4 day agenda view', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.agendaFourDay = {
     options.views.agendaFourDay = {
       type: 'agenda',
       type: 'agenda',
       duration: { days: 4 }
       duration: { days: 4 }
-    };
-    options.defaultView = 'agendaFourDay';
-    options.defaultDate = '2014-12-25';
-    initCalendar(options);
-    expect($('.fc-day-grid .fc-row').length).toBe(1);
-    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(4);
-    expect($('.fc-time-grid .fc-day').length).toBe(4);
-    expect($('.fc-time-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-12-25"]'); // starts on defaultDate
-  });
+    }
+    options.defaultView = 'agendaFourDay'
+    options.defaultDate = '2014-12-25'
+    initCalendar(options)
+    expect($('.fc-day-grid .fc-row').length).toBe(1)
+    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(4)
+    expect($('.fc-time-grid .fc-day').length).toBe(4)
+    expect($('.fc-time-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-12-25"]') // starts on defaultDate
+  })
 
 
   it('renders a two week agenda view', function() {
   it('renders a two week agenda view', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.agendaTwoWeek = {
     options.views.agendaTwoWeek = {
       type: 'agenda',
       type: 'agenda',
       duration: { weeks: 2 }
       duration: { weeks: 2 }
-    };
-    options.defaultView = 'agendaTwoWeek';
-    options.defaultDate = '2014-12-25';
-    initCalendar(options);
-    expect($('.fc-day-grid .fc-row').length).toBe(1);
-    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(14); // one long row
-    expect($('.fc-time-grid .fc-day').length).toBe(14);
-    expect($('.fc-time-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-12-21"]'); // week start
-  });
+    }
+    options.defaultView = 'agendaTwoWeek'
+    options.defaultDate = '2014-12-25'
+    initCalendar(options)
+    expect($('.fc-day-grid .fc-row').length).toBe(1)
+    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(14) // one long row
+    expect($('.fc-time-grid .fc-day').length).toBe(14)
+    expect($('.fc-time-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-12-21"]') // week start
+  })
 
 
   it('renders a two month agenda view', function() {
   it('renders a two month agenda view', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.agendaTwoMonth = {
     options.views.agendaTwoMonth = {
       type: 'agenda',
       type: 'agenda',
       duration: { months: 2 }
       duration: { months: 2 }
-    };
-    options.defaultView = 'agendaTwoMonth';
-    options.defaultDate = '2014-11-27';
-    initCalendar(options);
-    expect($('.fc-day-grid .fc-row').length).toBe(1);
-    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(61); // one long row
-    expect($('.fc-time-grid .fc-day').length).toBe(61);
-    expect($('.fc-time-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-11-01"]');
-    expect($('.fc-time-grid .fc-day:last')).toBeMatchedBy('[data-date="2014-12-31"]');
-  });
+    }
+    options.defaultView = 'agendaTwoMonth'
+    options.defaultDate = '2014-11-27'
+    initCalendar(options)
+    expect($('.fc-day-grid .fc-row').length).toBe(1)
+    expect($('.fc-day-grid .fc-row .fc-day').length).toBe(61) // one long row
+    expect($('.fc-time-grid .fc-day').length).toBe(61)
+    expect($('.fc-time-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-11-01"]')
+    expect($('.fc-time-grid .fc-day:last')).toBeMatchedBy('[data-date="2014-12-31"]')
+  })
 
 
   it('renders a two month basic view', function() {
   it('renders a two month basic view', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.basicTwoWeek = {
     options.views.basicTwoWeek = {
       type: 'basic',
       type: 'basic',
       duration: { months: 2 }
       duration: { months: 2 }
-    };
-    options.defaultView = 'basicTwoWeek';
-    options.defaultDate = '2014-11-27';
-    initCalendar(options);
-    expect($('.fc-day-grid .fc-row').length).toBe(10);
-    expect($('.fc-day-grid .fc-row:first .fc-day').length).toBe(7);
-    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-10-26"]');
-    expect($('.fc-day-grid .fc-day:last')).toBeMatchedBy('[data-date="2015-01-03"]');
-  });
+    }
+    options.defaultView = 'basicTwoWeek'
+    options.defaultDate = '2014-11-27'
+    initCalendar(options)
+    expect($('.fc-day-grid .fc-row').length).toBe(10)
+    expect($('.fc-day-grid .fc-row:first .fc-day').length).toBe(7)
+    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('[data-date="2014-10-26"]')
+    expect($('.fc-day-grid .fc-day:last')).toBeMatchedBy('[data-date="2015-01-03"]')
+  })
 
 
   it('renders a one year basic view', function() {
   it('renders a one year basic view', function() {
     var options = {
     var options = {
       views: {}
       views: {}
-    };
+    }
     options.views.basicYear = {
     options.views.basicYear = {
       type: 'basic',
       type: 'basic',
       duration: { years: 1 }
       duration: { years: 1 }
-    };
-    options.defaultView = 'basicYear';
-    options.defaultDate = '2014-11-27';
-    initCalendar(options);
-    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('[data-date="2013-12-29"]');
-    expect($('.fc-day-grid .fc-day:last')).toBeMatchedBy('[data-date="2015-01-03"]');
-  });
+    }
+    options.defaultView = 'basicYear'
+    options.defaultDate = '2014-11-27'
+    initCalendar(options)
+    expect($('.fc-day-grid .fc-day:first')).toBeMatchedBy('[data-date="2013-12-29"]')
+    expect($('.fc-day-grid .fc-day:last')).toBeMatchedBy('[data-date="2015-01-03"]')
+  })
 
 
   describe('buttonText', function() {
   describe('buttonText', function() {
 
 
     it('accepts buttonText exact-match override', function() {
     it('accepts buttonText exact-match override', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
+      }
       options.buttonText = {
       options.buttonText = {
         custom: 'over-ridden'
         custom: 'over-ridden'
-      };
+      }
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 4 },
         duration: { days: 4 },
         buttonText: 'awesome'
         buttonText: 'awesome'
-      };
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('over-ridden');
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('over-ridden')
+    })
 
 
     it('accepts buttonText single-unit-match override', function() {
     it('accepts buttonText single-unit-match override', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
+      }
       options.buttonText = {
       options.buttonText = {
         day: '1day-over-ridden'
         day: '1day-over-ridden'
-      };
+      }
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 1 },
         duration: { days: 1 },
         buttonText: 'awesome'
         buttonText: 'awesome'
-      };
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('1day-over-ridden');
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('1day-over-ridden')
+    })
 
 
     it('does not accept buttonText unit-match override when unit is more than one', function() {
     it('does not accept buttonText unit-match override when unit is more than one', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
+      }
       options.buttonText = {
       options.buttonText = {
         day: '1day!!!???'
         day: '1day!!!???'
-      };
+      }
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 2 },
         duration: { days: 2 },
         buttonText: 'awesome'
         buttonText: 'awesome'
-      };
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('awesome');
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('awesome')
+    })
 
 
     it('accepts locale\'s single-unit-match override', function() {
     it('accepts locale\'s single-unit-match override', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
-      options.locale = 'fr';
+      }
+      options.locale = 'fr'
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 1 }
         duration: { days: 1 }
-      };
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('Jour');
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('Jour')
+    })
 
 
     it('accepts explicit View-Specific buttonText, overriding locale\'s single-unit-match override', function() {
     it('accepts explicit View-Specific buttonText, overriding locale\'s single-unit-match override', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
-      options.locale = 'fr';
+      }
+      options.locale = 'fr'
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 1 },
         duration: { days: 1 },
         buttonText: 'awesome'
         buttonText: 'awesome'
-      };
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('awesome');
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('awesome')
+    })
 
 
     it('respects custom view\'s value', function() {
     it('respects custom view\'s value', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
+      }
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 4 },
         duration: { days: 4 },
         buttonText: 'awesome'
         buttonText: 'awesome'
-      };
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('awesome');
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('awesome')
+    })
 
 
     it('respects custom view\'s value, even when a "smart" property name', function() {
     it('respects custom view\'s value, even when a "smart" property name', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
+      }
       options.views.basicFourDay = { // "basicFourDay" is a pitfall for smartProperty
       options.views.basicFourDay = { // "basicFourDay" is a pitfall for smartProperty
         type: 'basic',
         type: 'basic',
         duration: { days: 4 },
         duration: { days: 4 },
-        buttonText: 'awesome'       
-      };
+        buttonText: 'awesome'
+      }
       options.header = {
       options.header = {
         center: 'basicFourDay,month'
         center: 'basicFourDay,month'
-      };
-      options.defaultView = 'basicFourDay';
-      initCalendar(options);
-      expect($('.fc-basicFourDay-button')).toHaveText('awesome');
-    });
+      }
+      options.defaultView = 'basicFourDay'
+      initCalendar(options)
+      expect($('.fc-basicFourDay-button')).toHaveText('awesome')
+    })
 
 
     it('falls back to humanized duration when not given', function() {
     it('falls back to humanized duration when not given', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
+      }
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 4 }
         duration: { days: 4 }
-      }     
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('4 days');
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('4 days')
+    })
 
 
     it('falls back to humanized duration and respects locale', function() {
     it('falls back to humanized duration and respects locale', function() {
       var options = {
       var options = {
         views: {}
         views: {}
-      };
-      options.locale = 'fr';
+      }
+      options.locale = 'fr'
       options.views.custom = {
       options.views.custom = {
         type: 'basic',
         type: 'basic',
         duration: { days: 4 }
         duration: { days: 4 }
-      };
+      }
       options.header = {
       options.header = {
         center: 'custom,month'
         center: 'custom,month'
-      };
-      options.defaultView = 'custom';
-      initCalendar(options);
-      expect($('.fc-custom-button')).toHaveText('4 jours');
-      expect($('.fc-month-button')).toHaveText('Mois'); // test for the heck of it
-    });
+      }
+      options.defaultView = 'custom'
+      initCalendar(options)
+      expect($('.fc-custom-button')).toHaveText('4 jours')
+      expect($('.fc-month-button')).toHaveText('Mois') // test for the heck of it
+    })
 
 
     it('falls back to view name when view lacks metadata', function() {
     it('falls back to view name when view lacks metadata', function() {
-      $.fullCalendar.views.crazy = $.fullCalendar.View.extend();
+      $.fullCalendar.views.crazy = $.fullCalendar.View.extend()
       var options = {
       var options = {
         views: {}
         views: {}
-      };
+      }
       options.header = {
       options.header = {
         center: 'crazy,month'
         center: 'crazy,month'
-      };
-      options.defaultView = 'crazy';
-      initCalendar(options);
-      expect($('.fc-crazy-button')).toHaveText('crazy');
-      delete $.fullCalendar.views.crazy;
-    });
-  });
-});
+      }
+      options.defaultView = 'crazy'
+      initCalendar(options)
+      expect($('.fc-crazy-button')).toHaveText('crazy')
+      delete $.fullCalendar.views.crazy
+    })
+  })
+})

+ 120 - 120
tests/legacy/dayClick.js

@@ -1,165 +1,165 @@
-describe('dayClick', function() { 
+describe('dayClick', function() {
   pushOptions({
   pushOptions({
     defaultDate: '2014-05-27',
     defaultDate: '2014-05-27',
     selectable: false
     selectable: false
-  }); 
+  });
   [ false, true ].forEach(function(isRTL) {
   [ false, true ].forEach(function(isRTL) {
     describe('when isRTL is ' + isRTL, function() {
     describe('when isRTL is ' + isRTL, function() {
-      
-      pushOptions({isRTL:isRTL});
-      
+
+      pushOptions({isRTL: isRTL});
+
       [ false, true ].forEach(function(selectable) {
       [ false, true ].forEach(function(selectable) {
-        describe('when selectable is ' + selectable, function() {         
-          pushOptions({selectable:selectable})          
-          describe('when in month view', function() {           
-            pushOptions({defaultView:'month'});
+        describe('when selectable is ' + selectable, function() {
+          pushOptions({selectable: selectable})
+          describe('when in month view', function() {
+            pushOptions({defaultView: 'month'})
             it('fires correctly when clicking on a cell', function(done) {
             it('fires correctly when clicking on a cell', function(done) {
-              var options = {};
+              var options = {}
               options.dayClick = function(date, jsEvent, view) {
               options.dayClick = function(date, jsEvent, view) {
-                expect(moment.isMoment(date)).toEqual(true);
-                expect(typeof jsEvent).toEqual('object'); // TODO: more descrimination
-                expect(typeof view).toEqual('object'); // "
-                expect(date.hasTime()).toEqual(false);
-                expect(date).toEqualMoment('2014-05-07');
-              };
-              spyOn(options, 'dayClick').and.callThrough();
+                expect(moment.isMoment(date)).toEqual(true)
+                expect(typeof jsEvent).toEqual('object') // TODO: more descrimination
+                expect(typeof view).toEqual('object') // "
+                expect(date.hasTime()).toEqual(false)
+                expect(date).toEqualMoment('2014-05-07')
+              }
+              spyOn(options, 'dayClick').and.callThrough()
               initCalendar(options)
               initCalendar(options)
 
 
-              var dayCell = $('.fc-day:eq(10)'); // 2014-05-07 (regardless of isRTL)
+              var dayCell = $('.fc-day:eq(10)') // 2014-05-07 (regardless of isRTL)
 
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               dayCell.simulate('drag', {
               dayCell.simulate('drag', {
                 callback: function() {
                 callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled();
-                  done();
+                  expect(options.dayClick).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            });
-          });
+              })
+            })
+          })
 
 
-          describe('when in agendaWeek view', function() {            
-            pushOptions({defaultView:'agendaWeek'});
+          describe('when in agendaWeek view', function() {
+            pushOptions({defaultView: 'agendaWeek'})
             it('fires correctly when clicking on an all-day slot', function(done) {
             it('fires correctly when clicking on an all-day slot', function(done) {
-              var options = {};
+              var options = {}
               options.dayClick = function(date, jsEvent, view) {
               options.dayClick = function(date, jsEvent, view) {
-                expect(moment.isMoment(date)).toEqual(true);
-                expect(typeof jsEvent).toEqual('object'); // TODO: more descrimination
-                expect(typeof view).toEqual('object'); // "
-                expect(date.hasTime()).toEqual(false);
-                expect(date).toEqualMoment('2014-05-28');
-              };
-              spyOn(options, 'dayClick').and.callThrough();
-              initCalendar(options);
+                expect(moment.isMoment(date)).toEqual(true)
+                expect(typeof jsEvent).toEqual('object') // TODO: more descrimination
+                expect(typeof view).toEqual('object') // "
+                expect(date.hasTime()).toEqual(false)
+                expect(date).toEqualMoment('2014-05-28')
+              }
+              spyOn(options, 'dayClick').and.callThrough()
+              initCalendar(options)
 
 
               // 2014-05-28 (regardless of isRTL)
               // 2014-05-28 (regardless of isRTL)
-              var dayContent = $('.fc-agenda-view .fc-day-grid .fc-day:eq(3)');
+              var dayContent = $('.fc-agenda-view .fc-day-grid .fc-day:eq(3)')
 
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               dayContent.simulate('drag', {
               dayContent.simulate('drag', {
                 callback: function() {
                 callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled();
-                  done();
+                  expect(options.dayClick).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            });
+              })
+            })
             it('fires correctly when clicking on a timed slot', function(done) {
             it('fires correctly when clicking on a timed slot', function(done) {
-              var options = {};
+              var options = {}
               // make sure the click slot will be in scroll view
               // make sure the click slot will be in scroll view
-              options.contentHeight = 500;
-              options.scrollTime = '07:00:00';
+              options.contentHeight = 500
+              options.scrollTime = '07:00:00'
 
 
               options.dayClick = function(date, jsEvent, view) {
               options.dayClick = function(date, jsEvent, view) {
-                expect(moment.isMoment(date)).toEqual(true);
-                expect(typeof jsEvent).toEqual('object'); // TODO: more descrimination
-                expect(typeof view).toEqual('object'); // "
-                expect(date.hasTime()).toEqual(true);
-                expect(date).toEqualMoment('2014-05-28T09:00:00');
-              };
-              spyOn(options, 'dayClick').and.callThrough();
-              initCalendar(options);
+                expect(moment.isMoment(date)).toEqual(true)
+                expect(typeof jsEvent).toEqual('object') // TODO: more descrimination
+                expect(typeof view).toEqual('object') // "
+                expect(date.hasTime()).toEqual(true)
+                expect(date).toEqualMoment('2014-05-28T09:00:00')
+              }
+              spyOn(options, 'dayClick').and.callThrough()
+              initCalendar(options)
 
 
               // the middle is 2014-05-28T09:00:00 (regardless of isRTL)
               // the middle is 2014-05-28T09:00:00 (regardless of isRTL)
-              var slotRow = $('.fc-slats tr:eq(18) td:not(.fc-time)');
+              var slotRow = $('.fc-slats tr:eq(18) td:not(.fc-time)')
 
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               slotRow.simulate('drag', {
               slotRow.simulate('drag', {
                 callback: function() {
                 callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled();
-                  done();
+                  expect(options.dayClick).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            });
+              })
+            })
 
 
             // issue 2217
             // issue 2217
             it('fires correctly when clicking on a timed slot, with minTime set', function(done) {
             it('fires correctly when clicking on a timed slot, with minTime set', function(done) {
-              var options = {};
+              var options = {}
               // make sure the click slot will be in scroll view
               // make sure the click slot will be in scroll view
-              options.contentHeight = 500;
-              options.scrollTime = '07:00:00';
-              options.minTime = '02:00:00';
+              options.contentHeight = 500
+              options.scrollTime = '07:00:00'
+              options.minTime = '02:00:00'
 
 
               options.dayClick = function(date, jsEvent, view) {
               options.dayClick = function(date, jsEvent, view) {
-                expect(moment.isMoment(date)).toEqual(true);
-                expect(typeof jsEvent).toEqual('object'); // TODO: more descrimination
-                expect(typeof view).toEqual('object'); // "
-                expect(date.hasTime()).toEqual(true);
-                expect(date).toEqualMoment('2014-05-28T11:00:00');
-              };
-              spyOn(options, 'dayClick').and.callThrough();
-              initCalendar(options);
+                expect(moment.isMoment(date)).toEqual(true)
+                expect(typeof jsEvent).toEqual('object') // TODO: more descrimination
+                expect(typeof view).toEqual('object') // "
+                expect(date.hasTime()).toEqual(true)
+                expect(date).toEqualMoment('2014-05-28T11:00:00')
+              }
+              spyOn(options, 'dayClick').and.callThrough()
+              initCalendar(options)
 
 
               // the middle is 2014-05-28T11:00:00 (regardless of isRTL)
               // the middle is 2014-05-28T11:00:00 (regardless of isRTL)
-              var slotRow = $('.fc-slats tr:eq(18) td:not(.fc-time)');
+              var slotRow = $('.fc-slats tr:eq(18) td:not(.fc-time)')
 
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               // for simulating the mousedown/mouseup/click (relevant for selectable)
               slotRow.simulate('drag', {
               slotRow.simulate('drag', {
                 callback: function() {
                 callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled();
-                  done();
+                  expect(options.dayClick).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            });
-          });
-        });
-      });
-    });
-  });
+              })
+            })
+          })
+        })
+      })
+    })
+  })
 
 
   describe('when touch', function() {
   describe('when touch', function() {
 
 
     it('fires correctly when simulated short drag on a cell', function(done) {
     it('fires correctly when simulated short drag on a cell', function(done) {
-      var options = {};
+      var options = {}
       options.dayClick = function(date, jsEvent, view) {
       options.dayClick = function(date, jsEvent, view) {
-        expect(moment.isMoment(date)).toEqual(true);
-        expect(typeof jsEvent).toEqual('object'); // TODO: more descrimination
-        expect(typeof view).toEqual('object'); // "
-        expect(date.hasTime()).toEqual(false);
-        expect(date).toEqualMoment('2014-05-07');
-      };
-      spyOn(options, 'dayClick').and.callThrough();
-      initCalendar(options);
+        expect(moment.isMoment(date)).toEqual(true)
+        expect(typeof jsEvent).toEqual('object') // TODO: more descrimination
+        expect(typeof view).toEqual('object') // "
+        expect(date.hasTime()).toEqual(false)
+        expect(date).toEqualMoment('2014-05-07')
+      }
+      spyOn(options, 'dayClick').and.callThrough()
+      initCalendar(options)
 
 
-      var dayCell = $('.fc-day:eq(10)'); // 2014-05-07 (regardless of isRTL)
+      var dayCell = $('.fc-day:eq(10)') // 2014-05-07 (regardless of isRTL)
 
 
       // for simulating the mousedown/mouseup/click (relevant for selectable)
       // for simulating the mousedown/mouseup/click (relevant for selectable)
       dayCell.simulate('drag', {
       dayCell.simulate('drag', {
         isTouch: true,
         isTouch: true,
         callback: function() {
         callback: function() {
-          expect(options.dayClick).toHaveBeenCalled();
-          done();
+          expect(options.dayClick).toHaveBeenCalled()
+          done()
         }
         }
-      });
-    });
+      })
+    })
 
 
     it('won\'t fire if touch moves outside of date cell', function(done) {
     it('won\'t fire if touch moves outside of date cell', function(done) {
-      var options = {};
-      options.dayClick = function(date, jsEvent, view) {};
-      spyOn(options, 'dayClick').and.callThrough();
+      var options = {}
+      options.dayClick = function(date, jsEvent, view) {}
+      spyOn(options, 'dayClick').and.callThrough()
 
 
-      initCalendar(options);
+      initCalendar(options)
 
 
-      var startCell = $('.fc-day[data-date="2014-05-07"]');
-      var endCell = $('.fc-day[data-date="2014-05-08"]');
+      var startCell = $('.fc-day[data-date="2014-05-07"]')
+      var endCell = $('.fc-day[data-date="2014-05-08"]')
 
 
       startCell.simulate('drag', {
       startCell.simulate('drag', {
         // FYI, when debug:true, not a good representation because the minimal  delay is required
         // FYI, when debug:true, not a good representation because the minimal  delay is required
@@ -167,30 +167,30 @@ describe('dayClick', function() {
         isTouch: true,
         isTouch: true,
         end: endCell,
         end: endCell,
         callback: function() {
         callback: function() {
-          expect(options.dayClick).not.toHaveBeenCalled();
-          done();
+          expect(options.dayClick).not.toHaveBeenCalled()
+          done()
         }
         }
-      });
-    });
+      })
+    })
 
 
     it('fires correctly when simulated click on a cell', function(done) {
     it('fires correctly when simulated click on a cell', function(done) {
-      var options = {}; 
+      var options = {}
       options.dayClick = function(date, jsEvent, view) {
       options.dayClick = function(date, jsEvent, view) {
-        expect(moment.isMoment(date)).toEqual(true);
-        expect(typeof jsEvent).toEqual('object'); // TODO: more descrimination
-        expect(typeof view).toEqual('object'); // "
-        expect(date.hasTime()).toEqual(false);
-        expect(date).toEqualMoment('2014-05-07');
-      };
-      spyOn(options, 'dayClick').and.callThrough();
-      initCalendar(options);
-
-      var dayCell = $('.fc-day:eq(10)'); // 2014-05-07 (regardless of isRTL)
-
-      $.simulateTouchClick(dayCell);
-
-      expect(options.dayClick).toHaveBeenCalled();
-      done();
-    });
-  });
-});
+        expect(moment.isMoment(date)).toEqual(true)
+        expect(typeof jsEvent).toEqual('object') // TODO: more descrimination
+        expect(typeof view).toEqual('object') // "
+        expect(date.hasTime()).toEqual(false)
+        expect(date).toEqualMoment('2014-05-07')
+      }
+      spyOn(options, 'dayClick').and.callThrough()
+      initCalendar(options)
+
+      var dayCell = $('.fc-day:eq(10)') // 2014-05-07 (regardless of isRTL)
+
+      $.simulateTouchClick(dayCell)
+
+      expect(options.dayClick).toHaveBeenCalled()
+      done()
+    })
+  })
+})

+ 42 - 42
tests/legacy/dayNames.js

@@ -1,9 +1,9 @@
 describe('day names', function() {
 describe('day names', function() {
-  var settings = {};
+  var settings = {}
   var testableClasses = [
   var testableClasses = [
     'basicDay',
     'basicDay',
     'agendaDay'
     'agendaDay'
-  ];
+  ]
   var dayClasses = [
   var dayClasses = [
     '.fc-sun',
     '.fc-sun',
     '.fc-mon',
     '.fc-mon',
@@ -12,60 +12,60 @@ describe('day names', function() {
     '.fc-thu',
     '.fc-thu',
     '.fc-fri',
     '.fc-fri',
     '.fc-sat'
     '.fc-sat'
-  ];
-  var referenceDate = '2014-05-25 06:00'; // A sunday
-  var locales = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ];
+  ]
+  var referenceDate = '2014-05-25 06:00' // A sunday
+  var locales = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ]
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     settings = {
     settings = {
       now: moment(referenceDate).toISOString()
       now: moment(referenceDate).toISOString()
-    };
-  });
+    }
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    moment.locale('en'); // reset moment's global locale
-  });
+    moment.locale('en') // reset moment's global locale
+  })
 
 
   testableClasses.forEach(function(viewClass, index, viewClasses) {
   testableClasses.forEach(function(viewClass, index, viewClasses) {
     describe('when view is basicDay', function() {
     describe('when view is basicDay', function() {
       beforeEach(function() {
       beforeEach(function() {
-        settings.defaultView = 'basicDay';
-      });
+        settings.defaultView = 'basicDay'
+      })
 
 
       describe('when locale is default', function() {
       describe('when locale is default', function() {
         beforeEach(function() {
         beforeEach(function() {
-          settings.locale = 'en';
-        });
+          settings.locale = 'en'
+        })
 
 
         dayClasses.forEach(function(cls, index, classes) {
         dayClasses.forEach(function(cls, index, classes) {
-          var weekdays = moment.weekdays();
+          var weekdays = moment.weekdays()
           it('should be ' + weekdays[index], function() {
           it('should be ' + weekdays[index], function() {
-            settings.now = moment(referenceDate).add(index, 'days');
-            $('#cal').fullCalendar(settings);
+            settings.now = moment(referenceDate).add(index, 'days')
+            $('#cal').fullCalendar(settings)
 
 
-            expect($('.fc-view thead ' + dayClasses[index])).toHaveText(weekdays[index]);
-          });
-        });
-      });
+            expect($('.fc-view thead ' + dayClasses[index])).toHaveText(weekdays[index])
+          })
+        })
+      })
 
 
       $.each(locales, function(index, locale) {
       $.each(locales, function(index, locale) {
         describe('when locale is ' + locale, function() {
         describe('when locale is ' + locale, function() {
           beforeEach(function() {
           beforeEach(function() {
-            moment.locale(locale);
-          });
+            moment.locale(locale)
+          })
 
 
           dayClasses.forEach(function(cls, index, classes) {
           dayClasses.forEach(function(cls, index, classes) {
             it('should be the translation for ' + moment.weekdays()[index], function() {
             it('should be the translation for ' + moment.weekdays()[index], function() {
-              settings.locale = locale;
-              settings.now = moment(referenceDate).add(index, 'days');
-              $('#cal').fullCalendar(settings);
+              settings.locale = locale
+              settings.now = moment(referenceDate).add(index, 'days')
+              $('#cal').fullCalendar(settings)
 
 
-              expect($('.fc-view thead ' + dayClasses[index])).toHaveText(moment.weekdays()[index]);
-            });
-          });
-        });
-      });
+              expect($('.fc-view thead ' + dayClasses[index])).toHaveText(moment.weekdays()[index])
+            })
+          })
+        })
+      })
 
 
       describe('when daynames are specified', function() {
       describe('when daynames are specified', function() {
         var weekdays = [
         var weekdays = [
@@ -76,19 +76,19 @@ describe('day names', function() {
           'jevjaj',
           'jevjaj',
           'parmaqjaj',
           'parmaqjaj',
           'HoSjaj'
           'HoSjaj'
-        ];
+        ]
 
 
         dayClasses.forEach(function(cls, idx, classes) {
         dayClasses.forEach(function(cls, idx, classes) {
           it('should be ' + weekdays[idx], function() {
           it('should be ' + weekdays[idx], function() {
-            settings.dayNames = [].slice.call(weekdays); // copy. in case there is a mutation
-            settings.now = moment(referenceDate).add(idx, 'days');
+            settings.dayNames = [].slice.call(weekdays) // copy. in case there is a mutation
+            settings.now = moment(referenceDate).add(idx, 'days')
 
 
-            $('#cal').fullCalendar(settings);
+            $('#cal').fullCalendar(settings)
 
 
-            expect($('.fc-view thead ' + cls)).toHaveText(weekdays[idx]);
-          });
-        });
-      });
-    });
-  });
-});
+            expect($('.fc-view thead ' + cls)).toHaveText(weekdays[idx])
+          })
+        })
+      })
+    })
+  })
+})

+ 38 - 38
tests/legacy/dayNamesShort.js

@@ -1,10 +1,10 @@
 describe('short day names', function() {
 describe('short day names', function() {
-  var settings = {};
+  var settings = {}
   var testableClasses = [
   var testableClasses = [
     'month',
     'month',
     'agendaWeek',
     'agendaWeek',
     'basicWeek'
     'basicWeek'
-  ];
+  ]
   var dayClasses = [
   var dayClasses = [
     '.fc-sun',
     '.fc-sun',
     '.fc-mon',
     '.fc-mon',
@@ -13,66 +13,66 @@ describe('short day names', function() {
     '.fc-thu',
     '.fc-thu',
     '.fc-fri',
     '.fc-fri',
     '.fc-sat'
     '.fc-sat'
-  ];
-  var locales = [ 'es', 'fr', 'de', 'zh-cn', 'es' ];
+  ]
+  var locales = [ 'es', 'fr', 'de', 'zh-cn', 'es' ]
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-    settings = { };
-  });
+    affix('#cal')
+    settings = { }
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    moment.locale('en'); // reset moment's global locale
-  });
+    moment.locale('en') // reset moment's global locale
+  })
 
 
   testableClasses.forEach(function(viewClass, index, viewClasses) {
   testableClasses.forEach(function(viewClass, index, viewClasses) {
     describe('when view is ' + viewClass, function() {
     describe('when view is ' + viewClass, function() {
       beforeEach(function() {
       beforeEach(function() {
-        settings.defaultView = viewClass;
-      });
+        settings.defaultView = viewClass
+      })
 
 
       describe('when locale is default', function() {
       describe('when locale is default', function() {
         it('should be in English', function() {
         it('should be in English', function() {
-          moment.locale('en');
-          $('#cal').fullCalendar(settings);
-          var weekdays = moment.weekdaysShort();
+          moment.locale('en')
+          $('#cal').fullCalendar(settings)
+          var weekdays = moment.weekdaysShort()
 
 
           dayClasses.forEach(function(cls, index, classes) {
           dayClasses.forEach(function(cls, index, classes) {
-            expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index]);
-          });
-        });
-      });
+            expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index])
+          })
+        })
+      })
 
 
       describe('when locale is not default', function() {
       describe('when locale is not default', function() {
         locales.forEach(function(locale, index, locales) {
         locales.forEach(function(locale, index, locales) {
           it('should be in the selected locale', function() {
           it('should be in the selected locale', function() {
-            settings.locale = locale;
-            $('#cal').fullCalendar(settings);
+            settings.locale = locale
+            $('#cal').fullCalendar(settings)
 
 
-            moment.locale(locale);
-            var dow = moment.localeData(locale)._week.dow;
-            var weekdays = moment.weekdaysShort();
+            moment.locale(locale)
+            var dow = moment.localeData(locale)._week.dow
+            var weekdays = moment.weekdaysShort()
 
 
             dayClasses.forEach(function(cls, index, classes) {
             dayClasses.forEach(function(cls, index, classes) {
-              expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index]);
-            });
-          });
-        });
-      });
+              expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index])
+            })
+          })
+        })
+      })
 
 
       describe('when specified', function() {
       describe('when specified', function() {
         it('should contain the specified names in the given order', function() {
         it('should contain the specified names in the given order', function() {
           var days = [
           var days = [
             'Hov.', 'maS.', 'veS.', 'mech.', 'parmaq.', 'HoS.'
             'Hov.', 'maS.', 'veS.', 'mech.', 'parmaq.', 'HoS.'
-          ];
-          settings.dayNamesShort = days;
-          $('#cal').fullCalendar(settings);
+          ]
+          settings.dayNamesShort = days
+          $('#cal').fullCalendar(settings)
 
 
           dayClasses.forEach(function(cls, index, classes) {
           dayClasses.forEach(function(cls, index, classes) {
-            expect($('.fc-view thead ' + cls)[0]).toContainText(days[index]);
-          });
-        });
-      });
-    });
-  });
-});
+            expect($('.fc-view thead ' + cls)[0]).toContainText(days[index])
+          })
+        })
+      })
+    })
+  })
+})

+ 15 - 15
tests/legacy/dayPopoverFormat.js

@@ -9,31 +9,31 @@ describe('dayPopoverFormat', function() {
       { title: 'event3', start: '2014-07-29', className: 'event3' },
       { title: 'event3', start: '2014-07-29', className: 'event3' },
       { title: 'event4', start: '2014-07-29', className: 'event4' }
       { title: 'event4', start: '2014-07-29', className: 'event4' }
     ]
     ]
-  });
+  })
 
 
   it('can be set to a custom value', function() {
   it('can be set to a custom value', function() {
     initCalendar({
     initCalendar({
       dayPopoverFormat: 'ddd, MMMM'
       dayPopoverFormat: 'ddd, MMMM'
-    });
-    $('.fc-more').simulate('click');
-    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('Tue, July');
-  });
+    })
+    $('.fc-more').simulate('click')
+    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('Tue, July')
+  })
 
 
   it('is affected by the current locale when the value is default', function() {
   it('is affected by the current locale when the value is default', function() {
     initCalendar({
     initCalendar({
       locale: 'fr'
       locale: 'fr'
-    });
-    $('.fc-more').simulate('click');
-    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('29 juillet 2014');
-  });
+    })
+    $('.fc-more').simulate('click')
+    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('29 juillet 2014')
+  })
 
 
   it('still maintains the same format when explicitly set, and there is a locale', function() {
   it('still maintains the same format when explicitly set, and there is a locale', function() {
     initCalendar({
     initCalendar({
       locale: 'fr',
       locale: 'fr',
-      dayPopoverFormat: 'YYYY',
-    });
-    $('.fc-more').simulate('click');
-    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('2014');
-  });
+      dayPopoverFormat: 'YYYY'
+    })
+    $('.fc-more').simulate('click')
+    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('2014')
+  })
 
 
-});
+})

+ 36 - 36
tests/legacy/dayRender.js

@@ -7,17 +7,17 @@ describe('dayRender', function() {
       fixedWeekCount: true,
       fixedWeekCount: true,
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       dayRender: function(date, cell) {
       dayRender: function(date, cell) {
-        expect(moment.isMoment(date)).toEqual(true);
-        expect(date.hasTime()).toEqual(false);
-        expect(date.format()).toEqual(cell.data('date'));
-        expect(cell).toBeInDOM();
+        expect(moment.isMoment(date)).toEqual(true)
+        expect(date.hasTime()).toEqual(false)
+        expect(date.format()).toEqual(cell.data('date'))
+        expect(cell).toBeInDOM()
       }
       }
-    };
+    }
 
 
-    spyOn(options, 'dayRender').and.callThrough();
-    initCalendar(options);
-    expect(options.dayRender.calls.count()).toEqual(42);
-  });
+    spyOn(options, 'dayRender').and.callThrough()
+    initCalendar(options)
+    expect(options.dayRender.calls.count()).toEqual(42)
+  })
 
 
   it('is called when view is changed', function() {
   it('is called when view is changed', function() {
     var options = {
     var options = {
@@ -25,14 +25,14 @@ describe('dayRender', function() {
       fixedWeekCount: true,
       fixedWeekCount: true,
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       dayRender: function(date, cell) { }
       dayRender: function(date, cell) { }
-    };
+    }
 
 
-    spyOn(options, 'dayRender').and.callThrough();
-    initCalendar(options);
-    options.dayRender.calls.reset();
-    currentCalendar.changeView('basicWeek');
-    expect(options.dayRender.calls.count()).toEqual(7);
-  });
+    spyOn(options, 'dayRender').and.callThrough()
+    initCalendar(options)
+    options.dayRender.calls.reset()
+    currentCalendar.changeView('basicWeek')
+    expect(options.dayRender.calls.count()).toEqual(7)
+  })
 
 
   // called if the date is navigated to a different visible range
   // called if the date is navigated to a different visible range
   it('is called when view is changed', function() {
   it('is called when view is changed', function() {
@@ -40,28 +40,28 @@ describe('dayRender', function() {
       defaultView: 'basicWeek',
       defaultView: 'basicWeek',
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       dayRender: function(date, cell) { }
       dayRender: function(date, cell) { }
-    };
+    }
 
 
-    spyOn(options, 'dayRender').and.callThrough();
-    initCalendar(options);
-    options.dayRender.calls.reset();
-    currentCalendar.gotoDate('2014-05-04'); // a day in the next week
-    expect(options.dayRender.calls.count()).toEqual(7);
-  });
+    spyOn(options, 'dayRender').and.callThrough()
+    initCalendar(options)
+    options.dayRender.calls.reset()
+    currentCalendar.gotoDate('2014-05-04') // a day in the next week
+    expect(options.dayRender.calls.count()).toEqual(7)
+  })
 
 
   it('won\'t be called when date is navigated but remains in the current visible range', function() {
   it('won\'t be called when date is navigated but remains in the current visible range', function() {
     var options = {
     var options = {
       defaultView: 'basicWeek',
       defaultView: 'basicWeek',
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       dayRender: function(date, cell) { }
       dayRender: function(date, cell) { }
-    };
+    }
 
 
-    spyOn(options, 'dayRender').and.callThrough();
-    initCalendar(options);
-    options.dayRender.calls.reset();
-    currentCalendar.gotoDate('2014-05-02'); // a day in the same week
-    expect(options.dayRender.calls.count()).toEqual(0);
-  });
+    spyOn(options, 'dayRender').and.callThrough()
+    initCalendar(options)
+    options.dayRender.calls.reset()
+    currentCalendar.gotoDate('2014-05-02') // a day in the same week
+    expect(options.dayRender.calls.count()).toEqual(0)
+  })
 
 
   it('allows you to modify the element', function() {
   it('allows you to modify the element', function() {
     var options = {
     var options = {
@@ -70,13 +70,13 @@ describe('dayRender', function() {
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       dayRender: function(date, cell) {
       dayRender: function(date, cell) {
         if (date.format() === '2014-05-01') {
         if (date.format() === '2014-05-01') {
-          cell.addClass('mycustomclass');
+          cell.addClass('mycustomclass')
         }
         }
       }
       }
-    };
+    }
 
 
-    initCalendar(options);
-    expect($(currentCalendar.el).find('td[data-date="2014-05-01"]')).toHaveClass('mycustomclass');
-  });
+    initCalendar(options)
+    expect($(currentCalendar.el).find('td[data-date="2014-05-01"]')).toHaveClass('mycustomclass')
+  })
 
 
-});
+})

+ 36 - 36
tests/legacy/defaultAllDayEventDuration.js

@@ -1,62 +1,62 @@
 describe('defaultAllDayEventDuration', function() {
 describe('defaultAllDayEventDuration', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
 
 
     options = {
     options = {
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       defaultView: 'month'
       defaultView: 'month'
-    };
-  });
+    }
+  })
 
 
   describe('when forceEventDuration is on', function() {
   describe('when forceEventDuration is on', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.forceEventDuration = true;
-    });
+      options.forceEventDuration = true
+    })
 
 
     it('correctly calculates an unspecified end when using a Duration object input', function() {
     it('correctly calculates an unspecified end when using a Duration object input', function() {
-      options.defaultAllDayEventDuration = { days: 2 };
+      options.defaultAllDayEventDuration = { days: 2 }
       options.events = [
       options.events = [
         {
         {
           allDay: true,
           allDay: true,
           start: '2014-05-05'
           start: '2014-05-05'
         }
         }
-      ];
-      $('#cal').fullCalendar(options);
-      var event = $('#cal').fullCalendar('clientEvents')[0];
-      expect(event.end).toEqualMoment('2014-05-07');
-    });
+      ]
+      $('#cal').fullCalendar(options)
+      var event = $('#cal').fullCalendar('clientEvents')[0]
+      expect(event.end).toEqualMoment('2014-05-07')
+    })
 
 
     it('correctly calculates an unspecified end when using a string Duration input', function() {
     it('correctly calculates an unspecified end when using a string Duration input', function() {
-      options.defaultAllDayEventDuration = '3.00:00:00';
+      options.defaultAllDayEventDuration = '3.00:00:00'
       options.events = [
       options.events = [
         {
         {
           allDay: true,
           allDay: true,
           start: '2014-05-05'
           start: '2014-05-05'
         }
         }
-      ];
-      $('#cal').fullCalendar(options);
-      var event = $('#cal').fullCalendar('clientEvents')[0];
-      expect(event.end).toEqualMoment('2014-05-08');
-    });
-  });
+      ]
+      $('#cal').fullCalendar(options)
+      var event = $('#cal').fullCalendar('clientEvents')[0]
+      expect(event.end).toEqualMoment('2014-05-08')
+    })
+  })
 
 
   describe('when forceEventDuration is off', function() {
   describe('when forceEventDuration is off', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.forceEventDuration = false;
+      options.forceEventDuration = false
     });
     });
 
 
     [ 'basicWeek', 'agendaWeek' ].forEach(function(viewName) { // because they render all-day events in similar ways
     [ 'basicWeek', 'agendaWeek' ].forEach(function(viewName) { // because they render all-day events in similar ways
       describe('with ' + viewName + ' view', function() {
       describe('with ' + viewName + ' view', function() {
         beforeEach(function() {
         beforeEach(function() {
-          options.defaultView = viewName;
-        });
+          options.defaultView = viewName
+        })
         it('renders an all-day event with no `end` to appear to have the default duration', function(done) {
         it('renders an all-day event with no `end` to appear to have the default duration', function(done) {
-          options.defaultAllDayEventDuration = { days: 2 };
+          options.defaultAllDayEventDuration = { days: 2 }
           options.events = [
           options.events = [
             {
             {
               // a control. so we know how wide it should be
               // a control. so we know how wide it should be
@@ -71,17 +71,17 @@ describe('defaultAllDayEventDuration', function() {
               allDay: true,
               allDay: true,
               start: '2014-04-28'
               start: '2014-04-28'
             }
             }
-          ];
+          ]
           options.eventAfterAllRender = function() {
           options.eventAfterAllRender = function() {
-            var eventElms = $('#cal .fc-event');
-            var width0 = eventElms.eq(0).outerWidth();
-            var width1 = eventElms.eq(1).outerWidth();
-            expect(width0).toEqual(width1);
-            done();
-          };
-          $('#cal').fullCalendar(options);
-        });
-      });
-    });
-  });
-});
+            var eventElms = $('#cal .fc-event')
+            var width0 = eventElms.eq(0).outerWidth()
+            var width1 = eventElms.eq(1).outerWidth()
+            expect(width0).toEqual(width1)
+            done()
+          }
+          $('#cal').fullCalendar(options)
+        })
+      })
+    })
+  })
+})

+ 49 - 49
tests/legacy/defaultTimedEventDuration.js

@@ -1,61 +1,61 @@
 describe('defaultTimedEventDuration', function() {
 describe('defaultTimedEventDuration', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
 
 
     options = {
     options = {
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       defaultView: 'month'
       defaultView: 'month'
-    };
-  });
+    }
+  })
 
 
   describe('when forceEventDuration is on', function() {
   describe('when forceEventDuration is on', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.forceEventDuration = true;
-    });
+      options.forceEventDuration = true
+    })
 
 
     it('correctly calculates an unspecified end when using a Duration object input', function() {
     it('correctly calculates an unspecified end when using a Duration object input', function() {
-      options.defaultTimedEventDuration = { hours: 2, minutes: 30 };
+      options.defaultTimedEventDuration = { hours: 2, minutes: 30 }
       options.events = [
       options.events = [
         {
         {
           allDay: false,
           allDay: false,
           start: '2014-05-05T04:00:00'
           start: '2014-05-05T04:00:00'
         }
         }
-      ];
-      $('#cal').fullCalendar(options);
-      var event = $('#cal').fullCalendar('clientEvents')[0];
-      expect(event.end).toEqualMoment('2014-05-05T06:30:00');
-    });
+      ]
+      $('#cal').fullCalendar(options)
+      var event = $('#cal').fullCalendar('clientEvents')[0]
+      expect(event.end).toEqualMoment('2014-05-05T06:30:00')
+    })
 
 
     it('correctly calculates an unspecified end when using a string Duration input', function() {
     it('correctly calculates an unspecified end when using a string Duration input', function() {
-      options.defaultTimedEventDuration = '03:15:00';
+      options.defaultTimedEventDuration = '03:15:00'
       options.events = [
       options.events = [
         {
         {
           allDay: false,
           allDay: false,
           start: '2014-05-05T04:00:00'
           start: '2014-05-05T04:00:00'
         }
         }
-      ];
-      $('#cal').fullCalendar(options);
-      var event = $('#cal').fullCalendar('clientEvents')[0];
-      expect(event.end).toEqualMoment('2014-05-05T07:15:00');
-    });
-  });
+      ]
+      $('#cal').fullCalendar(options)
+      var event = $('#cal').fullCalendar('clientEvents')[0]
+      expect(event.end).toEqualMoment('2014-05-05T07:15:00')
+    })
+  })
 
 
   describe('when forceEventDuration is off', function() {
   describe('when forceEventDuration is off', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.forceEventDuration = false;
-    });
+      options.forceEventDuration = false
+    })
 
 
     describe('with agendaWeek view', function() {
     describe('with agendaWeek view', function() {
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = 'agendaWeek';
-      });
+        options.defaultView = 'agendaWeek'
+      })
       it('renders a timed event with no `end` to appear to have the default duration', function(done) {
       it('renders a timed event with no `end` to appear to have the default duration', function(done) {
-        options.defaultTimedEventDuration = '01:15:00';
+        options.defaultTimedEventDuration = '01:15:00'
         options.events = [
         options.events = [
           {
           {
             // a control. so we know how tall it should be
             // a control. so we know how tall it should be
@@ -70,24 +70,24 @@ describe('defaultTimedEventDuration', function() {
             allDay: false,
             allDay: false,
             start: '2014-05-02T04:00:00'
             start: '2014-05-02T04:00:00'
           }
           }
-        ];
+        ]
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          var eventElms = $('#cal .fc-event');
-          var height0 = eventElms.eq(0).outerHeight();
-          var height1 = eventElms.eq(1).outerHeight();
-          expect(height0).toEqual(height1);
-          done();
-        };
-        $('#cal').fullCalendar(options);
-      });
-    });
+          var eventElms = $('#cal .fc-event')
+          var height0 = eventElms.eq(0).outerHeight()
+          var height1 = eventElms.eq(1).outerHeight()
+          expect(height0).toEqual(height1)
+          done()
+        }
+        $('#cal').fullCalendar(options)
+      })
+    })
 
 
     describe('with basicWeek view', function() {
     describe('with basicWeek view', function() {
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = 'basicWeek';
-      });
+        options.defaultView = 'basicWeek'
+      })
       it('renders a timed event with no `end` to appear to have the default duration', function(done) {
       it('renders a timed event with no `end` to appear to have the default duration', function(done) {
-        options.defaultTimedEventDuration = { days: 2 };
+        options.defaultTimedEventDuration = { days: 2 }
         options.events = [
         options.events = [
           {
           {
             // a control. so we know how wide it should be
             // a control. so we know how wide it should be
@@ -102,16 +102,16 @@ describe('defaultTimedEventDuration', function() {
             allDay: false,
             allDay: false,
             start: '2014-04-28T04:00:00'
             start: '2014-04-28T04:00:00'
           }
           }
-        ];
+        ]
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          var eventElms = $('#cal .fc-event');
-          var width0 = eventElms.eq(0).outerWidth();
-          var width1 = eventElms.eq(1).outerWidth();
-          expect(width0).toEqual(width1);
-          done();
-        };
-        $('#cal').fullCalendar(options);
-      });
-    });
-  });
-});
+          var eventElms = $('#cal .fc-event')
+          var width0 = eventElms.eq(0).outerWidth()
+          var width1 = eventElms.eq(1).outerWidth()
+          expect(width0).toEqual(width1)
+          done()
+        }
+        $('#cal').fullCalendar(options)
+      })
+    })
+  })
+})

+ 47 - 47
tests/legacy/destroy.js

@@ -1,46 +1,46 @@
-import { countHandlers } from '../lib/dom-utils';
+import { countHandlers } from '../lib/dom-utils'
 
 
 describe('destroy', function() {
 describe('destroy', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-  });
+    affix('#cal')
+  })
 
 
   describe('when calendar is LTR', function() {
   describe('when calendar is LTR', function() {
     it('cleans up all classNames on the root element', function() {
     it('cleans up all classNames on the root element', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         isRTL: false
         isRTL: false
-      });
-      $('#cal').fullCalendar('destroy');
-      expect($('#cal')[0].className).toBe('');
-    });
-  });
+      })
+      $('#cal').fullCalendar('destroy')
+      expect($('#cal')[0].className).toBe('')
+    })
+  })
 
 
   describe('when calendar is RTL', function() {
   describe('when calendar is RTL', function() {
     it('cleans up all classNames on the root element', function() {
     it('cleans up all classNames on the root element', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         isRTL: true
         isRTL: true
-      });
-      $('#cal').fullCalendar('destroy');
-      expect($('#cal')[0].className).toBe('');
-    });
-  });
+      })
+      $('#cal').fullCalendar('destroy')
+      expect($('#cal')[0].className).toBe('')
+    })
+  })
 
 
   describeOptions('theme', {
   describeOptions('theme', {
     'when jquery-ui theme': 'jquery-ui',
     'when jquery-ui theme': 'jquery-ui',
     'when bootstrap theme': 'bootstrap3'
     'when bootstrap theme': 'bootstrap3'
   }, function() {
   }, function() {
     it('cleans up all classNames on the root element', function() {
     it('cleans up all classNames on the root element', function() {
-      initCalendar();
-      $('#cal').fullCalendar('destroy');
-      expect($('#cal')[0].className).toBe('');
-    });
+      initCalendar()
+      $('#cal').fullCalendar('destroy')
+      expect($('#cal')[0].className).toBe('')
+    })
   });
   });
 
 
   [ 'month', 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
   [ 'month', 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
 
 
     describe('when in ' + viewName + ' view', function() {
     describe('when in ' + viewName + ' view', function() {
-      var options;
+      var options
 
 
       beforeEach(function() {
       beforeEach(function() {
         options = {
         options = {
@@ -51,53 +51,53 @@ describe('destroy', function() {
           events: [
           events: [
             { title: 'event1', start: '2014-12-01' }
             { title: 'event1', start: '2014-12-01' }
           ]
           ]
-        };
-      });
+        }
+      })
 
 
       it('leaves no handlers attached to DOM', function(done) {
       it('leaves no handlers attached to DOM', function(done) {
         setTimeout(function() { // in case there are delayed attached handlers
         setTimeout(function() { // in case there are delayed attached handlers
 
 
-          var origDocCnt = countHandlers(document);
-          var origElCnt = countHandlers('#cal');
+          var origDocCnt = countHandlers(document)
+          var origElCnt = countHandlers('#cal')
 
 
-          $('#cal').fullCalendar(options);
+          $('#cal').fullCalendar(options)
 
 
-          $('#cal').fullCalendar('destroy');
+          $('#cal').fullCalendar('destroy')
           setTimeout(function() { // might not have detached handlers synchronously
           setTimeout(function() { // might not have detached handlers synchronously
 
 
-            expect(countHandlers(document)).toBe(origDocCnt);
-            expect(countHandlers('#cal')).toBe(origElCnt);
+            expect(countHandlers(document)).toBe(origDocCnt)
+            expect(countHandlers('#cal')).toBe(origElCnt)
 
 
-            done();
-          }, 100);
-        }, 100);
-      });
+            done()
+          }, 100)
+        }, 100)
+      })
 
 
       // Issue 2432
       // Issue 2432
       it('preserves existing window handlers when handleWindowResize is off', function(done) {
       it('preserves existing window handlers when handleWindowResize is off', function(done) {
-        var resizeHandler = function() { };
-        var handlerCnt0 = countHandlers(window);
-        var handlerCnt1;
-        var handlerCnt2;
+        var resizeHandler = function() { }
+        var handlerCnt0 = countHandlers(window)
+        var handlerCnt1
+        var handlerCnt2
 
 
-        $(window).on('resize', resizeHandler);
-        handlerCnt1 = countHandlers(window);
-        expect(handlerCnt1).toBe(handlerCnt0 + 1);
+        $(window).on('resize', resizeHandler)
+        handlerCnt1 = countHandlers(window)
+        expect(handlerCnt1).toBe(handlerCnt0 + 1)
 
 
         $('#cal').fullCalendar({
         $('#cal').fullCalendar({
           handleWindowResize: false
           handleWindowResize: false
-        });
+        })
 
 
-        $('#cal').fullCalendar('destroy');
+        $('#cal').fullCalendar('destroy')
         setTimeout(function() { // might not have detached handlers synchronously
         setTimeout(function() { // might not have detached handlers synchronously
 
 
-          handlerCnt2 = countHandlers(window);
-          expect(handlerCnt2).toBe(handlerCnt1);
+          handlerCnt2 = countHandlers(window)
+          expect(handlerCnt2).toBe(handlerCnt1)
 
 
-          done();
-        }, 100);
-      });
-    });
-  });
+          done()
+        }, 100)
+      })
+    })
+  })
 
 
-});
+})

+ 72 - 72
tests/legacy/displayEventEnd.js

@@ -1,29 +1,29 @@
 describe('displayEventEnd', function() {
 describe('displayEventEnd', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultDate: '2014-06-13',
       defaultDate: '2014-06-13',
       timeFormat: 'H:mm'
       timeFormat: 'H:mm'
-    };
-  });
+    }
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    $('#cal').fullCalendar('destroy');
+    $('#cal').fullCalendar('destroy')
   });
   });
 
 
   [ 'month', 'agendaWeek' ].forEach(function(viewName) {
   [ 'month', 'agendaWeek' ].forEach(function(viewName) {
     describe('when in ' + viewName + ' view', function() {
     describe('when in ' + viewName + ' view', function() {
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = viewName;
-      });
+        options.defaultView = viewName
+      })
 
 
       describe('when off', function() {
       describe('when off', function() {
         beforeEach(function() {
         beforeEach(function() {
-          options.displayEventEnd = false;
-        });
+          options.displayEventEnd = false
+        })
 
 
         describe('with an all-day event', function() {
         describe('with an all-day event', function() {
           beforeEach(function() {
           beforeEach(function() {
@@ -32,16 +32,16 @@ describe('displayEventEnd', function() {
               start: '2014-06-13',
               start: '2014-06-13',
               end: '2014-06-13',
               end: '2014-06-13',
               allDay: true
               allDay: true
-            } ];
-          });
+            } ]
+          })
           it('displays no time text', function(done) {
           it('displays no time text', function(done) {
             options.eventAfterAllRender = function() {
             options.eventAfterAllRender = function() {
-              expect($('.fc-event .fc-time').length).toBe(0);
-              done();
-            };
-            $('#cal').fullCalendar(options);
-          });
-        });
+              expect($('.fc-event .fc-time').length).toBe(0)
+              done()
+            }
+            $('#cal').fullCalendar(options)
+          })
+        })
 
 
         describe('with a timed event with no end time', function() {
         describe('with a timed event with no end time', function() {
           beforeEach(function() {
           beforeEach(function() {
@@ -49,16 +49,16 @@ describe('displayEventEnd', function() {
               title: 'timed event',
               title: 'timed event',
               start: '2014-06-13T01:00:00',
               start: '2014-06-13T01:00:00',
               allDay: false
               allDay: false
-            } ];
-          });
+            } ]
+          })
           it('displays only the start time text', function(done) {
           it('displays only the start time text', function(done) {
             options.eventAfterAllRender = function() {
             options.eventAfterAllRender = function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00');
-              done();
-            };
-            $('#cal').fullCalendar(options);
-          });
-        });
+              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              done()
+            }
+            $('#cal').fullCalendar(options)
+          })
+        })
 
 
         describe('with a timed event with an end time', function() {
         describe('with a timed event with an end time', function() {
           beforeEach(function() {
           beforeEach(function() {
@@ -67,22 +67,22 @@ describe('displayEventEnd', function() {
               start: '2014-06-13T01:00:00',
               start: '2014-06-13T01:00:00',
               end: '2014-06-13T02:00:00',
               end: '2014-06-13T02:00:00',
               allDay: false
               allDay: false
-            } ];
-          });
+            } ]
+          })
           it('displays only the start time text', function(done) {
           it('displays only the start time text', function(done) {
             options.eventAfterAllRender = function() {
             options.eventAfterAllRender = function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00');
-              done();
-            };
-            $('#cal').fullCalendar(options);
-          });
-        });
-      });
+              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              done()
+            }
+            $('#cal').fullCalendar(options)
+          })
+        })
+      })
 
 
       describe('when on', function() {
       describe('when on', function() {
         beforeEach(function() {
         beforeEach(function() {
-          options.displayEventEnd = true;
-        });
+          options.displayEventEnd = true
+        })
 
 
         describe('with an all-day event', function() {
         describe('with an all-day event', function() {
           beforeEach(function() {
           beforeEach(function() {
@@ -91,16 +91,16 @@ describe('displayEventEnd', function() {
               start: '2014-06-13',
               start: '2014-06-13',
               end: '2014-06-13',
               end: '2014-06-13',
               allDay: true
               allDay: true
-            } ];
-          });
+            } ]
+          })
           it('displays no time text', function(done) {
           it('displays no time text', function(done) {
             options.eventAfterAllRender = function() {
             options.eventAfterAllRender = function() {
-              expect($('.fc-event .fc-time').length).toBe(0);
-              done();
-            };
-            $('#cal').fullCalendar(options);
-          });
-        });
+              expect($('.fc-event .fc-time').length).toBe(0)
+              done()
+            }
+            $('#cal').fullCalendar(options)
+          })
+        })
 
 
         describe('with a timed event with no end time', function() {
         describe('with a timed event with no end time', function() {
           beforeEach(function() {
           beforeEach(function() {
@@ -108,16 +108,16 @@ describe('displayEventEnd', function() {
               title: 'timed event',
               title: 'timed event',
               start: '2014-06-13T01:00:00',
               start: '2014-06-13T01:00:00',
               allDay: false
               allDay: false
-            } ];
-          });
+            } ]
+          })
           it('displays only the start time text', function(done) {
           it('displays only the start time text', function(done) {
             options.eventAfterAllRender = function() {
             options.eventAfterAllRender = function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00');
-              done();
-            };
-            $('#cal').fullCalendar(options);
-          });
-        });
+              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              done()
+            }
+            $('#cal').fullCalendar(options)
+          })
+        })
 
 
         describe('with a timed event given an invalid end time', function() {
         describe('with a timed event given an invalid end time', function() {
           beforeEach(function() {
           beforeEach(function() {
@@ -126,16 +126,16 @@ describe('displayEventEnd', function() {
               start: '2014-06-13T01:00:00',
               start: '2014-06-13T01:00:00',
               end: '2014-06-13T01:00:00',
               end: '2014-06-13T01:00:00',
               allDay: false
               allDay: false
-            } ];
-          });
+            } ]
+          })
           it('displays only the start time text', function(done) {
           it('displays only the start time text', function(done) {
             options.eventAfterAllRender = function() {
             options.eventAfterAllRender = function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00');
-              done();
-            };
-            $('#cal').fullCalendar(options);
-          });
-        });
+              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              done()
+            }
+            $('#cal').fullCalendar(options)
+          })
+        })
 
 
         describe('with a timed event with an end time', function() {
         describe('with a timed event with an end time', function() {
           beforeEach(function() {
           beforeEach(function() {
@@ -144,17 +144,17 @@ describe('displayEventEnd', function() {
               start: '2014-06-13T01:00:00',
               start: '2014-06-13T01:00:00',
               end: '2014-06-13T02:00:00',
               end: '2014-06-13T02:00:00',
               allDay: false
               allDay: false
-            } ];
-          });
+            } ]
+          })
           it('displays both the start and end time text', function(done) {
           it('displays both the start and end time text', function(done) {
             options.eventAfterAllRender = function() {
             options.eventAfterAllRender = function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00 - 2:00');
-              done();
-            };
-            $('#cal').fullCalendar(options);
-          });
-        });
-      });
-    });
-  });
-});
+              expect($('.fc-event .fc-time')).toHaveText('1:00 - 2:00')
+              done()
+            }
+            $('#cal').fullCalendar(options)
+          })
+        })
+      })
+    })
+  })
+})

+ 82 - 82
tests/legacy/emitter.js

@@ -1,124 +1,124 @@
 
 
 describe('emitter', function() {
 describe('emitter', function() {
-  var EmitterMixin = $.fullCalendar.EmitterMixin;
+  var EmitterMixin = $.fullCalendar.EmitterMixin
 
 
   it('calls a handler', function() {
   it('calls a handler', function() {
-    var o = new EmitterMixin();
+    var o = new EmitterMixin()
     var handlers = {
     var handlers = {
       something: function(arg1, arg2) {
       something: function(arg1, arg2) {
-        expect(arg1).toBe(7);
-        expect(arg2).toBe(8);
+        expect(arg1).toBe(7)
+        expect(arg2).toBe(8)
       }
       }
-    };
-    spyOn(handlers, 'something').and.callThrough();
+    }
+    spyOn(handlers, 'something').and.callThrough()
 
 
-    o.on('something', handlers.something);
-    o.trigger('something', 7, 8);
-    expect(handlers.something).toHaveBeenCalled();
-  });
+    o.on('something', handlers.something)
+    o.trigger('something', 7, 8)
+    expect(handlers.something).toHaveBeenCalled()
+  })
 
 
   it('calls a handler with context and args', function() {
   it('calls a handler with context and args', function() {
-    var customContext = {};
-    var o = new EmitterMixin();
+    var customContext = {}
+    var o = new EmitterMixin()
     var handlers = {
     var handlers = {
       something: function(arg1, arg2) {
       something: function(arg1, arg2) {
-        expect(this).toBe(customContext);
-        expect(arg1).toBe(2);
-        expect(arg2).toBe(3);
+        expect(this).toBe(customContext)
+        expect(arg1).toBe(2)
+        expect(arg2).toBe(3)
       }
       }
-    };
-    spyOn(handlers, 'something').and.callThrough();
+    }
+    spyOn(handlers, 'something').and.callThrough()
 
 
-    o.on('something', handlers.something);
-    o.triggerWith('something', customContext, [ 2, 3 ]);
-    expect(handlers.something).toHaveBeenCalled();
-  });
+    o.on('something', handlers.something)
+    o.triggerWith('something', customContext, [ 2, 3 ])
+    expect(handlers.something).toHaveBeenCalled()
+  })
 
 
   it('unbinds with an exact reference', function() {
   it('unbinds with an exact reference', function() {
-    var o = new EmitterMixin();
+    var o = new EmitterMixin()
     var handlers = {
     var handlers = {
       something: function() {}
       something: function() {}
-    };
-    spyOn(handlers, 'something');
+    }
+    spyOn(handlers, 'something')
 
 
-    o.on('something', handlers.something);
-    o.trigger('something');
-    expect(handlers.something).toHaveBeenCalled();
+    o.on('something', handlers.something)
+    o.trigger('something')
+    expect(handlers.something).toHaveBeenCalled()
 
 
-    o.off('something', handlers.something);
-    o.trigger('something');
-    expect(handlers.something.calls.count()).toBe(1);
-  });
+    o.off('something', handlers.something)
+    o.trigger('something')
+    expect(handlers.something.calls.count()).toBe(1)
+  })
 
 
   it('unbinds all when no reference', function() {
   it('unbinds all when no reference', function() {
-    var o = new EmitterMixin();
+    var o = new EmitterMixin()
     var handlers = {
     var handlers = {
       something1: function() {},
       something1: function() {},
       something2: function() {}
       something2: function() {}
-    };
-    spyOn(handlers, 'something1');
-    spyOn(handlers, 'something2');
+    }
+    spyOn(handlers, 'something1')
+    spyOn(handlers, 'something2')
 
 
-    o.on('something', handlers.something1);
-    o.on('something', handlers.something2);
+    o.on('something', handlers.something1)
+    o.on('something', handlers.something2)
 
 
-    o.trigger('something');
-    expect(handlers.something1).toHaveBeenCalled();
-    expect(handlers.something2).toHaveBeenCalled();
+    o.trigger('something')
+    expect(handlers.something1).toHaveBeenCalled()
+    expect(handlers.something2).toHaveBeenCalled()
 
 
-    o.off('something');
-    o.trigger('something');
-    expect(handlers.something1.calls.count()).toBe(1);
-    expect(handlers.something2.calls.count()).toBe(1);
-  });
+    o.off('something')
+    o.trigger('something')
+    expect(handlers.something1.calls.count()).toBe(1)
+    expect(handlers.something2.calls.count()).toBe(1)
+  })
 
 
   it('unbinds all', function() {
   it('unbinds all', function() {
-    var o = new EmitterMixin();
+    var o = new EmitterMixin()
     var handlers = {
     var handlers = {
       something: function() {},
       something: function() {},
       another: function() {}
       another: function() {}
-    };
+    }
 
 
-    spyOn(handlers, 'something');
-    spyOn(handlers, 'another');
+    spyOn(handlers, 'something')
+    spyOn(handlers, 'another')
 
 
-    o.on('something', handlers.something);
-    o.on('another', handlers.another);
+    o.on('something', handlers.something)
+    o.on('another', handlers.another)
 
 
-    o.trigger('something');
-    o.trigger('another');
-    expect(handlers.something).toHaveBeenCalled();
-    expect(handlers.another).toHaveBeenCalled();
+    o.trigger('something')
+    o.trigger('another')
+    expect(handlers.something).toHaveBeenCalled()
+    expect(handlers.another).toHaveBeenCalled()
 
 
-    o.off();
-    o.trigger('something');
-    o.trigger('another');
-    expect(handlers.something.calls.count()).toBe(1);
-    expect(handlers.another.calls.count()).toBe(1);
-  });
+    o.off()
+    o.trigger('something')
+    o.trigger('another')
+    expect(handlers.something.calls.count()).toBe(1)
+    expect(handlers.another.calls.count()).toBe(1)
+  })
 
 
   it('unbinds with a namespace', function() {
   it('unbinds with a namespace', function() {
-    var o = new EmitterMixin();
+    var o = new EmitterMixin()
     var handlers = {
     var handlers = {
       something: function() {},
       something: function() {},
       another: function() {}
       another: function() {}
-    };
-
-    spyOn(handlers, 'something');
-    spyOn(handlers, 'another');
-
-    o.on('something', handlers.something);
-    o.on('another.ns1', handlers.another);
-
-    o.trigger('something');
-    o.trigger('another');
-    expect(handlers.something).toHaveBeenCalled();
-    expect(handlers.another).toHaveBeenCalled();
-
-    o.off('.ns1');
-    o.trigger('something');
-    o.trigger('another');
-    expect(handlers.something.calls.count()).toBe(2);
-    expect(handlers.another.calls.count()).toBe(1);
-  });
-});
+    }
+
+    spyOn(handlers, 'something')
+    spyOn(handlers, 'another')
+
+    o.on('something', handlers.something)
+    o.on('another.ns1', handlers.another)
+
+    o.trigger('something')
+    o.trigger('another')
+    expect(handlers.something).toHaveBeenCalled()
+    expect(handlers.another).toHaveBeenCalled()
+
+    o.off('.ns1')
+    o.trigger('something')
+    o.trigger('another')
+    expect(handlers.something.calls.count()).toBe(2)
+    expect(handlers.another.calls.count()).toBe(1)
+  })
+})

+ 82 - 82
tests/legacy/event-coloring.js

@@ -1,55 +1,55 @@
-import { RED_REGEX } from '../lib/dom-utils';
+import { RED_REGEX } from '../lib/dom-utils'
 
 
 describe('event coloring', function() {
 describe('event coloring', function() {
 
 
   pushOptions({
   pushOptions({
     defaultDate: '2014-11-04'
     defaultDate: '2014-11-04'
-  });
+  })
 
 
   describe('when in month view', function() {
   describe('when in month view', function() {
 
 
     pushOptions({
     pushOptions({
       defaultView: 'month'
       defaultView: 'month'
-    });
+    })
 
 
-    defineViewTests(false);
-  });
+    defineViewTests(false)
+  })
 
 
   describe('when in agendaWeek view', function() {
   describe('when in agendaWeek view', function() {
 
 
     pushOptions({
     pushOptions({
       defaultView: 'agendaWeek',
       defaultView: 'agendaWeek',
       allDaySlot: false
       allDaySlot: false
-    });
+    })
 
 
-    defineViewTests(true);
-  });
+    defineViewTests(true)
+  })
 
 
   function defineViewTests(eventHasTime) {
   function defineViewTests(eventHasTime) {
 
 
     describe('for foreground events', function() {
     describe('for foreground events', function() {
-      testTextColor(eventHasTime);
-      testBorderColor(eventHasTime);
-      testBackgroundColor(eventHasTime);
-    });
+      testTextColor(eventHasTime)
+      testBorderColor(eventHasTime)
+      testBackgroundColor(eventHasTime)
+    })
 
 
     describe('for background events', function() {
     describe('for background events', function() {
-      testBackgroundColor(eventHasTime, 'background');
-    });
+      testBackgroundColor(eventHasTime, 'background')
+    })
 
 
   }
   }
 
 
   function testTextColor(eventHasTime) {
   function testTextColor(eventHasTime) {
 
 
-    var eventOptions = getEventOptions(eventHasTime);
+    var eventOptions = getEventOptions(eventHasTime)
 
 
     it('should accept the global eventTextColor', function() {
     it('should accept the global eventTextColor', function() {
       initCalendar({
       initCalendar({
         eventTextColor: 'red',
         eventTextColor: 'red',
         events: [ getTestEvent(eventOptions) ]
         events: [ getTestEvent(eventOptions) ]
-      });
-      expect(getEventCss('color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('color')).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event source\'s textColor', function() {
     it('should accept an event source\'s textColor', function() {
       initCalendar({
       initCalendar({
@@ -58,42 +58,42 @@ describe('event coloring', function() {
           textColor: 'red',
           textColor: 'red',
           events: [ getTestEvent(eventOptions) ]
           events: [ getTestEvent(eventOptions) ]
         } ]
         } ]
-      });
-      expect(getEventCss('color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('color')).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event object\'s textColor', function() {
     it('should accept an event object\'s textColor', function() {
       var eventInput = getTestEvent(eventOptions, {
       var eventInput = getTestEvent(eventOptions, {
         textColor: 'red'
         textColor: 'red'
-      });
+      })
       initCalendar({
       initCalendar({
         textColor: 'blue', // even when there's a more general setting
         textColor: 'blue', // even when there's a more general setting
         events: [ eventInput ]
         events: [ eventInput ]
-      });
-      expect(getEventCss('color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('color')).toMatch(RED_REGEX)
+    })
   }
   }
 
 
   function testBorderColor(eventHasTime) {
   function testBorderColor(eventHasTime) {
 
 
-    var eventOptions = getEventOptions(eventHasTime);
+    var eventOptions = getEventOptions(eventHasTime)
 
 
     it('should accept the global eventColor for border color', function() {
     it('should accept the global eventColor for border color', function() {
       initCalendar({
       initCalendar({
         eventColor: 'red',
         eventColor: 'red',
         events: [ getTestEvent(eventOptions) ]
         events: [ getTestEvent(eventOptions) ]
-      });
-      expect(getEventCss('border-top-color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('border-top-color')).toMatch(RED_REGEX)
+    })
 
 
     it('should accept the global eventBorderColor', function() {
     it('should accept the global eventBorderColor', function() {
       initCalendar({
       initCalendar({
         eventColor: 'blue',
         eventColor: 'blue',
         eventBorderColor: 'red',
         eventBorderColor: 'red',
         events: [ getTestEvent(eventOptions) ]
         events: [ getTestEvent(eventOptions) ]
-      });
-      expect(getEventCss('border-top-color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('border-top-color')).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event source\'s color for the border', function() {
     it('should accept an event source\'s color for the border', function() {
       initCalendar({
       initCalendar({
@@ -102,9 +102,9 @@ describe('event coloring', function() {
           color: 'red',
           color: 'red',
           events: [ getTestEvent(eventOptions) ]
           events: [ getTestEvent(eventOptions) ]
         } ]
         } ]
-      });
-      expect(getEventCss('border-top-color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('border-top-color')).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event source\'s borderColor', function() {
     it('should accept an event source\'s borderColor', function() {
       initCalendar({
       initCalendar({
@@ -114,62 +114,62 @@ describe('event coloring', function() {
           borderColor: 'red',
           borderColor: 'red',
           events: [ getTestEvent(eventOptions) ]
           events: [ getTestEvent(eventOptions) ]
         } ]
         } ]
-      });
-      expect(getEventCss('border-top-color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('border-top-color')).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event object\'s color for the border', function() {
     it('should accept an event object\'s color for the border', function() {
       var eventInput = getTestEvent(eventOptions, {
       var eventInput = getTestEvent(eventOptions, {
         color: 'red'
         color: 'red'
-      });
+      })
       initCalendar({
       initCalendar({
         eventSources: [ {
         eventSources: [ {
           borderColor: 'blue', // even when there's a more general setting
           borderColor: 'blue', // even when there's a more general setting
           events: [ eventInput ]
           events: [ eventInput ]
         } ]
         } ]
-      });
-      expect(getEventCss('border-top-color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('border-top-color')).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event object\'s borderColor', function() {
     it('should accept an event object\'s borderColor', function() {
       var eventInput = getTestEvent(eventOptions, {
       var eventInput = getTestEvent(eventOptions, {
         color: 'blue', // even when there's a more general setting
         color: 'blue', // even when there's a more general setting
         borderColor: 'red'
         borderColor: 'red'
-      });
+      })
       initCalendar({
       initCalendar({
         eventSources: [ {
         eventSources: [ {
           events: [ eventInput ]
           events: [ eventInput ]
         } ]
         } ]
-      });
-      expect(getEventCss('border-top-color')).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('border-top-color')).toMatch(RED_REGEX)
+    })
   }
   }
 
 
 
 
   function testBackgroundColor(eventHasTime, rendering) {
   function testBackgroundColor(eventHasTime, rendering) {
 
 
-    var eventOptions = getEventOptions(eventHasTime);
+    var eventOptions = getEventOptions(eventHasTime)
 
 
     if (typeof rendering !== 'undefined') {
     if (typeof rendering !== 'undefined') {
-      eventOptions.rendering = rendering;
+      eventOptions.rendering = rendering
     }
     }
 
 
     it('should accept the global eventColor for background color', function() {
     it('should accept the global eventColor for background color', function() {
       initCalendar({
       initCalendar({
         eventColor: 'red',
         eventColor: 'red',
         events: [ getTestEvent(eventOptions) ]
         events: [ getTestEvent(eventOptions) ]
-      });
-      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX)
+    })
 
 
     it('should accept the global eventBackgroundColor', function() {
     it('should accept the global eventBackgroundColor', function() {
       initCalendar({
       initCalendar({
         eventColor: 'blue', // even when there's a more general setting
         eventColor: 'blue', // even when there's a more general setting
         eventBackgroundColor: 'red',
         eventBackgroundColor: 'red',
-        events: [ getTestEvent(eventOptions) ],
-      });
-      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX);
-    });
+        events: [ getTestEvent(eventOptions) ]
+      })
+      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event source\'s color for the background', function() {
     it('should accept an event source\'s color for the background', function() {
       initCalendar({
       initCalendar({
@@ -178,9 +178,9 @@ describe('event coloring', function() {
           color: 'red',
           color: 'red',
           events: [ getTestEvent(eventOptions) ]
           events: [ getTestEvent(eventOptions) ]
         } ]
         } ]
-      });
-      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event source\'s backgroundColor', function() {
     it('should accept an event source\'s backgroundColor', function() {
       initCalendar({
       initCalendar({
@@ -189,57 +189,57 @@ describe('event coloring', function() {
           backgroundColor: 'red',
           backgroundColor: 'red',
           events: [ getTestEvent(eventOptions) ]
           events: [ getTestEvent(eventOptions) ]
         } ]
         } ]
-      });
-      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event object\'s color for the background', function() {
     it('should accept an event object\'s color for the background', function() {
-      var eventInput = getTestEvent(eventOptions);
-      eventInput.color = 'red';
+      var eventInput = getTestEvent(eventOptions)
+      eventInput.color = 'red'
       initCalendar({
       initCalendar({
         eventSources: [ {
         eventSources: [ {
           backgroundColor: 'blue', // even when there's a more general setting
           backgroundColor: 'blue', // even when there's a more general setting
           events: [ eventInput ]
           events: [ eventInput ]
         } ]
         } ]
-      });
-      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX)
+    })
 
 
     it('should accept an event object\'s backgroundColor', function() {
     it('should accept an event object\'s backgroundColor', function() {
-      var eventInput = getTestEvent(eventOptions);
-      eventInput.color = 'blue'; // even when there's a more general setting
-      eventInput.backgroundColor = 'red';
+      var eventInput = getTestEvent(eventOptions)
+      eventInput.color = 'blue' // even when there's a more general setting
+      eventInput.backgroundColor = 'red'
       initCalendar({
       initCalendar({
         eventSources: [ {
         eventSources: [ {
           events: [ eventInput ]
           events: [ eventInput ]
         } ]
         } ]
-      });
-      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX);
-    });
+      })
+      expect(getEventCss('background-color', rendering)).toMatch(RED_REGEX)
+    })
   }
   }
 
 
   function getEventCss(prop, rendering) {
   function getEventCss(prop, rendering) {
-    var el = $(rendering === 'background' ? '.fc-bgevent' : '.fc-event');
-    return el.css(prop);
+    var el = $(rendering === 'background' ? '.fc-bgevent' : '.fc-event')
+    return el.css(prop)
   }
   }
 
 
   function getTestEvent(defaultOptions, extraOptions) {
   function getTestEvent(defaultOptions, extraOptions) {
-    var event = {};
-    $.extend( event, defaultOptions );
+    var event = {}
+    $.extend(event, defaultOptions)
     if (extraOptions) {
     if (extraOptions) {
-      $.extend( event, extraOptions );
+      $.extend(event, extraOptions)
     }
     }
-    return event;
+    return event
   }
   }
 
 
   function getEventOptions(eventHasTime) {
   function getEventOptions(eventHasTime) {
     var options = {
     var options = {
       start: '2014-11-04'
       start: '2014-11-04'
-    };
+    }
     if (eventHasTime) {
     if (eventHasTime) {
-      options.start += 'T01:00:00';
+      options.start += 'T01:00:00'
     }
     }
-    return options;
+    return options
   };
   };
 
 
-});
+})

+ 205 - 205
tests/legacy/event-dnd.js

@@ -1,5 +1,5 @@
 describe('eventDrop', function() {
 describe('eventDrop', function() {
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
     options = {
     options = {
@@ -7,17 +7,17 @@ describe('eventDrop', function() {
       editable: true,
       editable: true,
       dragScroll: false,
       dragScroll: false,
       longPressDelay: 100
       longPressDelay: 100
-    };
-    affix('#cal');
-  });
+    }
+    affix('#cal')
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    $('#cal').fullCalendar('destroy');
-  });
+    $('#cal').fullCalendar('destroy')
+  })
 
 
   describe('when in month view', function() {
   describe('when in month view', function() {
     beforeEach(function() {
     beforeEach(function() {
-      options.defaultView = 'month';
+      options.defaultView = 'month'
     });
     });
 
 
     // TODO: test that event's dragged via touch that don't wait long enough for longPressDelay
     // TODO: test that event's dragged via touch that don't wait long enough for longPressDelay
@@ -32,7 +32,7 @@ describe('eventDrop', function() {
               title: 'all-day event',
               title: 'all-day event',
               start: '2014-06-11',
               start: '2014-06-11',
               allDay: true
               allDay: true
-            } ];
+            } ]
 
 
             init(
             init(
               function() {
               function() {
@@ -41,31 +41,31 @@ describe('eventDrop', function() {
                   dy: $('.fc-day').height(),
                   dy: $('.fc-day').height(),
                   isTouch: isTouch,
                   isTouch: isTouch,
                   delay: isTouch ? 200 : 0
                   delay: isTouch ? 200 : 0
-                });
+                })
               },
               },
               function(event, delta, revertFunc) {
               function(event, delta, revertFunc) {
-                expect(delta.asDays()).toBe(9);
-                expect(delta.hours()).toBe(0);
-                expect(delta.minutes()).toBe(0);
-                expect(delta.seconds()).toBe(0);
-                expect(delta.milliseconds()).toBe(0);
+                expect(delta.asDays()).toBe(9)
+                expect(delta.hours()).toBe(0)
+                expect(delta.minutes()).toBe(0)
+                expect(delta.seconds()).toBe(0)
+                expect(delta.milliseconds()).toBe(0)
 
 
-                expect(event.start).toEqualMoment('2014-06-20');
-                expect(event.end).toBeNull();
+                expect(event.start).toEqualMoment('2014-06-20')
+                expect(event.end).toBeNull()
 
 
-                revertFunc();
-                event = $('#cal').fullCalendar('clientEvents')[0];
+                revertFunc()
+                event = $('#cal').fullCalendar('clientEvents')[0]
 
 
-                expect(event.start).toEqualMoment('2014-06-11');
-                expect(event.end).toBeNull();
+                expect(event.start).toEqualMoment('2014-06-11')
+                expect(event.end).toBeNull()
 
 
-                done();
+                done()
               }
               }
-            );
-          });
-        });
-      });
-    });
+            )
+          })
+        })
+      })
+    })
 
 
     describe('when gragging a timed event to another day', function() {
     describe('when gragging a timed event to another day', function() {
       it('should be given correct arguments, with whole-day delta', function(done) {
       it('should be given correct arguments, with whole-day delta', function(done) {
@@ -73,36 +73,36 @@ describe('eventDrop', function() {
           title: 'timed event',
           title: 'timed event',
           start: '2014-06-11T06:00:00',
           start: '2014-06-11T06:00:00',
           allDay: false
           allDay: false
-        } ];
+        } ]
 
 
         init(
         init(
           function() {
           function() {
             $('.fc-event').simulate('drag', {
             $('.fc-event').simulate('drag', {
               dx: $('.fc-day').width() * -2,
               dx: $('.fc-day').width() * -2,
               dy: $('.fc-day').height()
               dy: $('.fc-day').height()
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.asDays()).toBe(5);
-            expect(delta.hours()).toBe(0);
-            expect(delta.minutes()).toBe(0);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.asDays()).toBe(5)
+            expect(delta.hours()).toBe(0)
+            expect(delta.minutes()).toBe(0)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-16T06:00:00');
-            expect(event.end).toBeNull();
+            expect(event.start).toEqualMoment('2014-06-16T06:00:00')
+            expect(event.end).toBeNull()
 
 
-            revertFunc();
-            event = $('#cal').fullCalendar('clientEvents')[0];
+            revertFunc()
+            event = $('#cal').fullCalendar('clientEvents')[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11T06:00:00');
-            expect(event.end).toBeNull();
+            expect(event.start).toEqualMoment('2014-06-11T06:00:00')
+            expect(event.end).toBeNull()
 
 
-            done();
+            done()
           }
           }
-        );
-      });
-    });
+        )
+      })
+    })
 
 
     // TODO: tests for eventMouseover/eventMouseout firing correctly when no dragging
     // TODO: tests for eventMouseover/eventMouseout firing correctly when no dragging
     it('should not fire any eventMouseover/eventMouseout events while dragging', function(done) { // issue 1297
     it('should not fire any eventMouseover/eventMouseout events while dragging', function(done) { // issue 1297
@@ -119,11 +119,11 @@ describe('eventDrop', function() {
           allDay: true,
           allDay: true,
           className: 'event2'
           className: 'event2'
         }
         }
-      ];
-      options.eventMouseover = function() { };
-      options.eventMouseout = function() { };
-      spyOn(options, 'eventMouseover');
-      spyOn(options, 'eventMouseout');
+      ]
+      options.eventMouseover = function() { }
+      options.eventMouseout = function() { }
+      spyOn(options, 'eventMouseover')
+      spyOn(options, 'eventMouseout')
 
 
       init(
       init(
         function() {
         function() {
@@ -132,27 +132,27 @@ describe('eventDrop', function() {
             dy: $('.fc-day').height(),
             dy: $('.fc-day').height(),
             moves: 10,
             moves: 10,
             duration: 1000
             duration: 1000
-          });
+          })
           setTimeout(function() { // wait until half way through drag
           setTimeout(function() { // wait until half way through drag
             $('.event2')
             $('.event2')
               .simulate('mouseover')
               .simulate('mouseover')
               .simulate('mouseenter')
               .simulate('mouseenter')
               .simulate('mouseout')
               .simulate('mouseout')
-              .simulate('mouseleave');
-          }, 500);
+              .simulate('mouseleave')
+          }, 500)
         },
         },
         function(event, delta, revertFunc) {
         function(event, delta, revertFunc) {
-          expect(options.eventMouseover).not.toHaveBeenCalled();
-          expect(options.eventMouseout).not.toHaveBeenCalled();
-          done();
+          expect(options.eventMouseover).not.toHaveBeenCalled()
+          expect(options.eventMouseout).not.toHaveBeenCalled()
+          done()
         }
         }
-      );
-    });
-  });
+      )
+    })
+  })
 
 
   describe('when in agenda view', function() {
   describe('when in agenda view', function() {
     beforeEach(function() {
     beforeEach(function() {
-      options.defaultView = 'agendaWeek';
+      options.defaultView = 'agendaWeek'
     });
     });
 
 
     [ false, true ].forEach(function(isTouch) {
     [ false, true ].forEach(function(isTouch) {
@@ -163,7 +163,7 @@ describe('eventDrop', function() {
               title: 'timed event',
               title: 'timed event',
               start: '2014-06-11T06:00:00',
               start: '2014-06-11T06:00:00',
               allDay: false
               allDay: false
-            } ];
+            } ]
 
 
             init(
             init(
               function() {
               function() {
@@ -175,32 +175,32 @@ describe('eventDrop', function() {
                     dy: $('.fc-slats tr:eq(1)').outerHeight() * 2.9, // 1.5 hours
                     dy: $('.fc-slats tr:eq(1)').outerHeight() * 2.9, // 1.5 hours
                     isTouch: isTouch,
                     isTouch: isTouch,
                     delay: isTouch ? 200 : 0
                     delay: isTouch ? 200 : 0
-                  });
-                }, 0);
+                  })
+                }, 0)
               },
               },
               function(event, delta, revertFunc) {
               function(event, delta, revertFunc) {
-                expect(delta.days()).toBe(1);
-                expect(delta.hours()).toBe(1);
-                expect(delta.minutes()).toBe(30);
-                expect(delta.seconds()).toBe(0);
-                expect(delta.milliseconds()).toBe(0);
+                expect(delta.days()).toBe(1)
+                expect(delta.hours()).toBe(1)
+                expect(delta.minutes()).toBe(30)
+                expect(delta.seconds()).toBe(0)
+                expect(delta.milliseconds()).toBe(0)
 
 
-                expect(event.start).toEqualMoment('2014-06-12T07:30:00');
-                expect(event.end).toBeNull();
+                expect(event.start).toEqualMoment('2014-06-12T07:30:00')
+                expect(event.end).toBeNull()
 
 
-                revertFunc();
-                event = $('#cal').fullCalendar('clientEvents')[0];
+                revertFunc()
+                event = $('#cal').fullCalendar('clientEvents')[0]
 
 
-                expect(event.start).toEqualMoment('2014-06-11T06:00:00');
-                expect(event.end).toBeNull();
+                expect(event.start).toEqualMoment('2014-06-11T06:00:00')
+                expect(event.end).toBeNull()
 
 
-                done();
+                done()
               }
               }
-            );
-          });
-        });
-      });
-    });
+            )
+          })
+        })
+      })
+    })
 
 
     describe('when dragging an all-day event to another all-day', function() {
     describe('when dragging an all-day event to another all-day', function() {
       it('should be given correct arguments, with whole-day delta', function(done) {
       it('should be given correct arguments, with whole-day delta', function(done) {
@@ -208,90 +208,90 @@ describe('eventDrop', function() {
           title: 'all-day event',
           title: 'all-day event',
           start: '2014-06-11',
           start: '2014-06-11',
           allDay: true
           allDay: true
-        } ];
+        } ]
 
 
         init(
         init(
           function() {
           function() {
             $('.fc-event').simulate('drag', {
             $('.fc-event').simulate('drag', {
               dx: $('th.fc-wed').width() * 2 // 2 days
               dx: $('th.fc-wed').width() * 2 // 2 days
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(2);
-            expect(delta.hours()).toBe(0);
-            expect(delta.minutes()).toBe(0);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(2)
+            expect(delta.hours()).toBe(0)
+            expect(delta.minutes()).toBe(0)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-13');
-            expect(event.end).toBeNull();
+            expect(event.start).toEqualMoment('2014-06-13')
+            expect(event.end).toBeNull()
 
 
-            revertFunc();
-            event = $('#cal').fullCalendar('clientEvents')[0];
+            revertFunc()
+            event = $('#cal').fullCalendar('clientEvents')[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11');
-            expect(event.end).toBeNull();
+            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.end).toBeNull()
 
 
-            done();
+            done()
           }
           }
-        );
-      });
-    });
+        )
+      })
+    })
 
 
     describe('when dragging an all-day event to a time slot on a different day', function() {
     describe('when dragging an all-day event to a time slot on a different day', function() {
       it('should be given correct arguments and delta with days/time', function(done) {
       it('should be given correct arguments and delta with days/time', function(done) {
-        options.scrollTime = '01:00:00';
-        options.height = 400; // short enough to make scrolling happen
+        options.scrollTime = '01:00:00'
+        options.height = 400 // short enough to make scrolling happen
         options.events = [ {
         options.events = [ {
           title: 'all-day event',
           title: 'all-day event',
           start: '2014-06-11',
           start: '2014-06-11',
           allDay: true
           allDay: true
-        } ];
+        } ]
 
 
         init(
         init(
           function() {
           function() {
-            var allDayGrid = $('.fc-agenda-view .fc-day-grid');
-            var hr = allDayGrid.next('hr');
+            var allDayGrid = $('.fc-agenda-view .fc-day-grid')
+            var hr = allDayGrid.next('hr')
             $('.fc-event').simulate('drag', {
             $('.fc-event').simulate('drag', {
               dx: $('th.fc-wed').width() * -1,
               dx: $('th.fc-wed').width() * -1,
               dy: allDayGrid.outerHeight() + hr.outerHeight()
               dy: allDayGrid.outerHeight() + hr.outerHeight()
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(0);
-            expect(delta.hours()).toBe(-23);
-            expect(delta.minutes()).toBe(0);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(0)
+            expect(delta.hours()).toBe(-23)
+            expect(delta.minutes()).toBe(0)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-10T01:00:00');
-            expect(event.end).toBeNull();
-            expect(event.allDay).toBe(false);
+            expect(event.start).toEqualMoment('2014-06-10T01:00:00')
+            expect(event.end).toBeNull()
+            expect(event.allDay).toBe(false)
 
 
-            revertFunc();
-            event = $('#cal').fullCalendar('clientEvents')[0];
+            revertFunc()
+            event = $('#cal').fullCalendar('clientEvents')[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11');
-            expect(event.end).toBeNull();
-            expect(event.allDay).toBe(true);
+            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.end).toBeNull()
+            expect(event.allDay).toBe(true)
 
 
-            done();
+            done()
           }
           }
-        );
-      });
-    });
+        )
+      })
+    })
 
 
     describe('when dragging a timed event to an all-day slot on a different day', function() {
     describe('when dragging a timed event to an all-day slot on a different day', function() {
       it('should be given correct arguments, with whole-day delta', function(done) {
       it('should be given correct arguments, with whole-day delta', function(done) {
-        var eventElm;
+        var eventElm
 
 
-        options.scrollTime = '01:00:00';
-        options.height = 400; // short enough to make scrolling happen
+        options.scrollTime = '01:00:00'
+        options.height = 400 // short enough to make scrolling happen
         options.events = [ {
         options.events = [ {
           title: 'timed event',
           title: 'timed event',
           start: '2014-06-11T01:00:00',
           start: '2014-06-11T01:00:00',
           allDay: false
           allDay: false
-        } ];
+        } ]
 
 
         init(
         init(
           function() {
           function() {
@@ -300,7 +300,7 @@ describe('eventDrop', function() {
               dy: -$('.fc-agenda-view .fc-day-grid').outerHeight(),
               dy: -$('.fc-agenda-view .fc-day-grid').outerHeight(),
               onBeforeRelease: function() {
               onBeforeRelease: function() {
                 // the all day slot works off of mouse-moving coordinates
                 // the all day slot works off of mouse-moving coordinates
-                var offset = eventElm.offset();
+                var offset = eventElm.offset()
                 $('.fc-agenda-allday .fc-day-content')
                 $('.fc-agenda-allday .fc-day-content')
                   .simulate('mouseover', {
                   .simulate('mouseover', {
                     clientX: offset.left + 10,
                     clientX: offset.left + 10,
@@ -309,147 +309,147 @@ describe('eventDrop', function() {
                   .simulate('mousemove', {
                   .simulate('mousemove', {
                     clientX: offset.left + 10,
                     clientX: offset.left + 10,
                     clientY: offset.top + 10
                     clientY: offset.top + 10
-                  });
+                  })
               }
               }
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(-1);
-            expect(delta.hours()).toBe(0);
-            expect(delta.minutes()).toBe(0);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(-1)
+            expect(delta.hours()).toBe(0)
+            expect(delta.minutes()).toBe(0)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-10');
-            expect(event.end).toBeNull();
-            expect(event.allDay).toBe(true);
+            expect(event.start).toEqualMoment('2014-06-10')
+            expect(event.end).toBeNull()
+            expect(event.allDay).toBe(true)
 
 
-            revertFunc();
-            event = $('#cal').fullCalendar('clientEvents')[0];
+            revertFunc()
+            event = $('#cal').fullCalendar('clientEvents')[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11T01:00:00');
-            expect(event.end).toBeNull();
-            expect(event.allDay).toBe(false);
+            expect(event.start).toEqualMoment('2014-06-11T01:00:00')
+            expect(event.end).toBeNull()
+            expect(event.allDay).toBe(false)
 
 
-            done();
+            done()
           }
           }
-        );
-      });
-    });
+        )
+      })
+    })
 
 
     describe('when dragging a timed event with no end time', function() {
     describe('when dragging a timed event with no end time', function() {
       it('should continue to only show the updated start time', function(done) {
       it('should continue to only show the updated start time', function(done) {
-        var dragged = false;
-        var eventElm;
+        var dragged = false
+        var eventElm
 
 
-        options.scrollTime = '01:00:00';
-        options.height = 400; // short enough to make scrolling happen
+        options.scrollTime = '01:00:00'
+        options.height = 400 // short enough to make scrolling happen
         options.events = [ {
         options.events = [ {
           title: 'timed event',
           title: 'timed event',
           start: '2014-06-11T01:00:00',
           start: '2014-06-11T01:00:00',
           allDay: false
           allDay: false
-        } ];
+        } ]
 
 
         init(
         init(
           function() {
           function() {
             eventElm = $('.fc-event .fc-time').simulate('drag', {
             eventElm = $('.fc-event .fc-time').simulate('drag', {
               dy: $('.fc-slats tr:eq(1)').height() * 2.9, // 1.5 hours
               dy: $('.fc-slats tr:eq(1)').height() * 2.9, // 1.5 hours
               onBeforeRelease: function() {
               onBeforeRelease: function() {
-                dragged = true;
-                expect($('.fc-event.fc-helper .fc-time')).toHaveText('2:30');
+                dragged = true
+                expect($('.fc-event.fc-helper .fc-time')).toHaveText('2:30')
               }
               }
-            });
+            })
           },
           },
           function() {
           function() {
-            expect(dragged).toBe(true);
-            done();
+            expect(dragged).toBe(true)
+            done()
           }
           }
-        );
-      });
-    });
+        )
+      })
+    })
 
 
     describe('when dragging a timed event with an end time', function() {
     describe('when dragging a timed event with an end time', function() {
       it('should continue to show the updated start and end time', function(done) {
       it('should continue to show the updated start and end time', function(done) {
-        var dragged = false;
-        var eventElm;
+        var dragged = false
+        var eventElm
 
 
-        options.scrollTime = '01:00:00';
-        options.height = 400; // short enough to make scrolling happen
+        options.scrollTime = '01:00:00'
+        options.height = 400 // short enough to make scrolling happen
         options.events = [ {
         options.events = [ {
           title: 'timed event',
           title: 'timed event',
           start: '2014-06-11T01:00:00',
           start: '2014-06-11T01:00:00',
           end: '2014-06-11T02:00:00',
           end: '2014-06-11T02:00:00',
           allDay: false
           allDay: false
-        } ];
+        } ]
 
 
         init(
         init(
           function() {
           function() {
             eventElm = $('.fc-event .fc-time').simulate('drag', {
             eventElm = $('.fc-event .fc-time').simulate('drag', {
               dy: $('.fc-slats tr:eq(1)').height() * 2.9, // 1.5 hours
               dy: $('.fc-slats tr:eq(1)').height() * 2.9, // 1.5 hours
               onBeforeRelease: function() {
               onBeforeRelease: function() {
-                dragged = true;
-                expect($('.fc-event.fc-helper .fc-time')).toHaveText('2:30 - 3:30');
+                dragged = true
+                expect($('.fc-event.fc-helper .fc-time')).toHaveText('2:30 - 3:30')
               }
               }
-            });
+            })
           },
           },
           function() {
           function() {
-            expect(dragged).toBe(true);
-            done();
+            expect(dragged).toBe(true)
+            done()
           }
           }
-        );
-      });
-    });
-  });
+        )
+      })
+    })
+  })
 
 
   // Initialize a calendar, run a drag, and do type-checking of all arguments for all handlers.
   // Initialize a calendar, run a drag, and do type-checking of all arguments for all handlers.
   // TODO: more descrimination instead of just checking for 'object'
   // TODO: more descrimination instead of just checking for 'object'
   function init(dragFunc, dropHandler) {
   function init(dragFunc, dropHandler) {
-    var eventsRendered = false;
+    var eventsRendered = false
 
 
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
       if (!eventsRendered) { // because event rerendering will happen upon drop
       if (!eventsRendered) { // because event rerendering will happen upon drop
-        dragFunc();
-        eventsRendered = true;
+        dragFunc()
+        eventsRendered = true
       }
       }
-    };
+    }
     options.eventDragStart = function(event, jsEvent, uiEvent, view) {
     options.eventDragStart = function(event, jsEvent, uiEvent, view) {
-      expect(this instanceof Element).toBe(true);
-      expect(this).toHaveClass('fc-event');
-      expect(typeof event).toBe('object');
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof uiEvent).toBe('object');
-      expect(typeof view).toBe('object');
-    };
+      expect(this instanceof Element).toBe(true)
+      expect(this).toHaveClass('fc-event')
+      expect(typeof event).toBe('object')
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof uiEvent).toBe('object')
+      expect(typeof view).toBe('object')
+    }
     options.eventDragStop = function(event, jsEvent, uiEvent, view) {
     options.eventDragStop = function(event, jsEvent, uiEvent, view) {
-      expect(options.eventDragStart).toHaveBeenCalled();
-
-      expect(this instanceof Element).toBe(true);
-      expect(this).toHaveClass('fc-event');
-      expect(typeof event).toBe('object');
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof uiEvent).toBe('object');
-      expect(typeof view).toBe('object');
-    };
+      expect(options.eventDragStart).toHaveBeenCalled()
+
+      expect(this instanceof Element).toBe(true)
+      expect(this).toHaveClass('fc-event')
+      expect(typeof event).toBe('object')
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof uiEvent).toBe('object')
+      expect(typeof view).toBe('object')
+    }
     options.eventDrop = function(event, delta, revertFunc, jsEvent, uiEvent, view) {
     options.eventDrop = function(event, delta, revertFunc, jsEvent, uiEvent, view) {
-      expect(options.eventDragStop).toHaveBeenCalled();
+      expect(options.eventDragStop).toHaveBeenCalled()
 
 
-      expect(this instanceof Element).toBe(true);
-      expect(this).toHaveClass('fc-event');
-      expect(typeof event).toBe('object');
-      expect(moment.isDuration(delta)).toBe(true);
-      expect(typeof revertFunc).toBe('function');
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof uiEvent).toBe('object');
-      expect(typeof view).toBe('object');
+      expect(this instanceof Element).toBe(true)
+      expect(this).toHaveClass('fc-event')
+      expect(typeof event).toBe('object')
+      expect(moment.isDuration(delta)).toBe(true)
+      expect(typeof revertFunc).toBe('function')
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof uiEvent).toBe('object')
+      expect(typeof view).toBe('object')
 
 
-      dropHandler.apply(this, arguments);
-    };
+      dropHandler.apply(this, arguments)
+    }
 
 
-    spyOn(options, 'eventDragStart').and.callThrough();
-    spyOn(options, 'eventDragStop').and.callThrough();
+    spyOn(options, 'eventDragStart').and.callThrough()
+    spyOn(options, 'eventDragStop').and.callThrough()
 
 
     setTimeout(function() { // hack. agenda view scroll state would get messed up between tests
     setTimeout(function() { // hack. agenda view scroll state would get messed up between tests
-      $('#cal').fullCalendar(options);
-    }, 0);
+      $('#cal').fullCalendar(options)
+    }, 0)
   }
   }
-});
+})

+ 40 - 40
tests/legacy/event-feed-param.js

@@ -1,14 +1,14 @@
 describe('event feed params', function() {
 describe('event feed params', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
 
 
     options = {
     options = {
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       defaultView: 'month'
       defaultView: 'month'
-    };
+    }
 
 
     $.mockjax({
     $.mockjax({
       url: '*',
       url: '*',
@@ -19,35 +19,35 @@ describe('event feed params', function() {
           start: '2014-05-21'
           start: '2014-05-21'
         }
         }
       ]
       ]
-    });
-    $.mockjaxSettings.log = function() { }; // don't console.log
-  });
+    })
+    $.mockjaxSettings.log = function() { } // don't console.log
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    $.mockjax.clear();
-  });
+    $.mockjax.clear()
+  })
 
 
   it('utilizes custom startParam, endParam, and timezoneParam names', function() {
   it('utilizes custom startParam, endParam, and timezoneParam names', function() {
-    options.events = 'my-feed.php';
-    options.timezone = 'America/Los_Angeles';
-    options.startParam = 'mystart';
-    options.endParam = 'myend';
-    options.timezoneParam = 'currtz';
-    $('#cal').fullCalendar(options);
-    var request = $.mockjax.mockedAjaxCalls()[0];
-    expect(request.data.start).toBeUndefined();
-    expect(request.data.end).toBeUndefined();
-    expect(request.data.timezone).toBeUndefined();
-    expect(request.data.mystart).toEqual('2014-04-27');
-    expect(request.data.myend).toEqual('2014-06-08');
-    expect(request.data.currtz).toEqual('America/Los_Angeles');
-  });
+    options.events = 'my-feed.php'
+    options.timezone = 'America/Los_Angeles'
+    options.startParam = 'mystart'
+    options.endParam = 'myend'
+    options.timezoneParam = 'currtz'
+    $('#cal').fullCalendar(options)
+    var request = $.mockjax.mockedAjaxCalls()[0]
+    expect(request.data.start).toBeUndefined()
+    expect(request.data.end).toBeUndefined()
+    expect(request.data.timezone).toBeUndefined()
+    expect(request.data.mystart).toEqual('2014-04-27')
+    expect(request.data.myend).toEqual('2014-06-08')
+    expect(request.data.currtz).toEqual('America/Los_Angeles')
+  })
 
 
   it('utilizes event-source-specific startParam, endParam, and timezoneParam names', function() {
   it('utilizes event-source-specific startParam, endParam, and timezoneParam names', function() {
-    options.timezone = 'America/Los_Angeles';
-    options.startParam = 'mystart';
-    options.endParam = 'myend';
-    options.timezoneParam = 'currtz';
+    options.timezone = 'America/Los_Angeles'
+    options.startParam = 'mystart'
+    options.endParam = 'myend'
+    options.timezoneParam = 'currtz'
     options.eventSources = [
     options.eventSources = [
       {
       {
         url: 'my-feed.php',
         url: 'my-feed.php',
@@ -55,18 +55,18 @@ describe('event feed params', function() {
         endParam: 'feedend',
         endParam: 'feedend',
         timezoneParam: 'feedctz'
         timezoneParam: 'feedctz'
       }
       }
-    ];
-    $('#cal').fullCalendar(options);
-    var request = $.mockjax.mockedAjaxCalls()[0];
-    expect(request.data.start).toBeUndefined();
-    expect(request.data.end).toBeUndefined();
-    expect(request.data.timezone).toBeUndefined();
-    expect(request.data.mystart).toBeUndefined();
-    expect(request.data.myend).toBeUndefined();
-    expect(request.data.currtz).toBeUndefined();
-    expect(request.data.feedstart).toEqual('2014-04-27');
-    expect(request.data.feedend).toEqual('2014-06-08');
-    expect(request.data.feedctz).toEqual('America/Los_Angeles');
-  });
+    ]
+    $('#cal').fullCalendar(options)
+    var request = $.mockjax.mockedAjaxCalls()[0]
+    expect(request.data.start).toBeUndefined()
+    expect(request.data.end).toBeUndefined()
+    expect(request.data.timezone).toBeUndefined()
+    expect(request.data.mystart).toBeUndefined()
+    expect(request.data.myend).toBeUndefined()
+    expect(request.data.currtz).toBeUndefined()
+    expect(request.data.feedstart).toEqual('2014-04-27')
+    expect(request.data.feedend).toEqual('2014-06-08')
+    expect(request.data.feedctz).toEqual('America/Los_Angeles')
+  })
 
 
-});
+})

+ 72 - 72
tests/legacy/event-obj.js

@@ -11,158 +11,158 @@ describe('event object creation', function() {
 
 
   */
   */
 
 
-  var event;
+  var event
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-    event = null;
-  });
+    affix('#cal')
+    event = null
+  })
 
 
   function init(singleEventData) {
   function init(singleEventData) {
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
       events: [ singleEventData ]
       events: [ singleEventData ]
-    });
-    event = $('#cal').fullCalendar('clientEvents')[0];
+    })
+    event = $('#cal').fullCalendar('clientEvents')[0]
   }
   }
 
 
   it('accepts `date` property as alias for `start`', function() {
   it('accepts `date` property as alias for `start`', function() {
     init({
     init({
       date: '2014-05-05'
       date: '2014-05-05'
-    });
-    expect(moment.isMoment(event.start)).toEqual(true);
-    expect(event.start).toEqualMoment('2014-05-05');
-  });
+    })
+    expect(moment.isMoment(event.start)).toEqual(true)
+    expect(event.start).toEqualMoment('2014-05-05')
+  })
 
 
   it('doesn\'t produce an event when an invalid start', function() {
   it('doesn\'t produce an event when an invalid start', function() {
     init({
     init({
       start: new Date('asdf') // we use Date constructor to avoid annoying momentjs warning
       start: new Date('asdf') // we use Date constructor to avoid annoying momentjs warning
-    });
-    expect(event).toBeUndefined();
-  });
+    })
+    expect(event).toBeUndefined()
+  })
 
 
   it('produces null end when given an invalid date', function() {
   it('produces null end when given an invalid date', function() {
     init({
     init({
       start: '2014-05-01',
       start: '2014-05-01',
       end: new Date('asdf') // we use Date constructor to avoid annoying momentjs warning
       end: new Date('asdf') // we use Date constructor to avoid annoying momentjs warning
-    });
-    expect(event.start).toEqualMoment('2014-05-01');
-    expect(event.end).toBe(null);
-  });
+    })
+    expect(event.start).toEqualMoment('2014-05-01')
+    expect(event.end).toBe(null)
+  })
 
 
   it('produces null end when given a timed end before the start', function() {
   it('produces null end when given a timed end before the start', function() {
     init({
     init({
       start: '2014-05-02T00:00:00',
       start: '2014-05-02T00:00:00',
       end: '2014-05-01T23:00:00'
       end: '2014-05-01T23:00:00'
-    });
-    expect(event.start).toEqualMoment('2014-05-02T00:00:00');
-    expect(event.end).toBe(null);
-  });
+    })
+    expect(event.start).toEqualMoment('2014-05-02T00:00:00')
+    expect(event.end).toBe(null)
+  })
 
 
   it('produces null end when given a timed end equal to the start', function() {
   it('produces null end when given a timed end equal to the start', function() {
     init({
     init({
       start: '2014-05-02T00:00:00',
       start: '2014-05-02T00:00:00',
       end: '2014-05-01T00:00:00'
       end: '2014-05-01T00:00:00'
-    });
-    expect(event.start).toEqualMoment('2014-05-02T00:00:00');
-    expect(event.end).toBe(null);
-  });
+    })
+    expect(event.start).toEqualMoment('2014-05-02T00:00:00')
+    expect(event.end).toBe(null)
+  })
 
 
   it('produces null end when given an all-day end before the start', function() {
   it('produces null end when given an all-day end before the start', function() {
     init({
     init({
       start: '2014-05-02',
       start: '2014-05-02',
       end: '2014-05-02'
       end: '2014-05-02'
-    });
-    expect(event.start).toEqualMoment('2014-05-02');
-    expect(event.end).toBe(null);
-  });
+    })
+    expect(event.start).toEqualMoment('2014-05-02')
+    expect(event.end).toBe(null)
+  })
 
 
   it('produces null end when given an all-day end equal to the start', function() {
   it('produces null end when given an all-day end equal to the start', function() {
     init({
     init({
       start: '2014-05-02T00:00:00',
       start: '2014-05-02T00:00:00',
       end: '2014-05-02T00:00:00'
       end: '2014-05-02T00:00:00'
-    });
-    expect(event.start).toEqualMoment('2014-05-02T00:00:00');
-    expect(event.end).toBe(null);
-  });
+    })
+    expect(event.start).toEqualMoment('2014-05-02T00:00:00')
+    expect(event.end).toBe(null)
+  })
 
 
   it('allows ASP dates for start', function() {
   it('allows ASP dates for start', function() {
     init({
     init({
       start: '\/Date(1239018869048)\/',
       start: '\/Date(1239018869048)\/',
       end: '\/Date(1239105269048)\/'
       end: '\/Date(1239105269048)\/'
-    });
-    expect(moment.isMoment(event.start)).toBe(true);
-    expect(+event.start).toBe(1239018869048);
-    expect(moment.isMoment(event.end)).toBe(true);
-    expect(+event.end).toBe(1239105269048);
-  });
+    })
+    expect(moment.isMoment(event.start)).toBe(true)
+    expect(+event.start).toBe(1239018869048)
+    expect(moment.isMoment(event.end)).toBe(true)
+    expect(+event.end).toBe(1239105269048)
+  })
 
 
   it('produces null end when given an invalid ASP date end', function() {
   it('produces null end when given an invalid ASP date end', function() {
     init({
     init({
       start: '\/Date(1239018869048)\/',
       start: '\/Date(1239018869048)\/',
       end: '\/Date(1239018869048)\/' // same as start
       end: '\/Date(1239018869048)\/' // same as start
-    });
-    expect(moment.isMoment(event.start)).toBe(true);
-    expect(+event.start).toBe(1239018869048);
-    expect(event.end).toBe(null);
-  });
+    })
+    expect(moment.isMoment(event.start)).toBe(true)
+    expect(+event.start).toBe(1239018869048)
+    expect(event.end).toBe(null)
+  })
 
 
   it('strips times of dates when event is all-day', function() {
   it('strips times of dates when event is all-day', function() {
     init({
     init({
       start: '2014-05-01T01:00:00-12:00',
       start: '2014-05-01T01:00:00-12:00',
       end: '2014-05-02T01:00:00-12:00',
       end: '2014-05-02T01:00:00-12:00',
       allDay: true
       allDay: true
-    });
-    expect(event.start.hasTime()).toEqual(false);
-    expect(event.start).toEqualMoment('2014-05-01');
-    expect(event.end.hasTime()).toEqual(false);
-    expect(event.end).toEqualMoment('2014-05-02');
-  });
+    })
+    expect(event.start.hasTime()).toEqual(false)
+    expect(event.start).toEqualMoment('2014-05-01')
+    expect(event.end.hasTime()).toEqual(false)
+    expect(event.end).toEqualMoment('2014-05-02')
+  })
 
 
   it('gives 00:00 times to ambiguously-timed dates when event is timed', function() {
   it('gives 00:00 times to ambiguously-timed dates when event is timed', function() {
     init({
     init({
       start: '2014-05-01',
       start: '2014-05-01',
       end: '2014-05-03',
       end: '2014-05-03',
       allDay: false
       allDay: false
-    });
-    expect(event.start.hasTime()).toEqual(true);
-    expect(event.start).toEqualMoment('2014-05-01T00:00:00');
-    expect(event.end.hasTime()).toEqual(true);
-    expect(event.end).toEqualMoment('2014-05-03T00:00:00');
-  });
+    })
+    expect(event.start.hasTime()).toEqual(true)
+    expect(event.start).toEqualMoment('2014-05-01T00:00:00')
+    expect(event.end.hasTime()).toEqual(true)
+    expect(event.end).toEqualMoment('2014-05-03T00:00:00')
+  })
 
 
   it('sets the source', function() {
   it('sets the source', function() {
     init({
     init({
       start: '2014-05-01'
       start: '2014-05-01'
-    });
-    expect(typeof event.source).toEqual('object');
-  });
+    })
+    expect(typeof event.source).toEqual('object')
+  })
 
 
   it('accepts an array `className`', function() {
   it('accepts an array `className`', function() {
     init({
     init({
       start: '2014-05-01',
       start: '2014-05-01',
       className: [ 'class1', 'class2' ]
       className: [ 'class1', 'class2' ]
-    });
-    expect($.isArray(event.className)).toEqual(true);
-    expect(event.className).toEqual([ 'class1', 'class2' ]);
-  });
+    })
+    expect($.isArray(event.className)).toEqual(true)
+    expect(event.className).toEqual([ 'class1', 'class2' ])
+  })
 
 
   it('accepts a string `className`', function() {
   it('accepts a string `className`', function() {
     init({
     init({
       start: '2014-05-01',
       start: '2014-05-01',
       className: 'class1 class2'
       className: 'class1 class2'
-    });
-    expect($.isArray(event.className)).toEqual(true);
-    expect(event.className).toEqual([ 'class1', 'class2' ]);
-  });
+    })
+    expect($.isArray(event.className)).toEqual(true)
+    expect(event.className).toEqual([ 'class1', 'class2' ])
+  })
 
 
   it('copies over custom properties', function() {
   it('copies over custom properties', function() {
     init({
     init({
       start: '2014-05-01',
       start: '2014-05-01',
       prop1: 'prop1val',
       prop1: 'prop1val',
       prop2: [ 'a', 'b' ]
       prop2: [ 'a', 'b' ]
-    });
-    expect(event.prop1).toEqual('prop1val');
-    expect(event.prop2).toEqual([ 'a', 'b' ]);
-  });
+    })
+    expect(event.prop1).toEqual('prop1val')
+    expect(event.prop2).toEqual([ 'a', 'b' ])
+  })
 
 
-});
+})

+ 279 - 279
tests/legacy/event-resize.js

@@ -1,68 +1,68 @@
-describe('eventResize', function() {  
+describe('eventResize', function() {
   pushOptions({
   pushOptions({
     defaultDate: '2014-06-11',
     defaultDate: '2014-06-11',
     editable: true,
     editable: true,
     longPressDelay: 100
     longPressDelay: 100
-  });     
-  
-  describe('when in month view', function() {   
-    pushOptions({defaultView:'month'});     
+  })
+
+  describe('when in month view', function() {
+    pushOptions({defaultView: 'month'})
 
 
     describe('when resizing an all-day event with mouse', function() {
     describe('when resizing an all-day event with mouse', function() {
       it('should have correct arguments with a whole-day delta', function(done) {
       it('should have correct arguments with a whole-day delta', function(done) {
-        var options = {};
+        var options = {}
         options.events = [ {
         options.events = [ {
           title: 'all-day event',
           title: 'all-day event',
           start: '2014-06-11',
           start: '2014-06-11',
           allDay: true
           allDay: true
-        } ];
+        } ]
 
 
         init(
         init(
-          options, 
+          options,
           function() {
           function() {
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dx: $('.fc-day').width() * -2.5, // guarantee 2 days to left
               dx: $('.fc-day').width() * -2.5, // guarantee 2 days to left
               dy: $('.fc-day').height()
               dy: $('.fc-day').height()
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.asDays()).toBe(5);
-            expect(delta.hours()).toBe(0);
-            expect(delta.minutes()).toBe(0);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.asDays()).toBe(5)
+            expect(delta.hours()).toBe(0)
+            expect(delta.minutes()).toBe(0)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-11');
-            expect(event.end).toEqualMoment('2014-06-17');
+            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.end).toEqualMoment('2014-06-17')
 
 
-            revertFunc();
-            event = currentCalendar.clientEvents()[0];
+            revertFunc()
+            event = currentCalendar.clientEvents()[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11');
-            expect(event.end).toBeNull();
+            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.end).toBeNull()
 
 
-            done();
+            done()
           }
           }
-        );
-      });
-    });
+        )
+      })
+    })
 
 
     describe('when resizing an all-day event via touch', function() {
     describe('when resizing an all-day event via touch', function() {
 
 
       // for https://github.com/fullcalendar/fullcalendar/issues/3118
       // for https://github.com/fullcalendar/fullcalendar/issues/3118
       [ true, false ].forEach(function(eventStartEditable) {
       [ true, false ].forEach(function(eventStartEditable) {
-        describe('when eventStartEditable is ' + eventStartEditable, function() {         
-          pushOptions({eventStartEditable:eventStartEditable});
+        describe('when eventStartEditable is ' + eventStartEditable, function() {
+          pushOptions({eventStartEditable: eventStartEditable})
 
 
           it('should have correct arguments with a whole-day delta', function(done) {
           it('should have correct arguments with a whole-day delta', function(done) {
-            var options = {};
-            options.dragRevertDuration = 0; // so that eventDragStop happens immediately after touchend
+            var options = {}
+            options.dragRevertDuration = 0 // so that eventDragStop happens immediately after touchend
             options.events = [ {
             options.events = [ {
               title: 'all-day event',
               title: 'all-day event',
               start: '2014-06-11',
               start: '2014-06-11',
               allDay: true
               allDay: true
-            } ];
+            } ]
 
 
             init(
             init(
               options,
               options,
@@ -75,137 +75,137 @@ describe('eventResize', function() {
                       dx: $('.fc-day').width() * -2.5, // guarantee 2 days to left
                       dx: $('.fc-day').width() * -2.5, // guarantee 2 days to left
                       dy: $('.fc-day').height(),
                       dy: $('.fc-day').height(),
                       isTouch: true
                       isTouch: true
-                    });
+                    })
                   }
                   }
-                });
+                })
               },
               },
               function(event, delta, revertFunc) {
               function(event, delta, revertFunc) {
-                expect(delta.asDays()).toBe(5);
-                expect(delta.hours()).toBe(0);
-                expect(delta.minutes()).toBe(0);
-                expect(delta.seconds()).toBe(0);
-                expect(delta.milliseconds()).toBe(0);
+                expect(delta.asDays()).toBe(5)
+                expect(delta.hours()).toBe(0)
+                expect(delta.minutes()).toBe(0)
+                expect(delta.seconds()).toBe(0)
+                expect(delta.milliseconds()).toBe(0)
 
 
-                expect(event.start).toEqualMoment('2014-06-11');
-                expect(event.end).toEqualMoment('2014-06-17');
+                expect(event.start).toEqualMoment('2014-06-11')
+                expect(event.end).toEqualMoment('2014-06-17')
 
 
-                revertFunc();
-                event = currentCalendar.clientEvents()[0];
+                revertFunc()
+                event = currentCalendar.clientEvents()[0]
 
 
-                expect(event.start).toEqualMoment('2014-06-11');
-                expect(event.end).toBeNull();
+                expect(event.start).toEqualMoment('2014-06-11')
+                expect(event.end).toBeNull()
 
 
-                done();
+                done()
               }
               }
-            );
-          });
-        });
-      });
-    });
+            )
+          })
+        })
+      })
+    })
 
 
     describe('when rendering a timed event', function() {
     describe('when rendering a timed event', function() {
       it('should not have resize capabilities', function(done) {
       it('should not have resize capabilities', function(done) {
-        var options = {};
+        var options = {}
         options.events = [ {
         options.events = [ {
           title: 'timed event',
           title: 'timed event',
           start: '2014-06-11T08:00:00',
           start: '2014-06-11T08:00:00',
           allDay: false
           allDay: false
-        } ];
+        } ]
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-event .fc-resizer').length).toBe(0);
-          done();
-        };
-        initCalendar(options);
-      });
-    });
-  });
-
-  describe('when in agenda view', function() {    
-    pushOptions({defaultView:'agendaWeek'})
-  
+          expect($('.fc-event .fc-resizer').length).toBe(0)
+          done()
+        }
+        initCalendar(options)
+      })
+    })
+  })
+
+  describe('when in agenda view', function() {
+    pushOptions({defaultView: 'agendaWeek'})
+
     describe('when resizing an all-day event', function() {
     describe('when resizing an all-day event', function() {
       it('should have correct arguments with a whole-day delta', function(done) {
       it('should have correct arguments with a whole-day delta', function(done) {
-        var options = {};
+        var options = {}
         options.events = [ {
         options.events = [ {
           title: 'all-day event',
           title: 'all-day event',
           start: '2014-06-11',
           start: '2014-06-11',
           allDay: true
           allDay: true
-        } ];
+        } ]
 
 
         init(
         init(
           options,
           options,
           function() {
           function() {
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dx: $('th.fc-wed').width() * 1.5 // two days
               dx: $('th.fc-wed').width() * 1.5 // two days
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.asDays()).toBe(2);
-            expect(delta.hours()).toBe(0);
-            expect(delta.minutes()).toBe(0);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.asDays()).toBe(2)
+            expect(delta.hours()).toBe(0)
+            expect(delta.minutes()).toBe(0)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-11');
-            expect(event.end).toEqualMoment('2014-06-14');
+            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.end).toEqualMoment('2014-06-14')
 
 
-            revertFunc();
-            event = currentCalendar.clientEvents()[0];
+            revertFunc()
+            event = currentCalendar.clientEvents()[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11');
-            expect(event.end).toBeNull();
+            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.end).toBeNull()
 
 
-            done();
+            done()
           }
           }
-        );
-      });
-    });
+        )
+      })
+    })
 
 
-    describe('when resizing a timed event with an end', function() {      
+    describe('when resizing a timed event with an end', function() {
       pushOptions({
       pushOptions({
-        events:[ {
+        events: [ {
           title: 'timed event event',
           title: 'timed event event',
           start: '2014-06-11T05:00:00',
           start: '2014-06-11T05:00:00',
           end: '2014-06-11T07:00:00',
           end: '2014-06-11T07:00:00',
           allDay: false
           allDay: false
         } ]
         } ]
-      });
-    
+      })
+
       it('should have correct arguments with a timed delta', function(done) {
       it('should have correct arguments with a timed delta', function(done) {
-        var options = {};
-        init(         
+        var options = {}
+        init(
           options,
           options,
           function() {
           function() {
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(0);
-            expect(delta.hours()).toBe(2);
-            expect(delta.minutes()).toBe(30);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(0)
+            expect(delta.hours()).toBe(2)
+            expect(delta.minutes()).toBe(30)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00');
-            expect(event.end).toEqualMoment('2014-06-11T09:30:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
+            expect(event.end).toEqualMoment('2014-06-11T09:30:00')
 
 
-            revertFunc();
-            event = currentCalendar.clientEvents()[0];
+            revertFunc()
+            event = currentCalendar.clientEvents()[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00');
-            expect(event.end).toEqualMoment('2014-06-11T07:00:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
+            expect(event.end).toEqualMoment('2014-06-11T07:00:00')
 
 
-            done();
+            done()
           }
           }
-        );
-      });
+        )
+      })
 
 
       it('should have correct arguments with a timed delta via touch', function(done) {
       it('should have correct arguments with a timed delta via touch', function(done) {
-        var options = {};
-        options.dragRevertDuration = 0; // so that eventDragStop happens immediately after touchend
+        var options = {}
+        options.dragRevertDuration = 0 // so that eventDragStop happens immediately after touchend
         init(
         init(
           options,
           options,
           function() {
           function() {
@@ -217,317 +217,317 @@ describe('eventResize', function() {
                   $('.fc-event .fc-resizer').simulate('drag', {
                   $('.fc-event .fc-resizer').simulate('drag', {
                     dy: $('.fc-slats tr:eq(1)').height() * 4.5, // 5 slots, so 2.5 hours
                     dy: $('.fc-slats tr:eq(1)').height() * 4.5, // 5 slots, so 2.5 hours
                     isTouch: true
                     isTouch: true
-                  });
+                  })
                 }
                 }
-              });
-            }, 0);
+              })
+            }, 0)
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(0);
-            expect(delta.hours()).toBe(2);
-            expect(delta.minutes()).toBe(30);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(0)
+            expect(delta.hours()).toBe(2)
+            expect(delta.minutes()).toBe(30)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00');
-            expect(event.end).toEqualMoment('2014-06-11T09:30:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
+            expect(event.end).toEqualMoment('2014-06-11T09:30:00')
 
 
-            revertFunc();
-            event = currentCalendar.clientEvents()[0];
+            revertFunc()
+            event = currentCalendar.clientEvents()[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00');
-            expect(event.end).toEqualMoment('2014-06-11T07:00:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
+            expect(event.end).toEqualMoment('2014-06-11T07:00:00')
 
 
-            done();
+            done()
           }
           }
-        );
-      });
+        )
+      })
 
 
       // TODO: test RTL
       // TODO: test RTL
       it('should have correct arguments with a timed delta when resized to a different day', function(done) {
       it('should have correct arguments with a timed delta when resized to a different day', function(done) {
-        var options = {};
+        var options = {}
         init(
         init(
           options,
           options,
           function() {
           function() {
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
-              dx: $('.fc-day-header:first').width() * .9, // one day
+              dx: $('.fc-day-header:first').width() * 0.9, // one day
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(1);
-            expect(delta.hours()).toBe(2);
-            expect(delta.minutes()).toBe(30);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(1)
+            expect(delta.hours()).toBe(2)
+            expect(delta.minutes()).toBe(30)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00');
-            expect(event.end).toEqualMoment('2014-06-12T09:30:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
+            expect(event.end).toEqualMoment('2014-06-12T09:30:00')
 
 
-            revertFunc();
-            event = currentCalendar.clientEvents()[0];
+            revertFunc()
+            event = currentCalendar.clientEvents()[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00');
-            expect(event.end).toEqualMoment('2014-06-11T07:00:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
+            expect(event.end).toEqualMoment('2014-06-11T07:00:00')
 
 
-            done();
+            done()
           }
           }
-        );
-      });
+        )
+      })
 
 
       it('should have correct arguments with a timed delta, when timezone is local', function(done) {
       it('should have correct arguments with a timed delta, when timezone is local', function(done) {
-        var options = {};
-        options.timezone = 'local';
+        var options = {}
+        options.timezone = 'local'
         init(
         init(
           options,
           options,
           function() {
           function() {
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(0);
-            expect(delta.hours()).toBe(2);
-            expect(delta.minutes()).toBe(30);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(0)
+            expect(delta.hours()).toBe(2)
+            expect(delta.minutes()).toBe(30)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment(moment('2014-06-11T05:00:00')); // compate to local moment
-            expect(event.end).toEqualMoment(moment('2014-06-11T09:30:00'));
+            expect(event.start).toEqualMoment(moment('2014-06-11T05:00:00')) // compate to local moment
+            expect(event.end).toEqualMoment(moment('2014-06-11T09:30:00'))
 
 
-            revertFunc();
-            event = currentCalendar.clientEvents()[0];
+            revertFunc()
+            event = currentCalendar.clientEvents()[0]
 
 
-            expect(event.start).toEqualMoment(moment('2014-06-11T05:00:00'));
-            expect(event.end).toEqualMoment(moment('2014-06-11T07:00:00'));
+            expect(event.start).toEqualMoment(moment('2014-06-11T05:00:00'))
+            expect(event.end).toEqualMoment(moment('2014-06-11T07:00:00'))
 
 
-            done();
+            done()
           }
           }
-        );
-      });
+        )
+      })
 
 
       it('should have correct arguments with a timed delta, when timezone is UTC', function(done) {
       it('should have correct arguments with a timed delta, when timezone is UTC', function(done) {
-        var options = {};
-        options.timezone = 'UTC';
+        var options = {}
+        options.timezone = 'UTC'
         init(
         init(
           options,
           options,
           function() {
           function() {
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
-            });
+            })
           },
           },
           function(event, delta, revertFunc) {
           function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(0);
-            expect(delta.hours()).toBe(2);
-            expect(delta.minutes()).toBe(30);
-            expect(delta.seconds()).toBe(0);
-            expect(delta.milliseconds()).toBe(0);
+            expect(delta.days()).toBe(0)
+            expect(delta.hours()).toBe(2)
+            expect(delta.minutes()).toBe(30)
+            expect(delta.seconds()).toBe(0)
+            expect(delta.milliseconds()).toBe(0)
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00+00:00');
-            expect(event.end).toEqualMoment('2014-06-11T09:30:00+00:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00+00:00')
+            expect(event.end).toEqualMoment('2014-06-11T09:30:00+00:00')
 
 
-            revertFunc();
-            event = currentCalendar.clientEvents()[0];
+            revertFunc()
+            event = currentCalendar.clientEvents()[0]
 
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00+00:00');
-            expect(event.end).toEqualMoment('2014-06-11T07:00:00+00:00');
+            expect(event.start).toEqualMoment('2014-06-11T05:00:00+00:00')
+            expect(event.end).toEqualMoment('2014-06-11T07:00:00+00:00')
 
 
-            done();
+            done()
           }
           }
-        );
-      });
+        )
+      })
 
 
       it('should display the correct time text while resizing', function(done) {
       it('should display the correct time text while resizing', function(done) {
-        var options = {};
+        var options = {}
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
           setTimeout(function() {
           setTimeout(function() {
-            var dy = $('.fc-slats tr:eq(1)').height() * 5; // 5 slots, so 2.5 hours
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            var dy = $('.fc-slats tr:eq(1)').height() * 5 // 5 slots, so 2.5 hours
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dy: dy,
               dy: dy,
               onBeforeRelease: function() {
               onBeforeRelease: function() {
-                expect($('.fc-event.fc-helper .fc-time')).toHaveText('5:00 - 9:30');
+                expect($('.fc-event.fc-helper .fc-time')).toHaveText('5:00 - 9:30')
                 $('.fc-event.fc-helper .fc-resizer').simulate('drag', {
                 $('.fc-event.fc-helper .fc-resizer').simulate('drag', {
                   dy: -dy,
                   dy: -dy,
                   onBeforeRelease: function() {
                   onBeforeRelease: function() {
-                    expect($('.fc-event.fc-helper')).not.toExist();
-                    expect($('.fc-event')).toBeVisible();
-                    expect($('.fc-event .fc-time')).toHaveText('5:00 - 7:00');
+                    expect($('.fc-event.fc-helper')).not.toExist()
+                    expect($('.fc-event')).toBeVisible()
+                    expect($('.fc-event .fc-time')).toHaveText('5:00 - 7:00')
                   },
                   },
                   onRelease: function() {
                   onRelease: function() {
-                    done();
+                    done()
                   }
                   }
-                });
+                })
               }
               }
-            });
-          }, 0); // idk
-        };
+            })
+          }, 0) // idk
+        }
 
 
-        initCalendar(options);
-      });
+        initCalendar(options)
+      })
 
 
       it('should run the temporarily rendered event through eventRender', function(done) {
       it('should run the temporarily rendered event through eventRender', function(done) {
-        var options = {};
+        var options = {}
         options.eventRender = function(event, element) {
         options.eventRender = function(event, element) {
-          element.addClass('didEventRender');
-        };
+          element.addClass('didEventRender')
+        }
 
 
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
           setTimeout(function() {
           setTimeout(function() {
-            var dy = $('.fc-slats tr:eq(1)').height() * 5; // 5 slots, so 2.5 hours
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            var dy = $('.fc-slats tr:eq(1)').height() * 5 // 5 slots, so 2.5 hours
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dy: dy,
               dy: dy,
               onBeforeRelease: function() {
               onBeforeRelease: function() {
-                expect($('.fc-event.fc-helper')).toHaveClass('didEventRender');
+                expect($('.fc-event.fc-helper')).toHaveClass('didEventRender')
                 $('.fc-event.fc-helper .fc-resizer').simulate('drag', {
                 $('.fc-event.fc-helper .fc-resizer').simulate('drag', {
                   dy: -dy,
                   dy: -dy,
                   onBeforeRelease: function() {
                   onBeforeRelease: function() {
-                    expect($('.fc-event.fc-helper')).not.toExist();
+                    expect($('.fc-event.fc-helper')).not.toExist()
                   },
                   },
                   onRelease: function() {
                   onRelease: function() {
-                    done();
+                    done()
                   }
                   }
-                });
+                })
               }
               }
-            });
-          }, 0); // idk
-        };
+            })
+          }, 0) // idk
+        }
 
 
-        initCalendar(options);
-      });
+        initCalendar(options)
+      })
 
 
       it('should not fire the windowResize handler', function(done) { // bug 1116
       it('should not fire the windowResize handler', function(done) { // bug 1116
 
 
         // has to do this crap because PhantomJS was trigger false window resizes unrelated to the fc-event resize
         // has to do this crap because PhantomJS was trigger false window resizes unrelated to the fc-event resize
-        var alreadyRendered = false;
-        var isDragging = false;
-        var calledWhileDragging = false;
-        var options = {};
-        options.windowResizeDelay = 0;
+        var alreadyRendered = false
+        var isDragging = false
+        var calledWhileDragging = false
+        var options = {}
+        options.windowResizeDelay = 0
         options.windowResize = function(ev) {
         options.windowResize = function(ev) {
           if (isDragging) {
           if (isDragging) {
-            calledWhileDragging = true;
+            calledWhileDragging = true
           }
           }
-        };
+        }
 
 
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
           if (alreadyRendered) {
           if (alreadyRendered) {
-            return;
+            return
           }
           }
-          alreadyRendered = true;
+          alreadyRendered = true
           setTimeout(function() {
           setTimeout(function() {
-            isDragging = true;
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            isDragging = true
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dy: 100,
               dy: 100,
               onBeforeRelease: function() {
               onBeforeRelease: function() {
-                isDragging = false;
+                isDragging = false
               },
               },
               onRelease: function() {
               onRelease: function() {
-                expect(calledWhileDragging).toBe(false);
-                done();
+                expect(calledWhileDragging).toBe(false)
+                done()
               }
               }
-            });
-          }, 100); // hack for PhantomJS. after any initial false window resizes
-        };
+            })
+          }, 100) // hack for PhantomJS. after any initial false window resizes
+        }
 
 
-        initCalendar(options);
-      });
-    });
+        initCalendar(options)
+      })
+    })
 
 
-    describe('when resizing a timed event without an end', function() {     
+    describe('when resizing a timed event without an end', function() {
       pushOptions({
       pushOptions({
-        events:[ {
+        events: [ {
           title: 'timed event event',
           title: 'timed event event',
           start: '2014-06-11T05:00:00',
           start: '2014-06-11T05:00:00',
           allDay: false
           allDay: false
         } ]
         } ]
       })
       })
-  
+
       it('should display the correct time text while resizing', function(done) {
       it('should display the correct time text while resizing', function(done) {
-        var options = {};
+        var options = {}
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
           setTimeout(function() {
           setTimeout(function() {
-            var dy = $('.fc-slats tr:eq(1)').height() * 5; // 5 slots, so 2.5 hours
-            $('.fc-event').simulate('mouseover'); // for revealing resizer
+            var dy = $('.fc-slats tr:eq(1)').height() * 5 // 5 slots, so 2.5 hours
+            $('.fc-event').simulate('mouseover') // for revealing resizer
             $('.fc-event .fc-resizer').simulate('drag', {
             $('.fc-event .fc-resizer').simulate('drag', {
               dy: dy,
               dy: dy,
               onBeforeRelease: function() {
               onBeforeRelease: function() {
-                expect($('.fc-event.fc-helper .fc-time')).toHaveText('5:00 - 9:30');
+                expect($('.fc-event.fc-helper .fc-time')).toHaveText('5:00 - 9:30')
                 $('.fc-event.fc-helper .fc-resizer').simulate('drag', {
                 $('.fc-event.fc-helper .fc-resizer').simulate('drag', {
                   dy: -dy,
                   dy: -dy,
                   onBeforeRelease: function() {
                   onBeforeRelease: function() {
-                    expect($('.fc-event.fc-helper')).not.toExist();
-                    expect($('.fc-event')).toBeVisible();
-                    expect($('.fc-event .fc-time')).toHaveText('5:00');
+                    expect($('.fc-event.fc-helper')).not.toExist()
+                    expect($('.fc-event')).toBeVisible()
+                    expect($('.fc-event .fc-time')).toHaveText('5:00')
                   },
                   },
                   onRelease: function() {
                   onRelease: function() {
-                    done();
+                    done()
                   }
                   }
-                });
+                })
               }
               }
-            });
-          }, 0); // idk
-        };
+            })
+          }, 0) // idk
+        }
 
 
-        initCalendar(options);
-      });
-    });
-  });
+        initCalendar(options)
+      })
+    })
+  })
 
 
   // Initialize a calendar, run a resize, and do type-checking of all arguments for all handlers.
   // Initialize a calendar, run a resize, and do type-checking of all arguments for all handlers.
   // TODO: more descrimination instead of just checking for 'object'
   // TODO: more descrimination instead of just checking for 'object'
   function init(options, resizeStartFunc, resizeDoneFunc) {
   function init(options, resizeStartFunc, resizeDoneFunc) {
-    var eventsRendered = false;
+    var eventsRendered = false
 
 
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
       if (!eventsRendered) { // because event rerendering will happen when resize is over
       if (!eventsRendered) { // because event rerendering will happen when resize is over
-        resizeStartFunc();
-        eventsRendered = true;
+        resizeStartFunc()
+        eventsRendered = true
       }
       }
-    };
+    }
     options.eventResizeStart = function(event, jsEvent, uiEvent, view) {
     options.eventResizeStart = function(event, jsEvent, uiEvent, view) {
-      expect(this instanceof Element).toBe(true);
-      expect(this).toHaveClass('fc-event');
-      expect(typeof event).toBe('object');
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof uiEvent).toBe('object');
-      expect(typeof view).toBe('object');
-    };
+      expect(this instanceof Element).toBe(true)
+      expect(this).toHaveClass('fc-event')
+      expect(typeof event).toBe('object')
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof uiEvent).toBe('object')
+      expect(typeof view).toBe('object')
+    }
     options.eventResizeStop = function(event, jsEvent, uiEvent, view) {
     options.eventResizeStop = function(event, jsEvent, uiEvent, view) {
-      expect(options.eventResizeStart).toHaveBeenCalled();
-
-      expect(this instanceof Element).toBe(true);
-      expect(this).toHaveClass('fc-event');
-      expect(typeof event).toBe('object');
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof uiEvent).toBe('object');
-      expect(typeof view).toBe('object');
-    };
+      expect(options.eventResizeStart).toHaveBeenCalled()
+
+      expect(this instanceof Element).toBe(true)
+      expect(this).toHaveClass('fc-event')
+      expect(typeof event).toBe('object')
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof uiEvent).toBe('object')
+      expect(typeof view).toBe('object')
+    }
     options.eventResize = function(event, delta, revertFunc, jsEvent, uiEvent, view) {
     options.eventResize = function(event, delta, revertFunc, jsEvent, uiEvent, view) {
-      expect(options.eventResizeStop).toHaveBeenCalled();
+      expect(options.eventResizeStop).toHaveBeenCalled()
 
 
-      expect(this instanceof Element).toBe(true);
-      expect(this).toHaveClass('fc-event');
-      expect(typeof event).toBe('object');
-      expect(moment.isDuration(delta)).toBe(true);
-      expect(typeof revertFunc).toBe('function');
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof uiEvent).toBe('object'); // might be a non-jqui dummy object
-      expect(typeof view).toBe('object');
+      expect(this instanceof Element).toBe(true)
+      expect(this).toHaveClass('fc-event')
+      expect(typeof event).toBe('object')
+      expect(moment.isDuration(delta)).toBe(true)
+      expect(typeof revertFunc).toBe('function')
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof uiEvent).toBe('object') // might be a non-jqui dummy object
+      expect(typeof view).toBe('object')
 
 
-      resizeDoneFunc.apply(this, arguments);
-    };
+      resizeDoneFunc.apply(this, arguments)
+    }
 
 
-    spyOn(options, 'eventResizeStart').and.callThrough();
-    spyOn(options, 'eventResizeStop').and.callThrough();
+    spyOn(options, 'eventResizeStart').and.callThrough()
+    spyOn(options, 'eventResizeStop').and.callThrough()
 
 
     setTimeout(function() { // hack. agenda view scroll state would get messed up between tests
     setTimeout(function() { // hack. agenda view scroll state would get messed up between tests
-      initCalendar(options);
-    }, 0);
+      initCalendar(options)
+    }, 0)
   }
   }
-});
+})

+ 29 - 29
tests/legacy/eventAllow.js

@@ -1,7 +1,7 @@
-import { dragTimeGridEvent } from '../lib/time-grid';
+import { dragTimeGridEvent } from '../lib/time-grid'
 
 
 describe('eventAllow', function() {
 describe('eventAllow', function() {
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
     options = {
     options = {
@@ -15,44 +15,44 @@ describe('eventAllow', function() {
           start: '2016-09-04T01:00'
           start: '2016-09-04T01:00'
         }
         }
       ]
       ]
-    };
-    affix('#cal');
-  });
+    }
+    affix('#cal')
+  })
 
 
   it('disallows dragging when returning false', function(done) { // and given correct params
   it('disallows dragging when returning false', function(done) { // and given correct params
     options.eventAllow = function(dropInfo, event) {
     options.eventAllow = function(dropInfo, event) {
-      expect(typeof dropInfo).toBe('object');
-      expect(moment.isMoment(dropInfo.start)).toBe(true);
-      expect(moment.isMoment(dropInfo.end)).toBe(true);
-      expect(typeof event).toBe('object');
-      expect(event.title).toBe('event 1');
-      return false;
-    };
-    spyOn(options, 'eventAllow').and.callThrough();
+      expect(typeof dropInfo).toBe('object')
+      expect(moment.isMoment(dropInfo.start)).toBe(true)
+      expect(moment.isMoment(dropInfo.end)).toBe(true)
+      expect(typeof event).toBe('object')
+      expect(event.title).toBe('event 1')
+      return false
+    }
+    spyOn(options, 'eventAllow').and.callThrough()
 
 
-    $('#cal').fullCalendar(options);
+    $('#cal').fullCalendar(options)
 
 
     dragTimeGridEvent($('.fc-event'), '2016-09-04T03:00:00')
     dragTimeGridEvent($('.fc-event'), '2016-09-04T03:00:00')
       .then(function(modifiedEvent) {
       .then(function(modifiedEvent) {
-        expect(modifiedEvent).toBeFalsy(); // drop failure?
-        expect(options.eventAllow).toHaveBeenCalled();
-        done();
-      });
-  });
+        expect(modifiedEvent).toBeFalsy() // drop failure?
+        expect(options.eventAllow).toHaveBeenCalled()
+        done()
+      })
+  })
 
 
   it('allows dragging when returning true', function(done) {
   it('allows dragging when returning true', function(done) {
     options.eventAllow = function(dropInfo, event) {
     options.eventAllow = function(dropInfo, event) {
-      return true;
-    };
-    spyOn(options, 'eventAllow').and.callThrough();
+      return true
+    }
+    spyOn(options, 'eventAllow').and.callThrough()
 
 
-    $('#cal').fullCalendar(options);
+    $('#cal').fullCalendar(options)
 
 
     dragTimeGridEvent($('.fc-event'), '2016-09-04T03:00:00')
     dragTimeGridEvent($('.fc-event'), '2016-09-04T03:00:00')
       .then(function(modifiedEvent) {
       .then(function(modifiedEvent) {
-        expect(modifiedEvent.start.format()).toBe('2016-09-04T03:00:00');
-        expect(options.eventAllow).toHaveBeenCalled();
-        done();
-      });
-  });
-});
+        expect(modifiedEvent.start.format()).toBe('2016-09-04T03:00:00')
+        expect(options.eventAllow).toHaveBeenCalled()
+        done()
+      })
+  })
+})

+ 20 - 20
tests/legacy/eventClick.js

@@ -1,36 +1,36 @@
 
 
-describe('eventClick', function() { 
-  
+describe('eventClick', function() {
+
   pushOptions({
   pushOptions({
     defaultDate: '2014-08-01'
     defaultDate: '2014-08-01'
-  });
+  })
 
 
   it('works in month view', function(done) {
   it('works in month view', function(done) {
-    var options = {};
+    var options = {}
     options.events = [
     options.events = [
       { start: '2014-08-01', title: 'event1', className: 'event1' }
       { start: '2014-08-01', title: 'event1', className: 'event1' }
-    ];
+    ]
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      $('.event1').simulate('click');
-    };
+      $('.event1').simulate('click')
+    }
     options.eventClick = function() {
     options.eventClick = function() {
-      done();
-    };
-    initCalendar(options);
-  });
+      done()
+    }
+    initCalendar(options)
+  })
 
 
   it('works in month view via touch', function(done) {
   it('works in month view via touch', function(done) {
-    var options = {};
+    var options = {}
     options.events = [
     options.events = [
       { start: '2014-08-01', title: 'event1', className: 'event1' }
       { start: '2014-08-01', title: 'event1', className: 'event1' }
-    ];
+    ]
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      $.simulateTouchClick($('.event1'));
-    };
+      $.simulateTouchClick($('.event1'))
+    }
     options.eventClick = function() {
     options.eventClick = function() {
-      done();
-    };
-    initCalendar(options);
-  });
+      done()
+    }
+    initCalendar(options)
+  })
 
 
-});
+})

+ 16 - 16
tests/legacy/eventDestroy.js

@@ -2,55 +2,55 @@ describe('eventDestroy', function() {
 
 
   pushOptions({
   pushOptions({
     defaultDate: '2014-08-01'
     defaultDate: '2014-08-01'
-  });
+  })
 
 
   function testSingleEvent(singleEventData, done) {
   function testSingleEvent(singleEventData, done) {
-    var callCnt = 0;
+    var callCnt = 0
 
 
-    expect(singleEventData.id).toBeTruthy();
+    expect(singleEventData.id).toBeTruthy()
 
 
     initCalendar({
     initCalendar({
       events: [ singleEventData ],
       events: [ singleEventData ],
       eventDestroy: function(event, element) {
       eventDestroy: function(event, element) {
         if (callCnt++ === 0) { // only care about the first call. gets called again when calendar is destroyed
         if (callCnt++ === 0) { // only care about the first call. gets called again when calendar is destroyed
-          expect(event.id).toBe(singleEventData.id);
-          done();
+          expect(event.id).toBe(singleEventData.id)
+          done()
         }
         }
       }
       }
-    });
+    })
 
 
-    currentCalendar.removeEvents(singleEventData.id);
+    currentCalendar.removeEvents(singleEventData.id)
   }
   }
 
 
   describe('when in month view', function() { // for issue 2017
   describe('when in month view', function() { // for issue 2017
 
 
     pushOptions({
     pushOptions({
       defaultView: 'month'
       defaultView: 'month'
-    });
+    })
 
 
     it('gets called with removeEvents method', function(done) {
     it('gets called with removeEvents method', function(done) {
       testSingleEvent({
       testSingleEvent({
         id: 1,
         id: 1,
         title: 'event1',
         title: 'event1',
         date: '2014-08-02'
         date: '2014-08-02'
-      }, done);
-    });
-  });
+      }, done)
+    })
+  })
 
 
   describe('when in agendaWeek view', function() { // for issue 2017
   describe('when in agendaWeek view', function() { // for issue 2017
 
 
     pushOptions({
     pushOptions({
       defaultView: 'agendaWeek',
       defaultView: 'agendaWeek',
       scrollTime: '00:00:00'
       scrollTime: '00:00:00'
-    });
+    })
 
 
     it('gets called with removeEvents method', function(done) {
     it('gets called with removeEvents method', function(done) {
       testSingleEvent({
       testSingleEvent({
         id: 1,
         id: 1,
         title: 'event1',
         title: 'event1',
         date: '2014-08-02T02:00:00'
         date: '2014-08-02T02:00:00'
-      }, done);
-    });
-  });
+      }, done)
+    })
+  })
 
 
-});
+})

+ 164 - 164
tests/legacy/eventLimit-popover.js

@@ -1,10 +1,10 @@
 
 
 describe('eventLimit popover', function() {
 describe('eventLimit popover', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultView: 'month',
       defaultView: 'month',
       defaultDate: '2014-08-01',
       defaultDate: '2014-08-01',
@@ -18,12 +18,12 @@ describe('eventLimit popover', function() {
       dragScroll: false, // don't do autoscrolling while dragging. close quarters in PhantomJS
       dragScroll: false, // don't do autoscrolling while dragging. close quarters in PhantomJS
       popoverViewportConstrain: false, // because PhantomJS window is small, don't do smart repositioning
       popoverViewportConstrain: false, // because PhantomJS window is small, don't do smart repositioning
       handleWindowResize: false // because showing the popover causes scrollbars and fires resize
       handleWindowResize: false // because showing the popover causes scrollbars and fires resize
-    };
-  });
+    }
+  })
 
 
   function init() {
   function init() {
-    $('#cal').fullCalendar(options);
-    $('.fc-more').simulate('click');
+    $('#cal').fullCalendar(options)
+    $('.fc-more').simulate('click')
   }
   }
 
 
   [ 'month', 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
   [ 'month', 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
@@ -31,54 +31,54 @@ describe('eventLimit popover', function() {
     describe('when in ' + viewName + ' view', function() {
     describe('when in ' + viewName + ' view', function() {
 
 
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = viewName;
-      });
+        options.defaultView = viewName
+      })
 
 
       it('aligns horizontally with left edge of cell if LTR', function() {
       it('aligns horizontally with left edge of cell if LTR', function() {
-        options.isRTL = false;
-        init();
-        var cellLeft = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(2)').offset().left;
-        var popoverLeft = $('.fc-more-popover').offset().left;
-        var diff = Math.abs(cellLeft - popoverLeft);
-        expect(diff).toBeLessThan(2);
-      });
+        options.isRTL = false
+        init()
+        var cellLeft = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(2)').offset().left
+        var popoverLeft = $('.fc-more-popover').offset().left
+        var diff = Math.abs(cellLeft - popoverLeft)
+        expect(diff).toBeLessThan(2)
+      })
 
 
       it('aligns horizontally with left edge of cell if RTL', function() {
       it('aligns horizontally with left edge of cell if RTL', function() {
-        options.isRTL = true;
-        init();
-        var cell = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(4)');
-        var cellRight = cell.offset().left + cell.outerWidth();
-        var popover = $('.fc-more-popover');
-        var popoverRight = popover.offset().left + popover.outerWidth();
-        var diff = Math.abs(cellRight - popoverRight);
-        expect(diff).toBeLessThan(2);
-      });
-    });
-  });
+        options.isRTL = true
+        init()
+        var cell = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(4)')
+        var cellRight = cell.offset().left + cell.outerWidth()
+        var popover = $('.fc-more-popover')
+        var popoverRight = popover.offset().left + popover.outerWidth()
+        var diff = Math.abs(cellRight - popoverRight)
+        expect(diff).toBeLessThan(2)
+      })
+    })
+  })
 
 
   describe('when in month view', function() {
   describe('when in month view', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.defaultView = 'month';
-    });
+      options.defaultView = 'month'
+    })
 
 
     it('aligns with top of cell', function() {
     it('aligns with top of cell', function() {
-      init();
-      var popoverTop = $('.fc-more-popover').offset().top;
-      var rowTop = $('.fc-day-grid .fc-row:eq(0)').offset().top;
-      var diff = Math.abs(popoverTop - rowTop);
-      expect(diff).toBeLessThan(2);
-    });
+      init()
+      var popoverTop = $('.fc-more-popover').offset().top
+      var rowTop = $('.fc-day-grid .fc-row:eq(0)').offset().top
+      var diff = Math.abs(popoverTop - rowTop)
+      expect(diff).toBeLessThan(2)
+    })
 
 
     it('works with background events', function() {
     it('works with background events', function() {
       options.events.push({
       options.events.push({
         start: '2014-07-29',
         start: '2014-07-29',
         rendering: 'background'
         rendering: 'background'
-      });
-      init();
-      expect($('.fc-more-popover .fc-event').length).toBeGreaterThan(1);
-      expect($('.fc-more-popover .fc-bgevent').length).toBe(0);
-    });
+      })
+      init()
+      expect($('.fc-more-popover .fc-event').length).toBeGreaterThan(1)
+      expect($('.fc-more-popover .fc-bgevent').length).toBe(0)
+    })
 
 
     it('works with events that have invalid end times', function() {
     it('works with events that have invalid end times', function() {
       options.events = [
       options.events = [
@@ -86,15 +86,15 @@ describe('eventLimit popover', function() {
         { title: 'event2', start: '2014-07-29', end: '2014-07-28' },
         { title: 'event2', start: '2014-07-29', end: '2014-07-28' },
         { title: 'event3', start: '2014-07-29T00:00:00', end: '2014-07-29T00:00:00' },
         { title: 'event3', start: '2014-07-29T00:00:00', end: '2014-07-29T00:00:00' },
         { title: 'event4', start: '2014-07-29T00:00:00', end: '2014-07-28T23:00:00' }
         { title: 'event4', start: '2014-07-29T00:00:00', end: '2014-07-28T23:00:00' }
-      ];
-      init();
-      expect($('.fc-more-popover .fc-event').length).toBe(4);
-    });
+      ]
+      init()
+      expect($('.fc-more-popover .fc-event').length).toBe(4)
+    })
 
 
     // issue 2385
     // issue 2385
     it('orders events correctly regardless of ID', function() {
     it('orders events correctly regardless of ID', function() {
-      options.defaultDate = '2012-03-22';
-      options.eventLimit = 3;
+      options.defaultDate = '2012-03-22'
+      options.eventLimit = 3
       options.events = [
       options.events = [
         {
         {
           id: '39957',
           id: '39957',
@@ -145,21 +145,21 @@ describe('eventLimit popover', function() {
           end: '2012-03-22T17:00:00',
           end: '2012-03-22T17:00:00',
           allDay: false
           allDay: false
         }
         }
-      ];
-      init();
+      ]
+      init()
 
 
       var titles = $('.fc-more-popover .fc-event .fc-title').map(function() {
       var titles = $('.fc-more-popover .fc-event .fc-title').map(function() {
-        return $(this).text();
-      }).get();
+        return $(this).text()
+      }).get()
 
 
       expect(titles).toEqual([
       expect(titles).toEqual([
         'event01', 'event05', 'event07', 'event03', 'event02', 'event08', 'event04'
         'event01', 'event05', 'event07', 'event03', 'event02', 'event08', 'event04'
-      ]);
-    });
+      ])
+    })
 
 
     // https://github.com/fullcalendar/fullcalendar/issues/3856
     // https://github.com/fullcalendar/fullcalendar/issues/3856
     it('displays multi-day events only once', function() {
     it('displays multi-day events only once', function() {
-      options.defaultDate = '2017-10-04';
+      options.defaultDate = '2017-10-04'
       options.events = [
       options.events = [
         {
         {
           title: 'Long event',
           title: 'Long event',
@@ -185,15 +185,15 @@ describe('eventLimit popover', function() {
         }
         }
       ]
       ]
 
 
-      init();
+      init()
 
 
-      expect($('.fc-popover .fc-event').length).toBe(4);
+      expect($('.fc-popover .fc-event').length).toBe(4)
 
 
-      var longEventEl = $('.fc-popover .long-event');
-      expect(longEventEl.length).toBe(1);
-      expect(longEventEl).toHaveClass('fc-not-start');
-      expect(longEventEl).toHaveClass('fc-not-end');
-      expect(longEventEl).not.toHaveClass('fc-start');
+      var longEventEl = $('.fc-popover .long-event')
+      expect(longEventEl.length).toBe(1)
+      expect(longEventEl).toHaveClass('fc-not-start')
+      expect(longEventEl).toHaveClass('fc-not-end')
+      expect(longEventEl).not.toHaveClass('fc-start')
       expect(longEventEl).not.toHaveClass('fc-end');
       expect(longEventEl).not.toHaveClass('fc-end');
 
 
       [
       [
@@ -201,13 +201,13 @@ describe('eventLimit popover', function() {
         $('.fc-popover .lunch1-event'),
         $('.fc-popover .lunch1-event'),
         $('.fc-popover .lunch2-event')
         $('.fc-popover .lunch2-event')
       ].forEach(function(el) {
       ].forEach(function(el) {
-        expect(el.length).toBe(1);
-        expect(el).toHaveClass('fc-start');
-        expect(el).toHaveClass('fc-end');
-        expect(el).not.toHaveClass('fc-not-start');
-        expect(el).not.toHaveClass('fc-not-end');
-      });
-    });
+        expect(el.length).toBe(1)
+        expect(el).toHaveClass('fc-start')
+        expect(el).toHaveClass('fc-end')
+        expect(el).not.toHaveClass('fc-not-start')
+        expect(el).not.toHaveClass('fc-not-end')
+      })
+    })
   });
   });
 
 
   [ 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
   [ 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
@@ -215,77 +215,77 @@ describe('eventLimit popover', function() {
     describe('when in ' + viewName + ' view', function() {
     describe('when in ' + viewName + ' view', function() {
 
 
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = viewName;
-      });
+        options.defaultView = viewName
+      })
 
 
       it('aligns with top of header', function() {
       it('aligns with top of header', function() {
-        init();
-        var popoverTop = $('.fc-more-popover').offset().top;
-        var headTop = $('.fc-view > table > thead .fc-row').offset().top;
-        var diff = Math.abs(popoverTop - headTop);
-        expect(diff).toBeLessThan(2);
-      });
-    });
-  });
+        init()
+        var popoverTop = $('.fc-more-popover').offset().top
+        var headTop = $('.fc-view > table > thead .fc-row').offset().top
+        var diff = Math.abs(popoverTop - headTop)
+        expect(diff).toBeLessThan(2)
+      })
+    })
+  })
 
 
   // TODO: somehow test how the popover does to the edge of any scroll container
   // TODO: somehow test how the popover does to the edge of any scroll container
 
 
   it('closes when user clicks the X', function() {
   it('closes when user clicks the X', function() {
-    init();
-    expect($('.fc-more-popover')).toBeVisible();
+    init()
+    expect($('.fc-more-popover')).toBeVisible()
     $('.fc-more-popover .fc-close')
     $('.fc-more-popover .fc-close')
-      .simulate('click');
-    expect($('.fc-more-popover')).not.toBeVisible();
-  });
+      .simulate('click')
+    expect($('.fc-more-popover')).not.toBeVisible()
+  })
 
 
   it('doesn\'t close when user clicks somewhere inside of the popover', function() {
   it('doesn\'t close when user clicks somewhere inside of the popover', function() {
-    init();
-    expect($('.fc-more-popover')).toBeVisible();
-    expect($('.fc-more-popover .fc-header')).toBeInDOM();
-    $('.fc-more-popover .fc-header').simulate('mousedown').simulate('click');
-    expect($('.fc-more-popover')).toBeVisible();
-  });
+    init()
+    expect($('.fc-more-popover')).toBeVisible()
+    expect($('.fc-more-popover .fc-header')).toBeInDOM()
+    $('.fc-more-popover .fc-header').simulate('mousedown').simulate('click')
+    expect($('.fc-more-popover')).toBeVisible()
+  })
 
 
   it('closes when user clicks outside of the popover', function() {
   it('closes when user clicks outside of the popover', function() {
-    init();
-    expect($('.fc-more-popover')).toBeVisible();
-    $('body').simulate('mousedown').simulate('click');
-    expect($('.fc-more-popover')).not.toBeVisible();
-  });
+    init()
+    expect($('.fc-more-popover')).toBeVisible()
+    $('body').simulate('mousedown').simulate('click')
+    expect($('.fc-more-popover')).not.toBeVisible()
+  })
 
 
   it('has the correct event contents', function() {
   it('has the correct event contents', function() {
-    init();
-    expect($('.fc-more-popover .event1')).toBeMatchedBy('.fc-not-start.fc-end');
-    expect($('.fc-more-popover .event2')).toBeMatchedBy('.fc-start.fc-not-end');
-    expect($('.fc-more-popover .event3')).toBeMatchedBy('.fc-start.fc-end');
-    expect($('.fc-more-popover .event4')).toBeMatchedBy('.fc-start.fc-end');
-  });
+    init()
+    expect($('.fc-more-popover .event1')).toBeMatchedBy('.fc-not-start.fc-end')
+    expect($('.fc-more-popover .event2')).toBeMatchedBy('.fc-start.fc-not-end')
+    expect($('.fc-more-popover .event3')).toBeMatchedBy('.fc-start.fc-end')
+    expect($('.fc-more-popover .event4')).toBeMatchedBy('.fc-start.fc-end')
+  })
 
 
 
 
   describe('when dragging events out', function() {
   describe('when dragging events out', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.editable = true;
-    });
+      options.editable = true
+    })
 
 
     describe('when dragging an all-day event to a different day', function() {
     describe('when dragging an all-day event to a different day', function() {
 
 
       it('should have the new day and remain all-day', function(done) {
       it('should have the new day and remain all-day', function(done) {
 
 
         options.eventDrop = function(event) {
         options.eventDrop = function(event) {
-          expect(event.start).toEqualMoment('2014-07-28');
-          expect(event.allDay).toBe(true);
-          done();
-        };
-        init();
+          expect(event.start).toEqualMoment('2014-07-28')
+          expect(event.allDay).toBe(true)
+          done()
+        }
+        init()
 
 
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
           $('.fc-more-popover .event4').simulate('drag', {
           $('.fc-more-popover .event4').simulate('drag', {
             end: $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(1)') // one day before
             end: $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(1)') // one day before
-          });
-        }, 0);
-      });
-    });
+          })
+        }, 0)
+      })
+    })
 
 
     describe('when dragging a timed event to a whole day', function() {
     describe('when dragging a timed event to a whole day', function() {
 
 
@@ -295,34 +295,34 @@ describe('eventLimit popover', function() {
           title: 'event5',
           title: 'event5',
           start: '2014-07-29T13:00:00',
           start: '2014-07-29T13:00:00',
           className: 'event5'
           className: 'event5'
-        });
+        })
         options.eventDrop = function(event) {
         options.eventDrop = function(event) {
-          expect(event.start).toEqualMoment('2014-07-28T13:00:00');
-          expect(event.allDay).toBe(false);
-          done();
-        };
-        init();
+          expect(event.start).toEqualMoment('2014-07-28T13:00:00')
+          expect(event.allDay).toBe(false)
+          done()
+        }
+        init()
 
 
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
           $('.fc-more-popover .event5').simulate('drag', {
           $('.fc-more-popover .event5').simulate('drag', {
             end: $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(1)') // one day before
             end: $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis):eq(1)') // one day before
-          });
-        }, 0);
-      });
-    });
+          })
+        }, 0)
+      })
+    })
 
 
     describe('when dragging a whole day event to a timed slot', function() {
     describe('when dragging a whole day event to a timed slot', function() {
 
 
       it('should assume the new time, with a cleared end', function(done) {
       it('should assume the new time, with a cleared end', function(done) {
 
 
-        options.defaultView = 'agendaWeek';
-        options.scrollTime = '00:00:00';
+        options.defaultView = 'agendaWeek'
+        options.scrollTime = '00:00:00'
         options.eventDrop = function(event) {
         options.eventDrop = function(event) {
-          expect(event.start).toEqualMoment('2014-07-30T03:00:00');
-          expect(event.allDay).toBe(false);
-          done();
-        };
-        init();
+          expect(event.start).toEqualMoment('2014-07-30T03:00:00')
+          expect(event.allDay).toBe(false)
+          done()
+        }
+        init()
 
 
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
           $('.fc-more-popover .event4').simulate('drag', {
           $('.fc-more-popover .event4').simulate('drag', {
@@ -331,10 +331,10 @@ describe('eventLimit popover', function() {
               top: '50%'
               top: '50%'
             },
             },
             end: $('.fc-slats tr:eq(6)') // the middle will be 7/30, 3:00am
             end: $('.fc-slats tr:eq(6)') // the middle will be 7/30, 3:00am
-          });
-        }, 0);
-      });
-    });
+          })
+        }, 0)
+      })
+    })
 
 
     describe('when a single-day event isn\'t dragged out all the way', function() {
     describe('when a single-day event isn\'t dragged out all the way', function() {
 
 
@@ -342,54 +342,54 @@ describe('eventLimit popover', function() {
 
 
         options.eventDragStop = function() {
         options.eventDragStop = function() {
           setTimeout(function() { // try to wait until drag is over. eventDrop won't fire BTW
           setTimeout(function() { // try to wait until drag is over. eventDrop won't fire BTW
-            expect($('.fc-more-popover')).toBeInDOM();
-            done();
-          }, 0);
-        };
-        init();
+            expect($('.fc-more-popover')).toBeInDOM()
+            done()
+          }, 0)
+        }
+        init()
 
 
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
         setTimeout(function() { // simulate was getting confused about which thing was being clicked :(
           $('.fc-more-popover .event1 .fc-title').simulate('drag', {
           $('.fc-more-popover .event1 .fc-title').simulate('drag', {
             dx: 20
             dx: 20
-          });
-        }, 0);
-      });
-    });
+          })
+        }, 0)
+      })
+    })
 
 
-  });
+  })
 
 
 
 
   it('calls event render handlers', function() {
   it('calls event render handlers', function() {
-    options.eventRender = function() {};
-    options.eventAfterRender = function() {};
-    options.eventAfterAllRender = function() {};
-    options.eventDestroy = function() {};
+    options.eventRender = function() {}
+    options.eventAfterRender = function() {}
+    options.eventAfterAllRender = function() {}
+    options.eventDestroy = function() {}
 
 
-    spyOn(options, 'eventRender');
-    spyOn(options, 'eventAfterRender');
-    spyOn(options, 'eventAfterAllRender');
-    spyOn(options, 'eventDestroy');
+    spyOn(options, 'eventRender')
+    spyOn(options, 'eventAfterRender')
+    spyOn(options, 'eventAfterAllRender')
+    spyOn(options, 'eventDestroy')
 
 
-    $('#cal').fullCalendar(options);
+    $('#cal').fullCalendar(options)
 
 
-    expect(options.eventRender.calls.count()).toBe(4);
-    expect(options.eventAfterRender.calls.count()).toBe(4);
-    expect(options.eventAfterAllRender.calls.count()).toBe(1);
-    expect(options.eventDestroy.calls.count()).toBe(0);
+    expect(options.eventRender.calls.count()).toBe(4)
+    expect(options.eventAfterRender.calls.count()).toBe(4)
+    expect(options.eventAfterAllRender.calls.count()).toBe(1)
+    expect(options.eventDestroy.calls.count()).toBe(0)
 
 
-    $('.fc-more').simulate('click');
+    $('.fc-more').simulate('click')
 
 
-    expect(options.eventRender.calls.count()).toBe(8); // +4
-    expect(options.eventAfterRender.calls.count()).toBe(8); // +4
-    expect(options.eventAfterAllRender.calls.count()).toBe(1); // stays same!
-    expect(options.eventDestroy.calls.count()).toBe(0);
+    expect(options.eventRender.calls.count()).toBe(8) // +4
+    expect(options.eventAfterRender.calls.count()).toBe(8) // +4
+    expect(options.eventAfterAllRender.calls.count()).toBe(1) // stays same!
+    expect(options.eventDestroy.calls.count()).toBe(0)
 
 
-    $('.fc-more-popover .fc-close').simulate('click');
+    $('.fc-more-popover .fc-close').simulate('click')
 
 
-    expect(options.eventRender.calls.count()).toBe(8);
-    expect(options.eventAfterRender.calls.count()).toBe(8);
-    expect(options.eventAfterAllRender.calls.count()).toBe(1);
-    expect(options.eventDestroy.calls.count()).toBe(4); // +4
+    expect(options.eventRender.calls.count()).toBe(8)
+    expect(options.eventAfterRender.calls.count()).toBe(8)
+    expect(options.eventAfterAllRender.calls.count()).toBe(1)
+    expect(options.eventDestroy.calls.count()).toBe(4) // +4
   })
   })
 
 
-});
+})

+ 46 - 46
tests/legacy/eventLimit-popoverDestroy.js

@@ -1,10 +1,10 @@
 
 
 describe('eventLimit popover', function() {
 describe('eventLimit popover', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultView: 'month',
       defaultView: 'month',
       defaultDate: '2014-08-01',
       defaultDate: '2014-08-01',
@@ -17,65 +17,65 @@ describe('eventLimit popover', function() {
       ],
       ],
       popoverViewportConstrain: false, // because PhantomJS window is small, don't do smart repositioning
       popoverViewportConstrain: false, // because PhantomJS window is small, don't do smart repositioning
       handleWindowResize: false // because showing the popover causes scrollbars and fires resize
       handleWindowResize: false // because showing the popover causes scrollbars and fires resize
-    };
-  });
+    }
+  })
 
 
   function init() {
   function init() {
-    $('.fc-more').simulate('click');
+    $('.fc-more').simulate('click')
   }
   }
 
 
   it('closes when user clicks the X and trigger eventDestroy for every render', function() {
   it('closes when user clicks the X and trigger eventDestroy for every render', function() {
-    var eventsRendered = {};
-    var renderCount = 0;
-    var activated = false;
+    var eventsRendered = {}
+    var renderCount = 0
+    var activated = false
     options.eventRender = function(eventObject, element, view) {
     options.eventRender = function(eventObject, element, view) {
       if (activated) {
       if (activated) {
-        eventsRendered[eventObject.title] = eventObject;
-        ++renderCount;
+        eventsRendered[eventObject.title] = eventObject
+        ++renderCount
       }
       }
-    };
+    }
     options.eventDestroy = function(eventObject, element, view) {
     options.eventDestroy = function(eventObject, element, view) {
-      delete eventsRendered[eventObject.title];
-      --renderCount;
-    };
-    //Create calendar
-    $('#cal').fullCalendar(options);
-    //Activate flags and pop event limit popover
-    activated = true;
-    $('.fc-more').simulate('click');
+      delete eventsRendered[eventObject.title]
+      --renderCount
+    }
+    // Create calendar
+    $('#cal').fullCalendar(options)
+    // Activate flags and pop event limit popover
+    activated = true
+    $('.fc-more').simulate('click')
 
 
-    expect($('.fc-more-popover')).toBeVisible();
+    expect($('.fc-more-popover')).toBeVisible()
     $('.fc-more-popover .fc-close')
     $('.fc-more-popover .fc-close')
-      .simulate('click');
-    expect($('.fc-more-popover')).not.toBeVisible();
-    expect(Object.keys(eventsRendered).length).toEqual(0);
-    expect(renderCount).toEqual(0);
-  });
+      .simulate('click')
+    expect($('.fc-more-popover')).not.toBeVisible()
+    expect(Object.keys(eventsRendered).length).toEqual(0)
+    expect(renderCount).toEqual(0)
+  })
 
 
   it('closes when user clicks outside of the popover and trigger eventDestroy for every render', function() {
   it('closes when user clicks outside of the popover and trigger eventDestroy for every render', function() {
-    var eventsRendered = {};
-    var renderCount = 0;
-    var activated = false;
+    var eventsRendered = {}
+    var renderCount = 0
+    var activated = false
     options.eventRender = function(eventObject, element, view) {
     options.eventRender = function(eventObject, element, view) {
       if (activated) {
       if (activated) {
-        eventsRendered[eventObject.title] = eventObject;
-        ++renderCount;
+        eventsRendered[eventObject.title] = eventObject
+        ++renderCount
       }
       }
-    };
+    }
     options.eventDestroy = function(eventObject, element, view) {
     options.eventDestroy = function(eventObject, element, view) {
-      delete eventsRendered[eventObject.title];
-      --renderCount;
-    };
-    //Create calendar
-    $('#cal').fullCalendar(options);
-    //Activate flags and pop event limit popover
-    activated = true;
-    $('.fc-more').simulate('click');
+      delete eventsRendered[eventObject.title]
+      --renderCount
+    }
+    // Create calendar
+    $('#cal').fullCalendar(options)
+    // Activate flags and pop event limit popover
+    activated = true
+    $('.fc-more').simulate('click')
 
 
-    expect($('.fc-more-popover')).toBeVisible();
-    $('body').simulate('mousedown').simulate('click');
-    expect($('.fc-more-popover')).not.toBeVisible();
-    expect(Object.keys(eventsRendered).length).toEqual(0);
-    expect(renderCount).toEqual(0);
-  });
-});
+    expect($('.fc-more-popover')).toBeVisible()
+    $('body').simulate('mousedown').simulate('click')
+    expect($('.fc-more-popover')).not.toBeVisible()
+    expect(Object.keys(eventsRendered).length).toEqual(0)
+    expect(renderCount).toEqual(0)
+  })
+})

+ 100 - 100
tests/legacy/eventLimit.js

@@ -1,19 +1,19 @@
 
 
 describe('eventLimit', function() {
 describe('eventLimit', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultDate: '2014-08-01' // important that it is the first week, so works w/ month + week views
       defaultDate: '2014-08-01' // important that it is the first week, so works w/ month + week views
-    };
-  });
+    }
+  })
 
 
   describe('as a number', function() {
   describe('as a number', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.eventLimit = 3;
+      options.eventLimit = 3
     });
     });
 
 
     [ 'month', 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
     [ 'month', 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
@@ -21,27 +21,27 @@ describe('eventLimit', function() {
       describe('when in ' + viewName + ' view', function() {
       describe('when in ' + viewName + ' view', function() {
 
 
         beforeEach(function() {
         beforeEach(function() {
-          options.defaultView = viewName;
-        });
+          options.defaultView = viewName
+        })
 
 
         it('doesn\'t display a more link when limit is more than the # of events', function() {
         it('doesn\'t display a more link when limit is more than the # of events', function() {
           options.events = [
           options.events = [
             { title: 'event1', start: '2014-07-29' },
             { title: 'event1', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' }
             { title: 'event2', start: '2014-07-29' }
-          ];
-          $('#cal').fullCalendar(options);
-          expect($('.fc-more').length).toBe(0);
-        });
+          ]
+          $('#cal').fullCalendar(options)
+          expect($('.fc-more').length).toBe(0)
+        })
 
 
         it('doesn\'t display a more link when limit equal to the # of events', function() {
         it('doesn\'t display a more link when limit equal to the # of events', function() {
           options.events = [
           options.events = [
             { title: 'event1', start: '2014-07-29' },
             { title: 'event1', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' }
             { title: 'event2', start: '2014-07-29' }
-          ];
-          $('#cal').fullCalendar(options);
-          expect($('.fc-more').length).toBe(0);
-        });
+          ]
+          $('#cal').fullCalendar(options)
+          expect($('.fc-more').length).toBe(0)
+        })
 
 
         it('displays a more link when limit is less than the # of events', function() {
         it('displays a more link when limit is less than the # of events', function() {
           options.events = [
           options.events = [
@@ -49,11 +49,11 @@ describe('eventLimit', function() {
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' }
             { title: 'event2', start: '2014-07-29' }
-          ];
-          $('#cal').fullCalendar(options);
-          expect($('.fc-more').length).toBe(1);
-          expect($('.fc-more')).toHaveText('+2 more');
-        });
+          ]
+          $('#cal').fullCalendar(options)
+          expect($('.fc-more').length).toBe(1)
+          expect($('.fc-more')).toHaveText('+2 more')
+        })
 
 
         it('displays one more per day, when a multi-day event is above', function() {
         it('displays one more per day, when a multi-day event is above', function() {
           options.events = [
           options.events = [
@@ -61,15 +61,15 @@ describe('eventLimit', function() {
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' }
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' }
-          ];
-          $('#cal').fullCalendar(options);
-          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)');
-          expect($('.fc-more').length).toBe(2);
-          expect($('.fc-more').eq(0)).toHaveText('+2 more');
-          expect($('.fc-more').eq(0)).toBeBoundedBy(cells.eq(2));
-          expect($('.fc-more').eq(1)).toHaveText('+2 more');
-          expect($('.fc-more').eq(1)).toBeBoundedBy(cells.eq(3));
-        });
+          ]
+          $('#cal').fullCalendar(options)
+          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)')
+          expect($('.fc-more').length).toBe(2)
+          expect($('.fc-more').eq(0)).toHaveText('+2 more')
+          expect($('.fc-more').eq(0)).toBeBoundedBy(cells.eq(2))
+          expect($('.fc-more').eq(1)).toHaveText('+2 more')
+          expect($('.fc-more').eq(1)).toBeBoundedBy(cells.eq(3))
+        })
 
 
         it('will render a link in a multi-day event\'s second column ' +
         it('will render a link in a multi-day event\'s second column ' +
           'if it has already been hidden in the first',
           'if it has already been hidden in the first',
@@ -79,15 +79,15 @@ describe('eventLimit', function() {
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' },
             { title: 'event2', start: '2014-07-29' }
             { title: 'event2', start: '2014-07-29' }
-          ];
-          $('#cal').fullCalendar(options);
-          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)');
-          expect($('.fc-more').length).toBe(2);
-          expect($('.fc-more').eq(0)).toHaveText('+2 more');
-          expect($('.fc-more').eq(0)).toBeBoundedBy(cells.eq(2));
-          expect($('.fc-more').eq(1)).toHaveText('+1 more');
-          expect($('.fc-more').eq(1)).toBeBoundedBy(cells.eq(3));
-        });
+          ]
+          $('#cal').fullCalendar(options)
+          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)')
+          expect($('.fc-more').length).toBe(2)
+          expect($('.fc-more').eq(0)).toHaveText('+2 more')
+          expect($('.fc-more').eq(0)).toBeBoundedBy(cells.eq(2))
+          expect($('.fc-more').eq(1)).toHaveText('+1 more')
+          expect($('.fc-more').eq(1)).toBeBoundedBy(cells.eq(3))
+        })
 
 
         it('will render a link in a multi-day event\'s second column ' +
         it('will render a link in a multi-day event\'s second column ' +
           'if it has already been hidden in the first even if he second column hardly has any events',
           'if it has already been hidden in the first even if he second column hardly has any events',
@@ -97,14 +97,14 @@ describe('eventLimit', function() {
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' }
             { title: 'event2', start: '2014-07-29', end: '2014-07-31' }
-          ];
-          $('#cal').fullCalendar(options);
-          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)');
-          var link = $('.fc-more').eq(0); // will appear to be the third link, but will be in first row, so 0dom
-          expect(link.length).toBe(1);
-          expect(link).toHaveText('+1 more');
-          expect(link).toBeBoundedBy(cells.eq(3));
-        });
+          ]
+          $('#cal').fullCalendar(options)
+          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)')
+          var link = $('.fc-more').eq(0) // will appear to be the third link, but will be in first row, so 0dom
+          expect(link.length).toBe(1)
+          expect(link).toHaveText('+1 more')
+          expect(link).toBeBoundedBy(cells.eq(3))
+        })
 
 
         it('will render a link in place of a hidden single day event, if covered by a multi-day', function() {
         it('will render a link in place of a hidden single day event, if covered by a multi-day', function() {
           options.events = [
           options.events = [
@@ -112,14 +112,14 @@ describe('eventLimit', function() {
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-28' },
             { title: 'event2', start: '2014-07-28' },
             { title: 'event2', start: '2014-07-28' }
             { title: 'event2', start: '2014-07-28' }
-          ];
-          $('#cal').fullCalendar(options);
-          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)');
-          var link = $('.fc-more').eq(0);
-          expect(link.length).toBe(1);
-          expect(link).toHaveText('+2 more');
-          expect(link).toBeBoundedBy(cells.eq(1));
-        });
+          ]
+          $('#cal').fullCalendar(options)
+          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)')
+          var link = $('.fc-more').eq(0)
+          expect(link.length).toBe(1)
+          expect(link).toHaveText('+2 more')
+          expect(link).toBeBoundedBy(cells.eq(1))
+        })
 
 
         it('will render a link in place of a hidden single day event, if covered by a multi-day ' +
         it('will render a link in place of a hidden single day event, if covered by a multi-day ' +
           'and in its second column',
           'and in its second column',
@@ -129,28 +129,28 @@ describe('eventLimit', function() {
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' },
             { title: 'event2', start: '2014-07-29' }
             { title: 'event2', start: '2014-07-29' }
-          ];
-          $('#cal').fullCalendar(options);
-          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)');
-          var link = $('.fc-more').eq(0);
-          expect(link.length).toBe(1);
-          expect(link).toHaveText('+2 more');
-          expect(link).toBeBoundedBy(cells.eq(2));
-        });
-      });
-    });
-  });
+          ]
+          $('#cal').fullCalendar(options)
+          var cells = $('.fc-day-grid .fc-row:eq(0) .fc-bg td:not(.fc-axis)')
+          var link = $('.fc-more').eq(0)
+          expect(link.length).toBe(1)
+          expect(link).toHaveText('+2 more')
+          expect(link).toBeBoundedBy(cells.eq(2))
+        })
+      })
+    })
+  })
 
 
   describe('when auto', function() {
   describe('when auto', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.eventLimit = true;
-    });
+      options.eventLimit = true
+    })
 
 
     describe('in month view', function() {
     describe('in month view', function() {
 
 
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = 'month';
+        options.defaultView = 'month'
         options.events = [
         options.events = [
           { title: 'event1', start: '2014-07-28', end: '2014-07-30' },
           { title: 'event1', start: '2014-07-28', end: '2014-07-30' },
           { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
           { title: 'event2', start: '2014-07-28', end: '2014-07-30' },
@@ -165,24 +165,24 @@ describe('eventLimit', function() {
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' }
           { title: 'event2', start: '2014-07-29' }
-        ];
-      });
+        ]
+      })
 
 
       it('renders the heights of all the rows the same, regardless of # of events', function() {
       it('renders the heights of all the rows the same, regardless of # of events', function() {
-        $('#cal').fullCalendar(options);
-        var rowEls = $('.fc-day-grid .fc-row').slice(0, -1); // remove last b/c it will be a different height
-        expect(rowEls.length).toBeGreaterThan(0);
-        var height = rowEls.height();
+        $('#cal').fullCalendar(options)
+        var rowEls = $('.fc-day-grid .fc-row').slice(0, -1) // remove last b/c it will be a different height
+        expect(rowEls.length).toBeGreaterThan(0)
+        var height = rowEls.height()
         rowEls.each(function(i, node) {
         rowEls.each(function(i, node) {
-          expect($(node).height()).toBe(height);
-        });
-      });
+          expect($(node).height()).toBe(height)
+        })
+      })
 
 
       it('renders a more link when there are obviously too many events', function() {
       it('renders a more link when there are obviously too many events', function() {
-        $('#cal').width(800);
-        $('#cal').fullCalendar(options);
-        expect($('#cal .fc-more').length).toBe(1);
-      });
+        $('#cal').width(800)
+        $('#cal').fullCalendar(options)
+        expect($('#cal .fc-more').length).toBe(1)
+      })
     });
     });
 
 
     [ 'month', 'basicWeek' ].forEach(function(viewName) {
     [ 'month', 'basicWeek' ].forEach(function(viewName) {
@@ -190,24 +190,24 @@ describe('eventLimit', function() {
       describe('in ' + viewName + ' view', function() {
       describe('in ' + viewName + ' view', function() {
 
 
         beforeEach(function() {
         beforeEach(function() {
-          options.defaultView = viewName;
-        });
+          options.defaultView = viewName
+        })
 
 
         it('doesn\'t render a more link where there should obviously not be a limit', function() {
         it('doesn\'t render a more link where there should obviously not be a limit', function() {
           options.events = [
           options.events = [
             { title: 'event1', start: '2014-07-28', end: '2014-07-30' }
             { title: 'event1', start: '2014-07-28', end: '2014-07-30' }
-          ];
-          $('#cal').fullCalendar(options);
-          expect($('.fc-more').length).toBe(0);
-        });
-      });
-    });
+          ]
+          $('#cal').fullCalendar(options)
+          expect($('.fc-more').length).toBe(0)
+        })
+      })
+    })
 
 
     describe('in agendaWeek view', function() {
     describe('in agendaWeek view', function() {
 
 
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = 'agendaWeek';
-      });
+        options.defaultView = 'agendaWeek'
+      })
 
 
       it('behaves as if limit is 5', function() {
       it('behaves as if limit is 5', function() {
         options.events = [
         options.events = [
@@ -218,12 +218,12 @@ describe('eventLimit', function() {
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' },
           { title: 'event2', start: '2014-07-29' }
           { title: 'event2', start: '2014-07-29' }
-        ];
-        $('#cal').fullCalendar(options);
-        expect($('.fc-event:visible').length).toBe(4);
-        expect($('.fc-more').length).toBe(1);
-        expect($('.fc-more')).toHaveText('+3 more');
-      });
-    });
-  });
-});
+        ]
+        $('#cal').fullCalendar(options)
+        expect($('.fc-event:visible').length).toBe(4)
+        expect($('.fc-more').length).toBe(1)
+        expect($('.fc-more')).toHaveText('+3 more')
+      })
+    })
+  })
+})

+ 70 - 70
tests/legacy/eventLimitClick.js

@@ -1,10 +1,10 @@
 
 
 describe('eventLimitClick', function() { // simulate a click
 describe('eventLimitClick', function() { // simulate a click
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultDate: '2014-08-01', // important that it is the first week, so works w/ month + week views
       defaultDate: '2014-08-01', // important that it is the first week, so works w/ month + week views
       defaultView: 'month',
       defaultView: 'month',
@@ -15,123 +15,123 @@ describe('eventLimitClick', function() { // simulate a click
         { title: 'event2', start: '2014-07-29' },
         { title: 'event2', start: '2014-07-29' },
         { title: 'event2', start: '2014-07-29' }
         { title: 'event2', start: '2014-07-29' }
       ]
       ]
-    };
-  });
+    }
+  })
 
 
   describe('when set to "popover"', function() {
   describe('when set to "popover"', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.eventLimitClick = 'popover';
-    });
+      options.eventLimitClick = 'popover'
+    })
 
 
     it('renders a popover upon click', function() {
     it('renders a popover upon click', function() {
-      $('#cal').fullCalendar(options);
-      $('.fc-more').simulate('click');
-      expect($('.fc-more-popover')).toBeVisible();
-    });
+      $('#cal').fullCalendar(options)
+      $('.fc-more').simulate('click')
+      expect($('.fc-more-popover')).toBeVisible()
+    })
 
 
     // more popover tests are done in eventLimit-popover
     // more popover tests are done in eventLimit-popover
-  });
+  })
 
 
   describe('when set to "week"', function() {
   describe('when set to "week"', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.eventLimitClick = 'week';
-    });
+      options.eventLimitClick = 'week'
+    })
 
 
     it('should go to basicWeek if it is one of the available views', function() {
     it('should go to basicWeek if it is one of the available views', function() {
       options.header = {
       options.header = {
         left: 'prev,next today',
         left: 'prev,next today',
         center: 'title',
         center: 'title',
         right: 'month,basicWeek,basicDay'
         right: 'month,basicWeek,basicDay'
-      };
-      $('#cal').fullCalendar(options);
-      $('.fc-more').simulate('click');
-      var view = $('#cal').fullCalendar('getView');
-      expect(view.name).toBe('basicWeek'); // .name should be deprecated
-      expect(view.type).toBe('basicWeek');
-    });
+      }
+      $('#cal').fullCalendar(options)
+      $('.fc-more').simulate('click')
+      var view = $('#cal').fullCalendar('getView')
+      expect(view.name).toBe('basicWeek') // .name should be deprecated
+      expect(view.type).toBe('basicWeek')
+    })
 
 
     it('should go to agendaWeek if it is one of the available views', function() {
     it('should go to agendaWeek if it is one of the available views', function() {
       options.header = {
       options.header = {
         left: 'prev,next today',
         left: 'prev,next today',
         center: 'title',
         center: 'title',
         right: 'month,agendaWeek,agendaDay'
         right: 'month,agendaWeek,agendaDay'
-      };
-      $('#cal').fullCalendar(options);
-      $('.fc-more').simulate('click');
-      var view = $('#cal').fullCalendar('getView');
-      expect(view.name).toBe('agendaWeek'); // .name should be deprecated
-      expect(view.type).toBe('agendaWeek');
-    });
-  });
+      }
+      $('#cal').fullCalendar(options)
+      $('.fc-more').simulate('click')
+      var view = $('#cal').fullCalendar('getView')
+      expect(view.name).toBe('agendaWeek') // .name should be deprecated
+      expect(view.type).toBe('agendaWeek')
+    })
+  })
 
 
   describe('when set to "day"', function() {
   describe('when set to "day"', function() {
 
 
     beforeEach(function() {
     beforeEach(function() {
-      options.eventLimitClick = 'day';
-    });
+      options.eventLimitClick = 'day'
+    })
 
 
     it('should go to basicDay if it is one of the available views', function() {
     it('should go to basicDay if it is one of the available views', function() {
       options.header = {
       options.header = {
         left: 'prev,next today',
         left: 'prev,next today',
         center: 'title',
         center: 'title',
         right: 'month,basicWeek,basicDay'
         right: 'month,basicWeek,basicDay'
-      };
-      $('#cal').fullCalendar(options);
-      $('.fc-more').simulate('click');
-      var view = $('#cal').fullCalendar('getView');
-      expect(view.name).toBe('basicDay');
-    });
+      }
+      $('#cal').fullCalendar(options)
+      $('.fc-more').simulate('click')
+      var view = $('#cal').fullCalendar('getView')
+      expect(view.name).toBe('basicDay')
+    })
 
 
     it('should go to agendaDay if it is one of the available views', function() {
     it('should go to agendaDay if it is one of the available views', function() {
       options.header = {
       options.header = {
         left: 'prev,next today',
         left: 'prev,next today',
         center: 'title',
         center: 'title',
         right: 'month,agendaWeek,agendaDay'
         right: 'month,agendaWeek,agendaDay'
-      };
-      $('#cal').fullCalendar(options);
-      $('.fc-more').simulate('click');
-      var view = $('#cal').fullCalendar('getView');
-      expect(view.name).toBe('agendaDay');
-    });
-  });
+      }
+      $('#cal').fullCalendar(options)
+      $('.fc-more').simulate('click')
+      var view = $('#cal').fullCalendar('getView')
+      expect(view.name).toBe('agendaDay')
+    })
+  })
 
 
   it('works with an explicit view name', function() {
   it('works with an explicit view name', function() {
-    options.eventLimitClick = 'agendaWeek';
+    options.eventLimitClick = 'agendaWeek'
     options.header = {
     options.header = {
       left: 'prev,next today',
       left: 'prev,next today',
       center: 'title',
       center: 'title',
       right: 'month,basicWeek,basicDay'
       right: 'month,basicWeek,basicDay'
-    };
-    $('#cal').fullCalendar(options);
-    $('.fc-more').simulate('click');
-    var view = $('#cal').fullCalendar('getView');
-    expect(view.name).toBe('agendaWeek');
-  });
+    }
+    $('#cal').fullCalendar(options)
+    $('.fc-more').simulate('click')
+    var view = $('#cal').fullCalendar('getView')
+    expect(view.name).toBe('agendaWeek')
+  })
 
 
   it('works with custom function and all the arguments are correct', function() {
   it('works with custom function and all the arguments are correct', function() {
     options.eventLimitClick = function(cellInfo, jsEvent) {
     options.eventLimitClick = function(cellInfo, jsEvent) {
-      expect(typeof cellInfo).toBe('object');
-      expect(typeof jsEvent).toBe('object');
-      expect(cellInfo.date).toEqualMoment('2014-07-29');
-      expect(cellInfo.dayEl.data('date')).toBe('2014-07-29');
-      expect(cellInfo.hiddenSegs.length).toBe(2);
-      expect(cellInfo.segs.length).toBe(4);
-      expect(cellInfo.moreEl).toHaveClass('fc-more');
-    };
-    $('#cal').fullCalendar(options);
-    $('.fc-more').simulate('click');
-  });
+      expect(typeof cellInfo).toBe('object')
+      expect(typeof jsEvent).toBe('object')
+      expect(cellInfo.date).toEqualMoment('2014-07-29')
+      expect(cellInfo.dayEl.data('date')).toBe('2014-07-29')
+      expect(cellInfo.hiddenSegs.length).toBe(2)
+      expect(cellInfo.segs.length).toBe(4)
+      expect(cellInfo.moreEl).toHaveClass('fc-more')
+    }
+    $('#cal').fullCalendar(options)
+    $('.fc-more').simulate('click')
+  })
 
 
   it('works with custom function, and can return a view name', function() {
   it('works with custom function, and can return a view name', function() {
     options.eventLimitClick = function(cellInfo, jsEvent) {
     options.eventLimitClick = function(cellInfo, jsEvent) {
-      return 'agendaDay';
-    };
-    $('#cal').fullCalendar(options);
-    $('.fc-more').simulate('click');
-    var view = $('#cal').fullCalendar('getView');
-    expect(view.name).toBe('agendaDay');
-  });
-
-});
+      return 'agendaDay'
+    }
+    $('#cal').fullCalendar(options)
+    $('.fc-more').simulate('click')
+    var view = $('#cal').fullCalendar('getView')
+    expect(view.name).toBe('agendaDay')
+  })
+
+})

+ 24 - 24
tests/legacy/eventLimitText.js

@@ -1,10 +1,10 @@
 
 
 describe('eventLimitText', function() {
 describe('eventLimitText', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultDate: '2014-08-01', // important that it is the first week, so works w/ month + week views
       defaultDate: '2014-08-01', // important that it is the first week, so works w/ month + week views
       defaultView: 'month',
       defaultView: 'month',
@@ -15,34 +15,34 @@ describe('eventLimitText', function() {
         { title: 'event2', start: '2014-07-29' },
         { title: 'event2', start: '2014-07-29' },
         { title: 'event2', start: '2014-07-29' }
         { title: 'event2', start: '2014-07-29' }
       ]
       ]
-    };
-  });
+    }
+  })
 
 
   it('allows a string', function() {
   it('allows a string', function() {
-    options.eventLimitText = 'extra';
-    $('#cal').fullCalendar(options);
-    expect($('.fc-more')).toHaveText('+2 extra');
-  });
+    options.eventLimitText = 'extra'
+    $('#cal').fullCalendar(options)
+    expect($('.fc-more')).toHaveText('+2 extra')
+  })
 
 
   it('allows a function', function() {
   it('allows a function', function() {
     options.eventLimitText = function(n) {
     options.eventLimitText = function(n) {
-      expect(typeof n).toBe('number');
-      return 'there are ' + n + ' more events!';
-    };
-    $('#cal').fullCalendar(options);
-    expect($('.fc-more')).toHaveText('there are 2 more events!');
-  });
+      expect(typeof n).toBe('number')
+      return 'there are ' + n + ' more events!'
+    }
+    $('#cal').fullCalendar(options)
+    expect($('.fc-more')).toHaveText('there are 2 more events!')
+  })
 
 
   it('has a default value that is affected by the custom locale', function() {
   it('has a default value that is affected by the custom locale', function() {
-    options.locale = 'fr';
-    $('#cal').fullCalendar(options);
-    expect($('.fc-more')).toHaveText('+2 en plus');
-  });
+    options.locale = 'fr'
+    $('#cal').fullCalendar(options)
+    expect($('.fc-more')).toHaveText('+2 en plus')
+  })
 
 
   it('is not affected by a custom locale when the value is explicitly specified', function() {
   it('is not affected by a custom locale when the value is explicitly specified', function() {
-    options.locale = 'fr';
-    options.eventLimitText = 'extra';
-    $('#cal').fullCalendar(options);
-    expect($('.fc-more')).toHaveText('+2 extra');
-  });
-});
+    options.locale = 'fr'
+    options.eventLimitText = 'extra'
+    $('#cal').fullCalendar(options)
+    expect($('.fc-more')).toHaveText('+2 extra')
+  })
+})

+ 15 - 15
tests/legacy/eventMouseover.js

@@ -10,15 +10,15 @@ describe('eventMouseover', function() {
 
 
       pushOptions({
       pushOptions({
         defaultView: viewName
         defaultView: viewName
-      });
+      })
 
 
       it('will trigger a eventMouseout with updateEvent', function(done) {
       it('will trigger a eventMouseout with updateEvent', function(done) {
 
 
         var eventMouseoutSpy = spyOnCalendarCallback('eventMouseout', function(event, ev) {
         var eventMouseoutSpy = spyOnCalendarCallback('eventMouseout', function(event, ev) {
-          expect(typeof event).toBe('object');
-          expect(typeof ev).toBe('object');
-          done();
-        });
+          expect(typeof event).toBe('object')
+          expect(typeof ev).toBe('object')
+          done()
+        })
 
 
         initCalendar({
         initCalendar({
           events: [ {
           events: [ {
@@ -27,16 +27,16 @@ describe('eventMouseover', function() {
             className: 'event'
             className: 'event'
           } ],
           } ],
           eventMouseover: function(event, ev) {
           eventMouseover: function(event, ev) {
-            expect(typeof event).toBe('object');
-            expect(typeof ev).toBe('object');
-            event.title = 'YO';
-            currentCalendar.updateEvent(event);
+            expect(typeof event).toBe('object')
+            expect(typeof ev).toBe('object')
+            event.title = 'YO'
+            currentCalendar.updateEvent(event)
           }
           }
-        });
+        })
 
 
-        $('.event').simulate('mouseover');
+        $('.event').simulate('mouseover')
 
 
-      });
-    });
-  });
-});
+      })
+    })
+  })
+})

+ 187 - 187
tests/legacy/eventRender.js

@@ -1,13 +1,13 @@
 describe('eventRender', function() {
 describe('eventRender', function() {
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
     options = {
     options = {
       defaultDate: '2014-11-12',
       defaultDate: '2014-11-12',
       scrollTime: '00:00:00'
       scrollTime: '00:00:00'
-    };
-    affix('#cal');
-  });
+    }
+    affix('#cal')
+  })
 
 
   $.each({
   $.each({
     month: '.fc-day-grid',
     month: '.fc-day-grid',
@@ -15,72 +15,72 @@ describe('eventRender', function() {
   }, function(viewName, gridSelector) {
   }, function(viewName, gridSelector) {
     describe('when in ' + viewName + ' view', function() {
     describe('when in ' + viewName + ' view', function() {
       beforeEach(function() {
       beforeEach(function() {
-        options.defaultView = viewName;
-      });
+        options.defaultView = viewName
+      })
       describe('with foreground event', function() {
       describe('with foreground event', function() {
         it('receives correct args AND can modify the element', function(done) {
         it('receives correct args AND can modify the element', function(done) {
           options.events = [ {
           options.events = [ {
             title: 'my event',
             title: 'my event',
             start: '2014-11-12T09:00:00'
             start: '2014-11-12T09:00:00'
-          } ];
+          } ]
           options.eventRender = function(event, element, view) {
           options.eventRender = function(event, element, view) {
-            expect(typeof event).toBe('object');
-            expect(event.rendering).toBeUndefined();
-            expect(event.start).toBeDefined();
-            expect(typeof element).toBe('object');
-            expect(element.length).toBe(1);
-            expect(typeof view).toBe('object');
-            element.css('font-size', '20px');
-          };
+            expect(typeof event).toBe('object')
+            expect(event.rendering).toBeUndefined()
+            expect(event.start).toBeDefined()
+            expect(typeof element).toBe('object')
+            expect(element.length).toBe(1)
+            expect(typeof view).toBe('object')
+            element.css('font-size', '20px')
+          }
           options.eventAfterAllRender = function() {
           options.eventAfterAllRender = function() {
-            expect($(gridSelector).find('.fc-event').css('font-size')).toBe('20px');
-            expect(options.eventRender).toHaveBeenCalled();
-            done();
-          };
-          spyOn(options, 'eventRender').and.callThrough();
-          $('#cal').fullCalendar(options);
-        });
-      });
-    });
-  });
+            expect($(gridSelector).find('.fc-event').css('font-size')).toBe('20px')
+            expect(options.eventRender).toHaveBeenCalled()
+            done()
+          }
+          spyOn(options, 'eventRender').and.callThrough()
+          $('#cal').fullCalendar(options)
+        })
+      })
+    })
+  })
 
 
   describe('when in month view', function() {
   describe('when in month view', function() {
     beforeEach(function() {
     beforeEach(function() {
-      options.defaultView = 'month';
-    });
+      options.defaultView = 'month'
+    })
 
 
     describe('with a foreground event', function() {
     describe('with a foreground event', function() {
       beforeEach(function() {
       beforeEach(function() {
         options.events = [ {
         options.events = [ {
           title: 'my event',
           title: 'my event',
           start: '2014-11-12'
           start: '2014-11-12'
-        } ];
-      });
+        } ]
+      })
       it('can return a new element', function(done) {
       it('can return a new element', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return $('<div class="fc-event sup" style="background-color:green">sup g</div>');
-        };
+          return $('<div class="fc-event sup" style="background-color:green">sup g</div>')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .sup').length).toBe(1);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-day-grid .sup').length).toBe(1)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('can return false and cancel rendering', function(done) {
       it('can return false and cancel rendering', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return false;
-        };
+          return false
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .fc-event').length).toBe(0);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
-    });
+          expect($('.fc-day-grid .fc-event').length).toBe(0)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
+    })
 
 
     describe('with an all-day background event', function() {
     describe('with an all-day background event', function() {
       beforeEach(function() {
       beforeEach(function() {
@@ -88,63 +88,63 @@ describe('eventRender', function() {
           title: 'my event',
           title: 'my event',
           start: '2014-11-12',
           start: '2014-11-12',
           rendering: 'background'
           rendering: 'background'
-        } ];
-      });
+        } ]
+      })
       it('receives correct args AND can modify the element', function(done) {
       it('receives correct args AND can modify the element', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          expect(typeof event).toBe('object');
-          expect(event.rendering).toBe('background');
-          expect(event.start).toBeDefined();
-          expect(typeof element).toBe('object');
-          expect(element.length).toBe(1);
-          expect(typeof view).toBe('object');
-          element.css('font-size', '20px');
-        };
+          expect(typeof event).toBe('object')
+          expect(event.rendering).toBe('background')
+          expect(event.start).toBeDefined()
+          expect(typeof element).toBe('object')
+          expect(element.length).toBe(1)
+          expect(typeof view).toBe('object')
+          element.css('font-size', '20px')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .fc-bgevent').css('font-size')).toBe('20px');
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-day-grid .fc-bgevent').css('font-size')).toBe('20px')
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('can return a new element', function(done) {
       it('can return a new element', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return $('<td class="sup" style="background-color:green">sup g</td>');
-        };
+          return $('<td class="sup" style="background-color:green">sup g</td>')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .sup').length).toBe(1);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-day-grid .sup').length).toBe(1)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('won\'t rendering when returning a new element of the wrong type', function(done) {
       it('won\'t rendering when returning a new element of the wrong type', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return $('<div class="sup" style="background-color:green">sup g</div>');
-        };
+          return $('<div class="sup" style="background-color:green">sup g</div>')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .sup').length).toBe(0);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-day-grid .sup').length).toBe(0)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('can return false and cancel rendering', function(done) {
       it('can return false and cancel rendering', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return false;
-        };
+          return false
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .fc-bgevent').length).toBe(0);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
-    });
+          expect($('.fc-day-grid .fc-bgevent').length).toBe(0)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
+    })
 
 
     describe('with a timed background event', function() { // not exactly related to eventRender!
     describe('with a timed background event', function() { // not exactly related to eventRender!
       beforeEach(function() {
       beforeEach(function() {
@@ -152,58 +152,58 @@ describe('eventRender', function() {
           title: 'my event',
           title: 'my event',
           start: '2014-11-12T01:00:00',
           start: '2014-11-12T01:00:00',
           rendering: 'background'
           rendering: 'background'
-        } ];
-      });
+        } ]
+      })
       it('won\'t render or call eventRender', function(done) {
       it('won\'t render or call eventRender', function(done) {
-        options.eventRender = function(event, element, view) { };
+        options.eventRender = function(event, element, view) { }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .fc-bgevent').length).toBe(0);
-          expect(options.eventRender).not.toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
-    });
-  });
+          expect($('.fc-day-grid .fc-bgevent').length).toBe(0)
+          expect(options.eventRender).not.toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
+    })
+  })
 
 
   describe('when in agendaWeek view', function() {
   describe('when in agendaWeek view', function() {
     beforeEach(function() {
     beforeEach(function() {
-      options.defaultView = 'agendaWeek';
-    });
+      options.defaultView = 'agendaWeek'
+    })
 
 
     describe('with a foreground event', function() {
     describe('with a foreground event', function() {
       beforeEach(function() {
       beforeEach(function() {
         options.events = [ {
         options.events = [ {
           title: 'my event',
           title: 'my event',
           start: '2014-11-12T01:00:00'
           start: '2014-11-12T01:00:00'
-        } ];
-      });
+        } ]
+      })
       it('can return a new element', function(done) {
       it('can return a new element', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return $('<div class="fc-event sup" style="background-color:green">sup g</div>');
-        };
+          return $('<div class="fc-event sup" style="background-color:green">sup g</div>')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-time-grid .sup').length).toBe(1);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-time-grid .sup').length).toBe(1)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('can return false and cancel rendering', function(done) {
       it('can return false and cancel rendering', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return false;
-        };
+          return false
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-time-grid .fc-event').length).toBe(0);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
-    });
+          expect($('.fc-time-grid .fc-event').length).toBe(0)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
+    })
 
 
     describe('with a timed background event', function() {
     describe('with a timed background event', function() {
       beforeEach(function() {
       beforeEach(function() {
@@ -211,63 +211,63 @@ describe('eventRender', function() {
           title: 'my event',
           title: 'my event',
           start: '2014-11-12T01:00:00',
           start: '2014-11-12T01:00:00',
           rendering: 'background'
           rendering: 'background'
-        } ];
-      });
+        } ]
+      })
       it('receives correct args AND can modify the element', function(done) {
       it('receives correct args AND can modify the element', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          expect(typeof event).toBe('object');
-          expect(event.rendering).toBe('background');
-          expect(event.start).toBeDefined();
-          expect(typeof element).toBe('object');
-          expect(element.length).toBe(1);
-          expect(typeof view).toBe('object');
-          element.css('font-size', '20px');
-        };
+          expect(typeof event).toBe('object')
+          expect(event.rendering).toBe('background')
+          expect(event.start).toBeDefined()
+          expect(typeof element).toBe('object')
+          expect(element.length).toBe(1)
+          expect(typeof view).toBe('object')
+          element.css('font-size', '20px')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-time-grid .fc-bgevent').css('font-size')).toBe('20px');
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-time-grid .fc-bgevent').css('font-size')).toBe('20px')
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('can return a new element', function(done) {
       it('can return a new element', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return $('<div class="fc-bgevent sup" style="background-color:green">sup g</div>');
-        };
+          return $('<div class="fc-bgevent sup" style="background-color:green">sup g</div>')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-time-grid .sup').length).toBe(1);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-time-grid .sup').length).toBe(1)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('won\'t rendering when returning a new element of the wrong type', function(done) {
       it('won\'t rendering when returning a new element of the wrong type', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return $('<p class="fc-bgevent sup" style="background-color:green">sup g</p>');
-        };
+          return $('<p class="fc-bgevent sup" style="background-color:green">sup g</p>')
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-time-grid .sup').length).toBe(0);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
+          expect($('.fc-time-grid .sup').length).toBe(0)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
       it('can return false and cancel rendering', function(done) {
       it('can return false and cancel rendering', function(done) {
         options.eventRender = function(event, element, view) {
         options.eventRender = function(event, element, view) {
-          return false;
-        };
+          return false
+        }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-time-grid .fc-bgevent').length).toBe(0);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
-    });
+          expect($('.fc-time-grid .fc-bgevent').length).toBe(0)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
+    })
 
 
     describe('with an all-day background event', function() { // not exactly related to eventRender!
     describe('with an all-day background event', function() { // not exactly related to eventRender!
       beforeEach(function() {
       beforeEach(function() {
@@ -275,19 +275,19 @@ describe('eventRender', function() {
           title: 'my event',
           title: 'my event',
           start: '2014-11-12',
           start: '2014-11-12',
           rendering: 'background'
           rendering: 'background'
-        } ];
-      });
+        } ]
+      })
       it('will render in the all-day slot', function(done) {
       it('will render in the all-day slot', function(done) {
-        options.eventRender = function(event, element, view) { };
+        options.eventRender = function(event, element, view) { }
         options.eventAfterAllRender = function() {
         options.eventAfterAllRender = function() {
-          expect($('.fc-day-grid .fc-bgevent').length).toBe(1);
-          expect($('.fc-time-grid .fc-bgevent').length).toBe(0);
-          expect(options.eventRender).toHaveBeenCalled();
-          done();
-        };
-        spyOn(options, 'eventRender').and.callThrough();
-        $('#cal').fullCalendar(options);
-      });
-    });
-  });
-});
+          expect($('.fc-day-grid .fc-bgevent').length).toBe(1)
+          expect($('.fc-time-grid .fc-bgevent').length).toBe(0)
+          expect(options.eventRender).toHaveBeenCalled()
+          done()
+        }
+        spyOn(options, 'eventRender').and.callThrough()
+        $('#cal').fullCalendar(options)
+      })
+    })
+  })
+})

+ 29 - 29
tests/legacy/eventRenderWait.js

@@ -4,54 +4,54 @@ describe('eventRenderWait', function() {
     var eventSource1 = [
     var eventSource1 = [
       { title: 'event1', start: '2016-12-04T01:00:00', className: 'event1' },
       { title: 'event1', start: '2016-12-04T01:00:00', className: 'event1' },
       { title: 'event2', start: '2016-12-04T02:00:00', className: 'event2' }
       { title: 'event2', start: '2016-12-04T02:00:00', className: 'event2' }
-    ];
+    ]
     var eventSource2 = [
     var eventSource2 = [
       { title: 'event3', start: '2016-12-04T03:00:00', className: 'event3' },
       { title: 'event3', start: '2016-12-04T03:00:00', className: 'event3' },
       { title: 'event4', start: '2016-12-04T04:00:00', className: 'event4' }
       { title: 'event4', start: '2016-12-04T04:00:00', className: 'event4' }
-    ];
-    var extraEvent1 = { title: 'event5', start: '2016-12-04T05:00:00', className: 'event5', id: '5' };
-    var extraEvent2 = { title: 'event6', start: '2016-12-04T06:00:00', className: 'event6', id: '6' };
-    var eventRenderCnt = 0;
+    ]
+    var extraEvent1 = { title: 'event5', start: '2016-12-04T05:00:00', className: 'event5', id: '5' }
+    var extraEvent2 = { title: 'event6', start: '2016-12-04T06:00:00', className: 'event6', id: '6' }
+    var eventRenderCnt = 0
 
 
-    affix('#cal');
+    affix('#cal')
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
       defaultDate: '2016-12-04',
       defaultDate: '2016-12-04',
       defaultView: 'agendaDay',
       defaultView: 'agendaDay',
       events: eventSource1,
       events: eventSource1,
       eventRenderWait: 0, // will still debounce despite being zero
       eventRenderWait: 0, // will still debounce despite being zero
       eventAfterAllRender: function() {
       eventAfterAllRender: function() {
-        eventRenderCnt++;
+        eventRenderCnt++
         if (eventRenderCnt === 1) {
         if (eventRenderCnt === 1) {
 
 
-          expect($('.event1').length).toBe(1);
-          expect($('.event2').length).toBe(1);
-          expect($('.event3').length).toBe(1);
-          expect($('.event4').length).toBe(1);
-          expect($('.event5').length).toBe(1);
-          expect($('.event6').length).toBe(0); // got removed
+          expect($('.event1').length).toBe(1)
+          expect($('.event2').length).toBe(1)
+          expect($('.event3').length).toBe(1)
+          expect($('.event4').length).toBe(1)
+          expect($('.event5').length).toBe(1)
+          expect($('.event6').length).toBe(0) // got removed
 
 
           // make sure doesn't fire again
           // make sure doesn't fire again
           setTimeout(function() {
           setTimeout(function() {
-            expect(eventRenderCnt).toBe(1);
-            done();
-          }, 1000);
+            expect(eventRenderCnt).toBe(1)
+            done()
+          }, 1000)
         }
         }
       }
       }
-    });
+    })
 
 
-    var calendar = $('#cal').fullCalendar('getCalendar');
-    expect($('.fc-event').length).toBe(0);
+    var calendar = $('#cal').fullCalendar('getCalendar')
+    expect($('.fc-event').length).toBe(0)
 
 
-    calendar.addEventSource(eventSource2);
-    expect($('.fc-event').length).toBe(0);
+    calendar.addEventSource(eventSource2)
+    expect($('.fc-event').length).toBe(0)
 
 
-    calendar.renderEvent(extraEvent1);
-    expect($('.fc-event').length).toBe(0);
+    calendar.renderEvent(extraEvent1)
+    expect($('.fc-event').length).toBe(0)
 
 
-    calendar.renderEvent(extraEvent2);
-    expect($('.fc-event').length).toBe(0);
+    calendar.renderEvent(extraEvent2)
+    expect($('.fc-event').length).toBe(0)
 
 
-    calendar.removeEvents(extraEvent2.id); // only works with id!?
-    expect($('.fc-event').length).toBe(0);
-  });
-});
+    calendar.removeEvents(extraEvent2.id) // only works with id!?
+    expect($('.fc-event').length).toBe(0)
+  })
+})

+ 20 - 20
tests/legacy/events-array.js

@@ -3,7 +3,7 @@ describe('events as an array', function() {
   pushOptions({
   pushOptions({
     defaultView: 'month',
     defaultView: 'month',
     defaultDate: '2014-05-01'
     defaultDate: '2014-05-01'
-  });
+  })
 
 
   function getEventArray() {
   function getEventArray() {
     return [
     return [
@@ -11,18 +11,18 @@ describe('events as an array', function() {
         title: 'my event',
         title: 'my event',
         start: '2014-05-21'
         start: '2014-05-21'
       }
       }
-    ];
+    ]
   }
   }
 
 
   it('accepts an event using basic form', function(done) {
   it('accepts an event using basic form', function(done) {
     initCalendar({
     initCalendar({
       events: getEventArray(),
       events: getEventArray(),
       eventRender: function(eventObj, eventElm) {
       eventRender: function(eventObj, eventElm) {
-        expect(eventObj.title).toEqual('my event');
-        done();
+        expect(eventObj.title).toEqual('my event')
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('accepts an event using extended form', function(done) {
   it('accepts an event using extended form', function(done) {
     initCalendar({
     initCalendar({
@@ -33,25 +33,25 @@ describe('events as an array', function() {
         }
         }
       ],
       ],
       eventRender: function(eventObj, eventElm) {
       eventRender: function(eventObj, eventElm) {
-        expect(eventObj.title).toEqual('my event');
-        expect(eventElm).toHaveClass('customeventclass');
-        done();
+        expect(eventObj.title).toEqual('my event')
+        expect(eventElm).toHaveClass('customeventclass')
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('doesn\'t mutate the original array', function(done) {
   it('doesn\'t mutate the original array', function(done) {
-    var eventArray = getEventArray();
-    var origArray = eventArray;
-    var origEvent = eventArray[0];
+    var eventArray = getEventArray()
+    var origArray = eventArray
+    var origEvent = eventArray[0]
     initCalendar({
     initCalendar({
       events: eventArray,
       events: eventArray,
       eventRender: function(eventObj, eventElm) {
       eventRender: function(eventObj, eventElm) {
-        expect(origArray).toEqual(eventArray);
-        expect(origEvent).toEqual(eventArray[0]);
-        done();
+        expect(origArray).toEqual(eventArray)
+        expect(origEvent).toEqual(eventArray[0])
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
-});
+})

+ 100 - 101
tests/legacy/events-function.js

@@ -1,142 +1,141 @@
 
 
 describe('events as a function', function() {
 describe('events as a function', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
     options = {
     options = {
       defaultView: 'month',
       defaultView: 'month',
       defaultDate: '2014-05-01'
       defaultDate: '2014-05-01'
-    };
-  });
+    }
+  })
 
 
   it('requests correctly when no timezone', function(done) {
   it('requests correctly when no timezone', function(done) {
     options.events = function(start, end, timezone, callback) {
     options.events = function(start, end, timezone, callback) {
-      expect(moment.isMoment(start)).toEqual(true);
-      expect(start.hasTime()).toEqual(false);
-      expect(start.hasZone()).toEqual(false);
-      expect(start.format()).toEqual('2014-04-27');
-      expect(moment.isMoment(end)).toEqual(true);
-      expect(end.hasTime()).toEqual(false);
-      expect(end.hasZone()).toEqual(false);
-      expect(end.format()).toEqual('2014-06-08');
-      expect(timezone).toEqual(false);
-      expect(typeof callback).toEqual('function');
-      callback([]);
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(moment.isMoment(start)).toEqual(true)
+      expect(start.hasTime()).toEqual(false)
+      expect(start.hasZone()).toEqual(false)
+      expect(start.format()).toEqual('2014-04-27')
+      expect(moment.isMoment(end)).toEqual(true)
+      expect(end.hasTime()).toEqual(false)
+      expect(end.hasZone()).toEqual(false)
+      expect(end.format()).toEqual('2014-06-08')
+      expect(timezone).toEqual(false)
+      expect(typeof callback).toEqual('function')
+      callback([])
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('requests correctly when local timezone', function(done) {
   it('requests correctly when local timezone', function(done) {
-    options.timezone = 'local';
+    options.timezone = 'local'
     options.events = function(start, end, timezone, callback) {
     options.events = function(start, end, timezone, callback) {
-      expect(moment.isMoment(start)).toEqual(true);
-      expect(start.hasTime()).toEqual(false);
-      expect(start.hasZone()).toEqual(false);
-      expect(start.format()).toEqual('2014-04-27');
-      expect(moment.isMoment(end)).toEqual(true);
-      expect(end.hasTime()).toEqual(false);
-      expect(end.hasZone()).toEqual(false);
-      expect(end.format()).toEqual('2014-06-08');
-      expect(timezone).toEqual('local');
-      expect(typeof callback).toEqual('function');
-      callback([]);
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(moment.isMoment(start)).toEqual(true)
+      expect(start.hasTime()).toEqual(false)
+      expect(start.hasZone()).toEqual(false)
+      expect(start.format()).toEqual('2014-04-27')
+      expect(moment.isMoment(end)).toEqual(true)
+      expect(end.hasTime()).toEqual(false)
+      expect(end.hasZone()).toEqual(false)
+      expect(end.format()).toEqual('2014-06-08')
+      expect(timezone).toEqual('local')
+      expect(typeof callback).toEqual('function')
+      callback([])
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('requests correctly when UTC timezone', function(done) {
   it('requests correctly when UTC timezone', function(done) {
-    options.timezone = 'UTC';
+    options.timezone = 'UTC'
     options.events = function(start, end, timezone, callback) {
     options.events = function(start, end, timezone, callback) {
-      expect(moment.isMoment(start)).toEqual(true);
-      expect(start.hasTime()).toEqual(false);
-      expect(start.hasZone()).toEqual(false);
-      expect(start.format()).toEqual('2014-04-27');
-      expect(moment.isMoment(end)).toEqual(true);
-      expect(end.hasTime()).toEqual(false);
-      expect(end.hasZone()).toEqual(false);
-      expect(end.format()).toEqual('2014-06-08');
-      expect(timezone).toEqual('UTC');
-      expect(typeof callback).toEqual('function');
-      callback([]);
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(moment.isMoment(start)).toEqual(true)
+      expect(start.hasTime()).toEqual(false)
+      expect(start.hasZone()).toEqual(false)
+      expect(start.format()).toEqual('2014-04-27')
+      expect(moment.isMoment(end)).toEqual(true)
+      expect(end.hasTime()).toEqual(false)
+      expect(end.hasZone()).toEqual(false)
+      expect(end.format()).toEqual('2014-06-08')
+      expect(timezone).toEqual('UTC')
+      expect(typeof callback).toEqual('function')
+      callback([])
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('requests correctly when custom timezone', function(done) {
   it('requests correctly when custom timezone', function(done) {
-    options.timezone = 'America/Chicago';
+    options.timezone = 'America/Chicago'
     options.events = function(start, end, timezone, callback) {
     options.events = function(start, end, timezone, callback) {
-      expect(moment.isMoment(start)).toEqual(true);
-      expect(start.hasTime()).toEqual(false);
-      expect(start.hasZone()).toEqual(false);
-      expect(start.format()).toEqual('2014-04-27');
-      expect(moment.isMoment(end)).toEqual(true);
-      expect(end.hasTime()).toEqual(false);
-      expect(end.hasZone()).toEqual(false);
-      expect(end.format()).toEqual('2014-06-08');
-      expect(timezone).toEqual('America/Chicago');
-      expect(typeof callback).toEqual('function');
-      callback([]);
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(moment.isMoment(start)).toEqual(true)
+      expect(start.hasTime()).toEqual(false)
+      expect(start.hasZone()).toEqual(false)
+      expect(start.format()).toEqual('2014-04-27')
+      expect(moment.isMoment(end)).toEqual(true)
+      expect(end.hasTime()).toEqual(false)
+      expect(end.hasZone()).toEqual(false)
+      expect(end.format()).toEqual('2014-06-08')
+      expect(timezone).toEqual('America/Chicago')
+      expect(typeof callback).toEqual('function')
+      callback([])
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('requests correctly when timezone changed dynamically', function(done) {
   it('requests correctly when timezone changed dynamically', function(done) {
-    var callCnt = 0;
+    var callCnt = 0
 
 
-    options.timezone = 'America/Chicago';
+    options.timezone = 'America/Chicago'
     options.events = function(start, end, timezone, callback) {
     options.events = function(start, end, timezone, callback) {
-      callCnt++;
+      callCnt++
       if (callCnt === 1) {
       if (callCnt === 1) {
-        expect(timezone).toEqual('America/Chicago');
+        expect(timezone).toEqual('America/Chicago')
         setTimeout(function() {
         setTimeout(function() {
-          $('#cal').fullCalendar('option', 'timezone', 'UTC');
-        }, 0);
+          $('#cal').fullCalendar('option', 'timezone', 'UTC')
+        }, 0)
+      } else if (callCnt === 2) {
+        expect(timezone).toEqual('UTC')
+        done()
       }
       }
-      else if (callCnt === 2) {
-        expect(timezone).toEqual('UTC');
-        done();
-      }
-    };
+    }
 
 
-    $('#cal').fullCalendar(options);
-  });
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('requests correctly with event source extended form', function(done) {
   it('requests correctly with event source extended form', function(done) {
     var eventSource = {
     var eventSource = {
       className: 'customeventclass',
       className: 'customeventclass',
       events: function(start, end, timezone, callback) {
       events: function(start, end, timezone, callback) {
-        expect(moment.isMoment(start)).toEqual(true);
-        expect(start.hasTime()).toEqual(false);
-        expect(start.hasZone()).toEqual(false);
-        expect(start.format()).toEqual('2014-04-27');
-        expect(moment.isMoment(end)).toEqual(true);
-        expect(end.hasTime()).toEqual(false);
-        expect(end.hasZone()).toEqual(false);
-        expect(end.format()).toEqual('2014-06-08');
-        expect(timezone).toEqual(false);
-        expect(typeof callback).toEqual('function');
+        expect(moment.isMoment(start)).toEqual(true)
+        expect(start.hasTime()).toEqual(false)
+        expect(start.hasZone()).toEqual(false)
+        expect(start.format()).toEqual('2014-04-27')
+        expect(moment.isMoment(end)).toEqual(true)
+        expect(end.hasTime()).toEqual(false)
+        expect(end.hasZone()).toEqual(false)
+        expect(end.format()).toEqual('2014-06-08')
+        expect(timezone).toEqual(false)
+        expect(typeof callback).toEqual('function')
         callback([
         callback([
           {
           {
             title: 'event1',
             title: 'event1',
             start: '2014-05-10'
             start: '2014-05-10'
           }
           }
-        ]);
+        ])
       }
       }
-    };
-    spyOn(eventSource, 'events').and.callThrough();
-    options.eventSources = [ eventSource ];
+    }
+    spyOn(eventSource, 'events').and.callThrough()
+    options.eventSources = [ eventSource ]
     options.eventRender = function(eventObj, eventElm) {
     options.eventRender = function(eventObj, eventElm) {
-      expect(eventSource.events.calls.count()).toEqual(1);
-      expect(eventElm).toHaveClass('customeventclass');
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(eventSource.events.calls.count()).toEqual(1)
+      expect(eventElm).toHaveClass('customeventclass')
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
-});
+})

+ 248 - 249
tests/legacy/events-gcal.js

@@ -1,380 +1,379 @@
 
 
 xdescribe('Google Calendar plugin', function() {
 xdescribe('Google Calendar plugin', function() {
 
 
-  var API_KEY = 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE';
-  var HOLIDAY_CALENDAR_ID = 'en.usa#[email protected]';
-  var options;
-  var currentWarnArgs;
-  var oldConsoleWarn;
+  var API_KEY = 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE'
+  var HOLIDAY_CALENDAR_ID = 'en.usa#[email protected]'
+  var options
+  var currentWarnArgs
+  var oldConsoleWarn
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
 
 
     options = {
     options = {
       defaultView: 'month',
       defaultView: 'month',
       defaultDate: '2016-11-01'
       defaultDate: '2016-11-01'
-    };
+    }
 
 
     // Intercept calls to console.warn
     // Intercept calls to console.warn
-    currentWarnArgs = null;
-    oldConsoleWarn = console.warn;
+    currentWarnArgs = null
+    oldConsoleWarn = console.warn
     console.warn = function() {
     console.warn = function() {
-      currentWarnArgs = arguments;
-    };
-  });
+      currentWarnArgs = arguments
+    }
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    $.mockjax.clear();
-    $.mockjaxSettings.log = function() { };
-    console.warn = oldConsoleWarn;
-  });
+    $.mockjax.clear()
+    $.mockjaxSettings.log = function() { }
+    console.warn = oldConsoleWarn
+  })
 
 
   it('request/receives correctly when local timezone', function(done) {
   it('request/receives correctly when local timezone', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID };
-    options.timezone = 'local';
+    options.googleCalendarApiKey = API_KEY
+    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID }
+    options.timezone = 'local'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var currentRequest = $.mockjax.unmockedAjaxCalls()[0];
-      var events = $('#cal').fullCalendar('clientEvents');
-      var i;
+      var currentRequest = $.mockjax.unmockedAjaxCalls()[0]
+      var events = $('#cal').fullCalendar('clientEvents')
+      var i
 
 
-      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z'); // one day before, by design
-      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z'); // one day after, by design
-      expect(currentRequest.data.timeZone).toBeUndefined();
+      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z') // one day before, by design
+      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z') // one day after, by design
+      expect(currentRequest.data.timeZone).toBeUndefined()
 
 
-      expect(events.length).toBe(5);
+      expect(events.length).toBe(5)
       for (i = 0; i < events.length; i++) {
       for (i = 0; i < events.length; i++) {
-        expect(events[i].url).not.toMatch('ctz=');
+        expect(events[i].url).not.toMatch('ctz=')
       }
       }
 
 
-      done();
-    };
+      done()
+    }
     options.googleCalendarError = function(xhr, message) {
     options.googleCalendarError = function(xhr, message) {
-      console.log('GCAL ERROR', message);
-    };
-    $('#cal').fullCalendar(options);
-  });
+      console.log('GCAL ERROR', message)
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('request/receives correctly when UTC timezone', function(done) {
   it('request/receives correctly when UTC timezone', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID };
-    options.timezone = 'UTC';
+    options.googleCalendarApiKey = API_KEY
+    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID }
+    options.timezone = 'UTC'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var currentRequest = $.mockjax.unmockedAjaxCalls()[0];
-      var events = $('#cal').fullCalendar('clientEvents');
-      var i;
+      var currentRequest = $.mockjax.unmockedAjaxCalls()[0]
+      var events = $('#cal').fullCalendar('clientEvents')
+      var i
 
 
-      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z'); // one day before, by design
-      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z'); // one day after, by design
-      expect(currentRequest.data.timeZone).toEqual('UTC');
+      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z') // one day before, by design
+      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z') // one day after, by design
+      expect(currentRequest.data.timeZone).toEqual('UTC')
 
 
-      expect(events.length).toBe(5);
+      expect(events.length).toBe(5)
       for (i = 0; i < events.length; i++) {
       for (i = 0; i < events.length; i++) {
-        expect(events[i].url).toMatch('ctz=UTC');
+        expect(events[i].url).toMatch('ctz=UTC')
       }
       }
 
 
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('request/receives correctly when custom timezone', function(done) {
   it('request/receives correctly when custom timezone', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID };
-    options.timezone = 'America/New York';
+    options.googleCalendarApiKey = API_KEY
+    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID }
+    options.timezone = 'America/New York'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var currentRequest = $.mockjax.unmockedAjaxCalls()[0];
-      var events = $('#cal').fullCalendar('clientEvents');
-      var i;
+      var currentRequest = $.mockjax.unmockedAjaxCalls()[0]
+      var events = $('#cal').fullCalendar('clientEvents')
+      var i
 
 
-      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z'); // one day before, by design
-      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z'); // one day after, by design
-      expect(currentRequest.data.timeZone).toEqual('America/New_York'); // space should be escaped
+      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z') // one day before, by design
+      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z') // one day after, by design
+      expect(currentRequest.data.timeZone).toEqual('America/New_York') // space should be escaped
 
 
-      expect(events.length).toBe(5);
+      expect(events.length).toBe(5)
       for (i = 0; i < events.length; i++) {
       for (i = 0; i < events.length; i++) {
-        expect(events[i].url).toMatch('ctz=America/New_York');
+        expect(events[i].url).toMatch('ctz=America/New_York')
       }
       }
 
 
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('requests/receives correctly when no timezone, defaults to not editable', function(done) {
   it('requests/receives correctly when no timezone, defaults to not editable', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID };
+    options.googleCalendarApiKey = API_KEY
+    options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID }
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var currentRequest = $.mockjax.unmockedAjaxCalls()[0];
-      var events = $('#cal').fullCalendar('clientEvents');
-      var eventEls = $('.fc-event');
-      var i;
+      var currentRequest = $.mockjax.unmockedAjaxCalls()[0]
+      var events = $('#cal').fullCalendar('clientEvents')
+      var eventEls = $('.fc-event')
+      var i
 
 
-      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z'); // one day before, by design
-      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z'); // one day after, by design
-      expect(currentRequest.data.timeZone).toBeUndefined();
+      expect(currentRequest.data.timeMin).toEqual('2016-10-29T00:00:00Z') // one day before, by design
+      expect(currentRequest.data.timeMax).toEqual('2016-12-12T00:00:00Z') // one day after, by design
+      expect(currentRequest.data.timeZone).toBeUndefined()
 
 
-      expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
+      expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
       for (i = 0; i < events.length; i++) {
       for (i = 0; i < events.length; i++) {
-        expect(events[i].url).not.toMatch('ctz=');
+        expect(events[i].url).not.toMatch('ctz=')
       }
       }
 
 
-      expect(eventEls.length).toBe(5);
-      expect(eventEls.find('.fc-resizer').length).toBe(0); // not editable
+      expect(eventEls.length).toBe(5)
+      expect(eventEls.find('.fc-resizer').length).toBe(0) // not editable
 
 
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('allows editable to explicitly be set to true', function(done) {
   it('allows editable to explicitly be set to true', function(done) {
-    options.googleCalendarApiKey = API_KEY;
+    options.googleCalendarApiKey = API_KEY
     options.events = {
     options.events = {
       googleCalendarId: HOLIDAY_CALENDAR_ID,
       googleCalendarId: HOLIDAY_CALENDAR_ID,
       editable: true
       editable: true
-    };
+    }
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var eventEls = $('.fc-event');
-      expect(eventEls.length).toBe(5);
-      expect(eventEls.find('.fc-resizer').length).toBeGreaterThan(0); // editable!
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var eventEls = $('.fc-event')
+      expect(eventEls.length).toBe(5)
+      expect(eventEls.find('.fc-resizer').length).toBeGreaterThan(0) // editable!
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('fetches events correctly when API key is in the event source', function(done) {
   it('fetches events correctly when API key is in the event source', function(done) {
     options.events = {
     options.events = {
       googleCalendarId: HOLIDAY_CALENDAR_ID,
       googleCalendarId: HOLIDAY_CALENDAR_ID,
       googleCalendarApiKey: API_KEY
       googleCalendarApiKey: API_KEY
-    };
+    }
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var events = $('#cal').fullCalendar('clientEvents');
-      expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var events = $('#cal').fullCalendar('clientEvents')
+      expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   describe('when not given an API key', function() {
   describe('when not given an API key', function() {
     it('calls error handlers, raises warning, and receives no events', function(done) {
     it('calls error handlers, raises warning, and receives no events', function(done) {
       options.googleCalendarError = function(err) {
       options.googleCalendarError = function(err) {
-        expect(typeof err).toBe('object');
-      };
+        expect(typeof err).toBe('object')
+      }
       options.events = {
       options.events = {
         googleCalendarError: function(err) {
         googleCalendarError: function(err) {
-          expect(typeof err).toBe('object');
+          expect(typeof err).toBe('object')
         },
         },
         googleCalendarId: HOLIDAY_CALENDAR_ID
         googleCalendarId: HOLIDAY_CALENDAR_ID
-      };
+      }
       options.eventAfterAllRender = function() {
       options.eventAfterAllRender = function() {
-        var currentRequest = $.mockjax.unmockedAjaxCalls()[0];
-        var events = $('#cal').fullCalendar('clientEvents');
-
-        expect(events.length).toBe(0);
-        expect(currentWarnArgs.length).toBeGreaterThan(0);
-        expect(options.googleCalendarError).toHaveBeenCalled();
-        expect(options.events.googleCalendarError).toHaveBeenCalled();
-        expect(currentRequest).toBeUndefined(); // AJAX request should have never been made!
-        done();
-      };
-      spyOn(options, 'googleCalendarError').and.callThrough();
-      spyOn(options.events, 'googleCalendarError').and.callThrough();
-      $('#cal').fullCalendar(options);
-    });
-  });
+        var currentRequest = $.mockjax.unmockedAjaxCalls()[0]
+        var events = $('#cal').fullCalendar('clientEvents')
+
+        expect(events.length).toBe(0)
+        expect(currentWarnArgs.length).toBeGreaterThan(0)
+        expect(options.googleCalendarError).toHaveBeenCalled()
+        expect(options.events.googleCalendarError).toHaveBeenCalled()
+        expect(currentRequest).toBeUndefined() // AJAX request should have never been made!
+        done()
+      }
+      spyOn(options, 'googleCalendarError').and.callThrough()
+      spyOn(options.events, 'googleCalendarError').and.callThrough()
+      $('#cal').fullCalendar(options)
+    })
+  })
 
 
   describe('when given a bad API key', function() {
   describe('when given a bad API key', function() {
     it('calls error handlers, raises warning, and receives no event', function(done) {
     it('calls error handlers, raises warning, and receives no event', function(done) {
-      options.googleCalendarApiKey = 'asdfasdfasdf';
+      options.googleCalendarApiKey = 'asdfasdfasdf'
       options.googleCalendarError = function(err) {
       options.googleCalendarError = function(err) {
-        expect(typeof err).toBe('object');
-      };
+        expect(typeof err).toBe('object')
+      }
       options.events = {
       options.events = {
         googleCalendarError: function(err) {
         googleCalendarError: function(err) {
-          expect(typeof err).toBe('object');
+          expect(typeof err).toBe('object')
         },
         },
         googleCalendarId: HOLIDAY_CALENDAR_ID
         googleCalendarId: HOLIDAY_CALENDAR_ID
-      };
+      }
       options.eventAfterAllRender = function() {
       options.eventAfterAllRender = function() {
-        var currentRequest = $.mockjax.unmockedAjaxCalls()[0];
-        var events = $('#cal').fullCalendar('clientEvents');
-
-        expect(events.length).toBe(0);
-        expect(currentWarnArgs.length).toBeGreaterThan(0);
-        expect(options.googleCalendarError).toHaveBeenCalled();
-        expect(options.events.googleCalendarError).toHaveBeenCalled();
-        expect(typeof currentRequest).toBe('object'); // request should have been sent
-        done();
-      };
-      spyOn(options, 'googleCalendarError').and.callThrough();
-      spyOn(options.events, 'googleCalendarError').and.callThrough();
-      $('#cal').fullCalendar(options);
-    });
-  });
+        var currentRequest = $.mockjax.unmockedAjaxCalls()[0]
+        var events = $('#cal').fullCalendar('clientEvents')
+
+        expect(events.length).toBe(0)
+        expect(currentWarnArgs.length).toBeGreaterThan(0)
+        expect(options.googleCalendarError).toHaveBeenCalled()
+        expect(options.events.googleCalendarError).toHaveBeenCalled()
+        expect(typeof currentRequest).toBe('object') // request should have been sent
+        done()
+      }
+      spyOn(options, 'googleCalendarError').and.callThrough()
+      spyOn(options.events, 'googleCalendarError').and.callThrough()
+      $('#cal').fullCalendar(options)
+    })
+  })
 
 
   it('works when `events` is the actual calendar ID', function(done) {
   it('works when `events` is the actual calendar ID', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = HOLIDAY_CALENDAR_ID;
+    options.googleCalendarApiKey = API_KEY
+    options.events = HOLIDAY_CALENDAR_ID
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var events = $('#cal').fullCalendar('clientEvents');
-      expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var events = $('#cal').fullCalendar('clientEvents')
+      expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('detects a gcal when `events` is the actual calendar ID, with complicated characters (1)', function(done) {
   it('detects a gcal when `events` is the actual calendar ID, with complicated characters (1)', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = '[email protected]';
+    options.googleCalendarApiKey = API_KEY
+    options.events = '[email protected]'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      expect(currentWarnArgs.length).toBe(2);
-      expect(typeof currentWarnArgs[1]).toBe('object'); // sent the request to google, but not-found warning
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(currentWarnArgs.length).toBe(2)
+      expect(typeof currentWarnArgs[1]).toBe('object') // sent the request to google, but not-found warning
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('detects a gcal when `events` is the actual calendar ID, with complicated characters (2)', function(done) {
   it('detects a gcal when `events` is the actual calendar ID, with complicated characters (2)', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = '[email protected]';
+    options.googleCalendarApiKey = API_KEY
+    options.events = '[email protected]'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      expect(currentWarnArgs.length).toBe(2);
-      expect(typeof currentWarnArgs[1]).toBe('object'); // sent the request to google, but not-found warning
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(currentWarnArgs.length).toBe(2)
+      expect(typeof currentWarnArgs[1]).toBe('object') // sent the request to google, but not-found warning
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('detects a gcal when `events` is the actual calendar ID, person gmail', function(done) {
   it('detects a gcal when `events` is the actual calendar ID, person gmail', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = '[email protected]';
+    options.googleCalendarApiKey = API_KEY
+    options.events = '[email protected]'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      expect(currentWarnArgs.length).toBe(2);
-      expect(typeof currentWarnArgs[1]).toBe('object'); // sent the request to google, but not-found warning
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(currentWarnArgs.length).toBe(2)
+      expect(typeof currentWarnArgs[1]).toBe('object') // sent the request to google, but not-found warning
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('detects a gcal when `events` is the actual calendar ID, person googlemail', function(done) {
   it('detects a gcal when `events` is the actual calendar ID, person googlemail', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = '[email protected]';
+    options.googleCalendarApiKey = API_KEY
+    options.events = '[email protected]'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      expect(currentWarnArgs.length).toBe(2);
-      expect(typeof currentWarnArgs[1]).toBe('object'); // sent the request to google, but not-found warning
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      expect(currentWarnArgs.length).toBe(2)
+      expect(typeof currentWarnArgs[1]).toBe('object') // sent the request to google, but not-found warning
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('works with requesting an HTTP V1 API feed URL', function(done) {
   it('works with requesting an HTTP V1 API feed URL', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic';
+    options.googleCalendarApiKey = API_KEY
+    options.events = 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var events = $('#cal').fullCalendar('clientEvents');
-      expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var events = $('#cal').fullCalendar('clientEvents')
+      expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('works with requesting an HTTPS V1 API feed URL', function(done) {
   it('works with requesting an HTTPS V1 API feed URL', function(done) {
-    options.googleCalendarApiKey = API_KEY;
-    options.events = 'https://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic';
+    options.googleCalendarApiKey = API_KEY
+    options.events = 'https://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var events = $('#cal').fullCalendar('clientEvents');
-      expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var events = $('#cal').fullCalendar('clientEvents')
+      expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('works with requesting an V3 API feed URL', function(done) {
   it('works with requesting an V3 API feed URL', function(done) {
-    options.googleCalendarApiKey = API_KEY;
+    options.googleCalendarApiKey = API_KEY
     options.events =
     options.events =
-      'https://www.googleapis.com/calendar/v3/calendars/usa__en%40holiday.calendar.google.com/events';
+      'https://www.googleapis.com/calendar/v3/calendars/usa__en%40holiday.calendar.google.com/events'
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var events = $('#cal').fullCalendar('clientEvents');
-      expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var events = $('#cal').fullCalendar('clientEvents')
+      expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('calls loading with true then false', function(done) {
   it('calls loading with true then false', function(done) {
-    var cmds = [];
+    var cmds = []
 
 
-    options.googleCalendarApiKey = API_KEY;
+    options.googleCalendarApiKey = API_KEY
     options.events =
     options.events =
-      'https://www.googleapis.com/calendar/v3/calendars/usa__en%40holiday.calendar.google.com/events';
+      'https://www.googleapis.com/calendar/v3/calendars/usa__en%40holiday.calendar.google.com/events'
 
 
     options.loading = function(bool) {
     options.loading = function(bool) {
-      cmds.push(bool);
+      cmds.push(bool)
 
 
       if (cmds.length === 1) {
       if (cmds.length === 1) {
-        expect(cmds).toEqual([ true ]);
+        expect(cmds).toEqual([ true ])
+      } else if (cmds.length == 2) {
+        expect(cmds).toEqual([ true, false ])
+        done()
       }
       }
-      else if (cmds.length == 2) {
-        expect(cmds).toEqual([ true, false ]);
-        done();
-      }
-    };
-    $('#cal').fullCalendar(options);
-  });
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   describe('removeEventSource', function() {
   describe('removeEventSource', function() {
 
 
     it('works when specifying only the Google Calendar ID', function(done) {
     it('works when specifying only the Google Calendar ID', function(done) {
-      var CALENDAR_ID = HOLIDAY_CALENDAR_ID;
-      var called = false;
+      var CALENDAR_ID = HOLIDAY_CALENDAR_ID
+      var called = false
 
 
-      options.googleCalendarApiKey = API_KEY;
-      options.eventSources = [ { googleCalendarId: HOLIDAY_CALENDAR_ID } ];
+      options.googleCalendarApiKey = API_KEY
+      options.eventSources = [ { googleCalendarId: HOLIDAY_CALENDAR_ID } ]
       options.eventAfterAllRender = function() {
       options.eventAfterAllRender = function() {
-        var events;
+        var events
 
 
-        if (called) { return; } // only the first time
-        called = true;
+        if (called) { return } // only the first time
+        called = true
 
 
-        events = $('#cal').fullCalendar('clientEvents');
-        expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
+        events = $('#cal').fullCalendar('clientEvents')
+        expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
 
 
         setTimeout(function() {
         setTimeout(function() {
-          $('#cal').fullCalendar('removeEventSource', HOLIDAY_CALENDAR_ID);
-          events = $('#cal').fullCalendar('clientEvents');
-          expect(events.length).toBe(0);
-          done();
-        }, 0);
-      };
+          $('#cal').fullCalendar('removeEventSource', HOLIDAY_CALENDAR_ID)
+          events = $('#cal').fullCalendar('clientEvents')
+          expect(events.length).toBe(0)
+          done()
+        }, 0)
+      }
 
 
-      $('#cal').fullCalendar(options);
-    });
+      $('#cal').fullCalendar(options)
+    })
 
 
     it('works when specifying a raw Google Calendar source object', function(done) {
     it('works when specifying a raw Google Calendar source object', function(done) {
-      var googleSource = { googleCalendarId: HOLIDAY_CALENDAR_ID };
-      var called = false;
+      var googleSource = { googleCalendarId: HOLIDAY_CALENDAR_ID }
+      var called = false
 
 
-      options.googleCalendarApiKey = API_KEY;
-      options.eventSources = [ googleSource ];
+      options.googleCalendarApiKey = API_KEY
+      options.eventSources = [ googleSource ]
       options.eventAfterAllRender = function() {
       options.eventAfterAllRender = function() {
-        var events;
+        var events
 
 
-        if (called) { return; } // only the first time
-        called = true;
+        if (called) { return } // only the first time
+        called = true
 
 
-        events = $('#cal').fullCalendar('clientEvents');
-        expect(events.length).toBe(5); // 5 holidays in November 2016 (and end of Oct)
+        events = $('#cal').fullCalendar('clientEvents')
+        expect(events.length).toBe(5) // 5 holidays in November 2016 (and end of Oct)
 
 
         setTimeout(function() {
         setTimeout(function() {
-          $('#cal').fullCalendar('removeEventSource', googleSource);
-          events = $('#cal').fullCalendar('clientEvents');
-          expect(events.length).toBe(0);
-          done();
-        }, 0);
-      };
-
-      $('#cal').fullCalendar(options);
-    });
-  });
-
-});
+          $('#cal').fullCalendar('removeEventSource', googleSource)
+          events = $('#cal').fullCalendar('clientEvents')
+          expect(events.length).toBe(0)
+          done()
+        }, 0)
+      }
+
+      $('#cal').fullCalendar(options)
+    })
+  })
+
+})

+ 80 - 80
tests/legacy/events-json-feed.js

@@ -1,15 +1,15 @@
 
 
 describe('events as a json feed', function() {
 describe('events as a json feed', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
 
 
     options = {
     options = {
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       defaultView: 'month'
       defaultView: 'month'
-    };
+    }
 
 
     $.mockjax({
     $.mockjax({
       url: '/my-feed.php',
       url: '/my-feed.php',
@@ -20,70 +20,70 @@ describe('events as a json feed', function() {
           start: '2014-05-21'
           start: '2014-05-21'
         }
         }
       ]
       ]
-    });
-    $.mockjaxSettings.log = function() { }; // don't console.log
-  });
+    })
+    $.mockjaxSettings.log = function() { } // don't console.log
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    $.mockjax.clear();
-  });
+    $.mockjax.clear()
+  })
 
 
   it('requests correctly when no timezone', function() {
   it('requests correctly when no timezone', function() {
-    options.events = '/my-feed.php';
-    $('#cal').fullCalendar(options);
-    var request = $.mockjax.mockedAjaxCalls()[0];
-    expect(request.data.start).toEqual('2014-04-27');
-    expect(request.data.end).toEqual('2014-06-08');
-    expect(request.data.timezone).toBeUndefined();
-  });
+    options.events = '/my-feed.php'
+    $('#cal').fullCalendar(options)
+    var request = $.mockjax.mockedAjaxCalls()[0]
+    expect(request.data.start).toEqual('2014-04-27')
+    expect(request.data.end).toEqual('2014-06-08')
+    expect(request.data.timezone).toBeUndefined()
+  })
 
 
   it('requests correctly when local timezone', function() {
   it('requests correctly when local timezone', function() {
-    options.events = '/my-feed.php';
-    options.timezone = 'local';
-    $('#cal').fullCalendar(options);
-    var request = $.mockjax.mockedAjaxCalls()[0];
-    expect(request.data.start).toEqual('2014-04-27');
-    expect(request.data.end).toEqual('2014-06-08');
-    expect(request.data.timezone).toBeUndefined();
-  });
+    options.events = '/my-feed.php'
+    options.timezone = 'local'
+    $('#cal').fullCalendar(options)
+    var request = $.mockjax.mockedAjaxCalls()[0]
+    expect(request.data.start).toEqual('2014-04-27')
+    expect(request.data.end).toEqual('2014-06-08')
+    expect(request.data.timezone).toBeUndefined()
+  })
 
 
   it('requests correctly when UTC timezone', function() {
   it('requests correctly when UTC timezone', function() {
-    options.events = '/my-feed.php';
-    options.timezone = 'UTC';
-    $('#cal').fullCalendar(options);
-    var request = $.mockjax.mockedAjaxCalls()[0];
-    expect(request.data.start).toEqual('2014-04-27');
-    expect(request.data.end).toEqual('2014-06-08');
-    expect(request.data.timezone).toEqual('UTC');
-  });
+    options.events = '/my-feed.php'
+    options.timezone = 'UTC'
+    $('#cal').fullCalendar(options)
+    var request = $.mockjax.mockedAjaxCalls()[0]
+    expect(request.data.start).toEqual('2014-04-27')
+    expect(request.data.end).toEqual('2014-06-08')
+    expect(request.data.timezone).toEqual('UTC')
+  })
 
 
   it('requests correctly when custom timezone', function() {
   it('requests correctly when custom timezone', function() {
-    options.events = '/my-feed.php';
-    options.timezone = 'America/Chicago';
-    $('#cal').fullCalendar(options);
-    var request = $.mockjax.mockedAjaxCalls()[0];
-    expect(request.data.start).toEqual('2014-04-27');
-    expect(request.data.end).toEqual('2014-06-08');
-    expect(request.data.timezone).toEqual('America/Chicago');
-  });
+    options.events = '/my-feed.php'
+    options.timezone = 'America/Chicago'
+    $('#cal').fullCalendar(options)
+    var request = $.mockjax.mockedAjaxCalls()[0]
+    expect(request.data.start).toEqual('2014-04-27')
+    expect(request.data.end).toEqual('2014-06-08')
+    expect(request.data.timezone).toEqual('America/Chicago')
+  })
 
 
   it('requests correctly with event source extended form', function(done) {
   it('requests correctly with event source extended form', function(done) {
     var eventSource = {
     var eventSource = {
       url: '/my-feed.php',
       url: '/my-feed.php',
       className: 'customeventclass'
       className: 'customeventclass'
-    };
-    options.eventSources = [ eventSource ];
-    options.timezone = 'America/Chicago';
+    }
+    options.eventSources = [ eventSource ]
+    options.timezone = 'America/Chicago'
     options.eventRender = function(eventObj, eventElm) {
     options.eventRender = function(eventObj, eventElm) {
-      var request = $.mockjax.mockedAjaxCalls()[0];
-      expect(request.data.start).toEqual('2014-04-27');
-      expect(request.data.end).toEqual('2014-06-08');
-      expect(request.data.timezone).toEqual('America/Chicago');
-      expect(eventElm).toHaveClass('customeventclass');
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var request = $.mockjax.mockedAjaxCalls()[0]
+      expect(request.data.start).toEqual('2014-04-27')
+      expect(request.data.end).toEqual('2014-06-08')
+      expect(request.data.timezone).toEqual('America/Chicago')
+      expect(eventElm).toHaveClass('customeventclass')
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('accepts jQuery.ajax params', function(done) {
   it('accepts jQuery.ajax params', function(done) {
     var eventSource = {
     var eventSource = {
@@ -92,14 +92,14 @@ describe('events as a json feed', function() {
         customParam: 'yes'
         customParam: 'yes'
       },
       },
       success: function() {
       success: function() {
-        var request = $.mockjax.mockedAjaxCalls()[0];
-        expect(request.data.customParam).toMatch('yes');
-        done();
+        var request = $.mockjax.mockedAjaxCalls()[0]
+        expect(request.data.customParam).toMatch('yes')
+        done()
       }
       }
-    };
-    options.eventSources = [ eventSource ];
-    $('#cal').fullCalendar(options);
-  });
+    }
+    options.eventSources = [ eventSource ]
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('accepts a dynamic data function', function(done) {
   it('accepts a dynamic data function', function(done) {
     var eventSource = {
     var eventSource = {
@@ -107,43 +107,43 @@ describe('events as a json feed', function() {
       data: function() {
       data: function() {
         return {
         return {
           customParam: 'heckyeah'
           customParam: 'heckyeah'
-        };
+        }
       }
       }
-    };
-    options.eventSources = [ eventSource ];
+    }
+    options.eventSources = [ eventSource ]
     options.eventAfterAllRender = function() {
     options.eventAfterAllRender = function() {
-      var request = $.mockjax.mockedAjaxCalls()[0];
-      expect(request.data.customParam).toMatch('heckyeah');
-      done();
-    };
-    $('#cal').fullCalendar(options);
-  });
+      var request = $.mockjax.mockedAjaxCalls()[0]
+      expect(request.data.customParam).toMatch('heckyeah')
+      done()
+    }
+    $('#cal').fullCalendar(options)
+  })
 
 
   it('calls loading callback', function(done) {
   it('calls loading callback', function(done) {
-    var loadingCallArgs = [];
+    var loadingCallArgs = []
 
 
     initCalendar({
     initCalendar({
       events: { url: '/my-feed.php' },
       events: { url: '/my-feed.php' },
       loading: function(bool) {
       loading: function(bool) {
-        loadingCallArgs.push(bool);
+        loadingCallArgs.push(bool)
       },
       },
       eventAfterAllRender: function() {
       eventAfterAllRender: function() {
-        expect(loadingCallArgs).toEqual([ true, false ]);
-        done();
+        expect(loadingCallArgs).toEqual([ true, false ])
+        done()
       }
       }
-    });
-  });
+    })
+  })
 
 
   it('has and Event Source object with certain props', function() {
   it('has and Event Source object with certain props', function() {
-    var url = '/my-feed.php';
-    var source;
+    var url = '/my-feed.php'
+    var source
 
 
     initCalendar({
     initCalendar({
       events: { url: url }
       events: { url: url }
-    });
+    })
 
 
-    source = currentCalendar.getEventSources()[0];
-    expect(source.url).toBe(url);
-  });
+    source = currentCalendar.getEventSources()[0]
+    expect(source.url).toBe(url)
+  })
 
 
-});
+})

+ 226 - 229
tests/legacy/external-dnd-advanced.js

@@ -1,9 +1,9 @@
-import { testEventDrag } from '../lib/dnd-resize-utils';
+import { testEventDrag } from '../lib/dnd-resize-utils'
 
 
-describe('advanced external dnd', function() {  
+describe('advanced external dnd', function() {
 
 
-  beforeEach(function(){
-    affix('.drag');
+  beforeEach(function() {
+    affix('.drag')
     $('.drag')
     $('.drag')
       .text('yo')
       .text('yo')
       .css({
       .css({
@@ -11,60 +11,60 @@ describe('advanced external dnd', function() {
         background: 'blue',
         background: 'blue',
         color: 'white'
         color: 'white'
       })
       })
-      .draggable();
+      .draggable()
   })
   })
   pushOptions({
   pushOptions({
     defaultDate: '2014-11-13',
     defaultDate: '2014-11-13',
     scrollTime: '00:00:00',
     scrollTime: '00:00:00',
     droppable: true
     droppable: true
-  });
+  })
 
 
-  describe('in agenda slots', function() {    
-    pushOptions({defaultView:'agendaWeek'});
+  describe('in agenda slots', function() {
+    pushOptions({defaultView: 'agendaWeek'})
     describe('when no element event data', function() {
     describe('when no element event data', function() {
-      describe('when given duration through defaultTimedEventDuration', function() {        
-        pushOptions({defaultTimedEventDuration:'2:30'});        
-        defineTests();
-      });
+      describe('when given duration through defaultTimedEventDuration', function() {
+        pushOptions({defaultTimedEventDuration: '2:30'})
+        defineTests()
+      })
       describe('when given duration through data-duration', function() {
       describe('when given duration through data-duration', function() {
         beforeEach(function() {
         beforeEach(function() {
-          $('.drag').data('duration', '2:30');
-        });
-        defineTests();
-      });
+          $('.drag').data('duration', '2:30')
+        })
+        defineTests()
+      })
 
 
       function defineTests() {
       function defineTests() {
         it('fires correctly', function(done) {
         it('fires correctly', function(done) {
-          var options = {};
-          testExternalElDrag(options, '2014-11-13T03:00:00', true, done);
-        });
+          var options = {}
+          testExternalElDrag(options, '2014-11-13T03:00:00', true, done)
+        })
         it('is not affected by eventOverlap:false', function(done) {
         it('is not affected by eventOverlap:false', function(done) {
-          var options = {};
-          options.eventOverlap = false;
+          var options = {}
+          options.eventOverlap = false
           options.events = [ {
           options.events = [ {
             start: '2014-11-13T01:00:00',
             start: '2014-11-13T01:00:00',
             end: '2014-11-13T05:00:00'
             end: '2014-11-13T05:00:00'
-          } ];
-          testExternalElDrag(options, '2014-11-13T03:00:00', true, done);
-        });
+          } ]
+          testExternalElDrag(options, '2014-11-13T03:00:00', true, done)
+        })
         it('is not affected by an event object\'s overlap:false', function(done) {
         it('is not affected by an event object\'s overlap:false', function(done) {
-          var options = {};
+          var options = {}
           options.events = [ {
           options.events = [ {
             start: '2014-11-13T01:00:00',
             start: '2014-11-13T01:00:00',
             end: '2014-11-13T05:00:00',
             end: '2014-11-13T05:00:00',
             overlap: false
             overlap: false
-          } ];
-          testExternalElDrag(options, '2014-11-13T03:00:00', true, done);
-        });
+          } ]
+          testExternalElDrag(options, '2014-11-13T03:00:00', true, done)
+        })
         it('is not affected by eventConstraint', function(done) {
         it('is not affected by eventConstraint', function(done) {
-          var options = {};
-          
+          var options = {}
+
           options.eventConstraint = {
           options.eventConstraint = {
             start: '03:00',
             start: '03:00',
             end: '10:00'
             end: '10:00'
-          };
-          testExternalElDrag(options, '2014-11-13T02:00:00', true, done);
-        });
+          }
+          testExternalElDrag(options, '2014-11-13T02:00:00', true, done)
+        })
         describe('with selectOverlap:false', function() {
         describe('with selectOverlap:false', function() {
           pushOptions({
           pushOptions({
             selectOverlap: false,
             selectOverlap: false,
@@ -72,138 +72,138 @@ describe('advanced external dnd', function() {
               start: '2014-11-13T04:00:00',
               start: '2014-11-13T04:00:00',
               end: '2014-11-13T08:00:00'
               end: '2014-11-13T08:00:00'
             }]
             }]
-          });
+          })
           it('is not allowed to overlap an event', function(done) {
           it('is not allowed to overlap an event', function(done) {
-            var options = {};
-            testExternalElDrag(options, '2014-11-13T02:00:00', false, done);
-          });
-        });
+            var options = {}
+            testExternalElDrag(options, '2014-11-13T02:00:00', false, done)
+          })
+        })
         describe('with a selectConstraint', function() {
         describe('with a selectConstraint', function() {
           pushOptions({
           pushOptions({
-            selectConstraint :{
+            selectConstraint: {
               start: '04:00',
               start: '04:00',
-              end: '08:00',
+              end: '08:00'
             }
             }
-          })        
+          })
           it('can be dropped within', function(done) {
           it('can be dropped within', function(done) {
-            var options = {};
-          
-            testExternalElDrag(options, '2014-11-13T05:30:00', true, done);
-          });
+            var options = {}
+
+            testExternalElDrag(options, '2014-11-13T05:30:00', true, done)
+          })
           it('cannot be dropped when not fully contained', function(done) {
           it('cannot be dropped when not fully contained', function(done) {
-            var options = {};
-          
-            testExternalElDrag(options, '2014-11-13T06:00:00', false, done);
-          });
-        });
+            var options = {}
+
+            testExternalElDrag(options, '2014-11-13T06:00:00', false, done)
+          })
+        })
       }
       }
-    });
+    })
 
 
     describe('when event data is given', function() {
     describe('when event data is given', function() {
 
 
       it('fires correctly', function(done) {
       it('fires correctly', function(done) {
-        var options = {};
-        
-        $('.drag').data('event', { title: 'hey' });
-        testExternalEventDrag(options, '2014-11-13T02:00:00', true, done);
-      });
+        var options = {}
+
+        $('.drag').data('event', { title: 'hey' })
+        testExternalEventDrag(options, '2014-11-13T02:00:00', true, done)
+      })
 
 
       describe('when given a start time', function() {
       describe('when given a start time', function() {
         describe('through the event object\'s start property', function() {
         describe('through the event object\'s start property', function() {
           beforeEach(function() {
           beforeEach(function() {
-            $('.drag').data('event', { start: '05:00' });
-          });
-          defineTests();
-        });
+            $('.drag').data('event', { start: '05:00' })
+          })
+          defineTests()
+        })
         describe('through the event object\'s time property', function() {
         describe('through the event object\'s time property', function() {
           beforeEach(function() {
           beforeEach(function() {
-            $('.drag').data('event', { time: '05:00' });
-          });
-          defineTests();
-        });
+            $('.drag').data('event', { time: '05:00' })
+          })
+          defineTests()
+        })
         describe('through the `start` data attribute', function() {
         describe('through the `start` data attribute', function() {
           beforeEach(function() {
           beforeEach(function() {
             $('.drag').data('event', true)
             $('.drag').data('event', true)
-              .data('start', '05:00');
-          });
-          defineTests();
-        });
+              .data('start', '05:00')
+          })
+          defineTests()
+        })
         describe('through the `time` data attribute', function() {
         describe('through the `time` data attribute', function() {
           beforeEach(function() {
           beforeEach(function() {
             $('.drag').data('event', true)
             $('.drag').data('event', true)
-              .data('time', '05:00');
-          });
-          defineTests();
-        });
+              .data('time', '05:00')
+          })
+          defineTests()
+        })
         function defineTests() {
         function defineTests() {
           it('voids the given time when dropped on a timed slot', function(done) {
           it('voids the given time when dropped on a timed slot', function(done) {
-            var options = {};
-          
-            testExternalEventDrag(options, '2014-11-13T02:00:00', true, done);
-              // will test the resulting event object's start
-          });
+            var options = {}
+
+            testExternalEventDrag(options, '2014-11-13T02:00:00', true, done)
+            // will test the resulting event object's start
+          })
         }
         }
-      });
+      })
 
 
       describe('when given a duration', function() {
       describe('when given a duration', function() {
         describe('through the event object\'s duration property', function() {
         describe('through the event object\'s duration property', function() {
           beforeEach(function() {
           beforeEach(function() {
-            $('.drag').data('event', { duration: '05:00' });
-          });
-          defineTests();
-        });
+            $('.drag').data('event', { duration: '05:00' })
+          })
+          defineTests()
+        })
         describe('through the `duration` data attribute', function() {
         describe('through the `duration` data attribute', function() {
           beforeEach(function() {
           beforeEach(function() {
             $('.drag').data('event', true)
             $('.drag').data('event', true)
-              .data('duration', '05:00');
-          });
-          defineTests();
-        });
+              .data('duration', '05:00')
+          })
+          defineTests()
+        })
         function defineTests() {
         function defineTests() {
           it('accepts the given duration when dropped on a timed slot', function(done) {
           it('accepts the given duration when dropped on a timed slot', function(done) {
-            var options = {};
-          
+            var options = {}
+
             testExternalEventDrag(options, '2014-11-13T02:00:00', true, function() {
             testExternalEventDrag(options, '2014-11-13T02:00:00', true, function() {
-              var event = currentCalendar.clientEvents()[0];
-              expect(event.start).toEqualMoment('2014-11-13T02:00:00');
-              expect(event.end).toEqualMoment('2014-11-13T07:00:00');
-              done();
-            });
-          });
+              var event = currentCalendar.clientEvents()[0]
+              expect(event.start).toEqualMoment('2014-11-13T02:00:00')
+              expect(event.end).toEqualMoment('2014-11-13T07:00:00')
+              done()
+            })
+          })
         }
         }
-      });
+      })
 
 
       describe('when given stick:true', function() {
       describe('when given stick:true', function() {
         describe('through the event object', function() {
         describe('through the event object', function() {
           beforeEach(function() {
           beforeEach(function() {
-            $('.drag').data('event', { stick: true });
-          });
-          defineTests();
-        });
+            $('.drag').data('event', { stick: true })
+          })
+          defineTests()
+        })
         describe('through the data attribute', function() {
         describe('through the data attribute', function() {
           beforeEach(function() {
           beforeEach(function() {
             $('.drag').data('event', true)
             $('.drag').data('event', true)
-              .data('stick', true);
-          });
-          defineTests();
-        });
+              .data('stick', true)
+          })
+          defineTests()
+        })
         function defineTests() {
         function defineTests() {
           it('keeps the event when navigating away and back', function(done) {
           it('keeps the event when navigating away and back', function(done) {
-            var options = {};
-          
+            var options = {}
+
             testExternalEventDrag(options, '2014-11-13T02:00:00', true, function() {
             testExternalEventDrag(options, '2014-11-13T02:00:00', true, function() {
               setTimeout(function() { // make sure to escape handlers
               setTimeout(function() { // make sure to escape handlers
-                expect($('.fc-event').length).toBe(1);
-                currentCalendar.next();
-                expect($('.fc-event').length).toBe(0);
-                currentCalendar.prev();
-                expect($('.fc-event').length).toBe(1);
-                done();
-              }, 0);
-            });
-          });
+                expect($('.fc-event').length).toBe(1)
+                currentCalendar.next()
+                expect($('.fc-event').length).toBe(0)
+                currentCalendar.prev()
+                expect($('.fc-event').length).toBe(1)
+                done()
+              }, 0)
+            })
+          })
         }
         }
-      });
+      })
 
 
       describe('when an overlap is specified', function() {
       describe('when an overlap is specified', function() {
         describe('via eventOverlap', function() {
         describe('via eventOverlap', function() {
@@ -214,25 +214,25 @@ describe('advanced external dnd', function() {
               end: '2014-11-13T08:00:00'
               end: '2014-11-13T08:00:00'
             } ]
             } ]
           })
           })
-          beforeEach(function(){
-            $('.drag').data('event', true);
-          });
-          defineTests();
-        });
+          beforeEach(function() {
+            $('.drag').data('event', true)
+          })
+          defineTests()
+        })
         describe('via an overlap on this event', function() {
         describe('via an overlap on this event', function() {
           pushOptions({
           pushOptions({
             events: [{
             events: [{
               start: '2014-11-13T05:00:00',
               start: '2014-11-13T05:00:00',
               end: '2014-11-13T08:00:00'
               end: '2014-11-13T08:00:00'
             }]
             }]
-          });
-          beforeEach(function() {           
+          })
+          beforeEach(function() {
             $('.drag').data('event', {
             $('.drag').data('event', {
               overlap: false
               overlap: false
-            });
-          });
-          defineTests();
-        });
+            })
+          })
+          defineTests()
+        })
         describe('via an overlap on the other event', function() {
         describe('via an overlap on the other event', function() {
           pushOptions({
           pushOptions({
             events: [{
             events: [{
@@ -240,23 +240,23 @@ describe('advanced external dnd', function() {
               end: '2014-11-13T08:00:00',
               end: '2014-11-13T08:00:00',
               overlap: false
               overlap: false
             }]
             }]
-          });
-          beforeEach(function() {           
-            $('.drag').data('event', true);
-          });
-          defineTests();
-        });
+          })
+          beforeEach(function() {
+            $('.drag').data('event', true)
+          })
+          defineTests()
+        })
         function defineTests() {
         function defineTests() {
           it('allows a drop when not colliding with the other event', function(done) {
           it('allows a drop when not colliding with the other event', function(done) {
-            var options = {};
-            testExternalEventDrag(options, '2014-11-13T08:00:00', true, done);
-          });
+            var options = {}
+            testExternalEventDrag(options, '2014-11-13T08:00:00', true, done)
+          })
           it('prevents a drop when colliding with the other event', function(done) {
           it('prevents a drop when colliding with the other event', function(done) {
-            var options = {};           
-            testExternalEventDrag(options, '2014-11-13T06:00:00', false, done);
-          });
+            var options = {}
+            testExternalEventDrag(options, '2014-11-13T06:00:00', false, done)
+          })
         }
         }
-      });
+      })
 
 
       describe('when a constraint is specified', function() {
       describe('when a constraint is specified', function() {
         describe('via eventConstraint', function() {
         describe('via eventConstraint', function() {
@@ -265,12 +265,12 @@ describe('advanced external dnd', function() {
               start: '04:00',
               start: '04:00',
               end: '08:00'
               end: '08:00'
             }
             }
-          });
-          beforeEach(function() {           
-            $('.drag').data('event', { duration: '02:00' });
-          });
-          defineTests();
-        });
+          })
+          beforeEach(function() {
+            $('.drag').data('event', { duration: '02:00' })
+          })
+          defineTests()
+        })
         describe('via the event object\'s constraint property', function() {
         describe('via the event object\'s constraint property', function() {
           beforeEach(function() {
           beforeEach(function() {
             $('.drag').data('event', {
             $('.drag').data('event', {
@@ -279,138 +279,135 @@ describe('advanced external dnd', function() {
                 start: '04:00',
                 start: '04:00',
                 end: '08:00'
                 end: '08:00'
               }
               }
-            });
-          });
-          defineTests();
-        });
+            })
+          })
+          defineTests()
+        })
         function defineTests() {
         function defineTests() {
           it('allows a drop when inside the constraint', function(done) {
           it('allows a drop when inside the constraint', function(done) {
-            var options = {};
-            testExternalEventDrag(options, '2014-11-13T05:00:00', true, done);
-          });
+            var options = {}
+            testExternalEventDrag(options, '2014-11-13T05:00:00', true, done)
+          })
           it('disallows a drop when partially outside of the constraint', function(done) {
           it('disallows a drop when partially outside of the constraint', function(done) {
-            var options = {};           
-            testExternalEventDrag(options, '2014-11-13T07:00:00', false, done);
-          });
+            var options = {}
+            testExternalEventDrag(options, '2014-11-13T07:00:00', false, done)
+          })
         }
         }
-      });
-    });
-  });
+      })
+    })
+  })
 
 
   // TODO: write more tests for DayGrid!
   // TODO: write more tests for DayGrid!
 
 
-  describe('in month whole-days', function() {    
+  describe('in month whole-days', function() {
     pushOptions({
     pushOptions({
       defaultView: 'month'
       defaultView: 'month'
-    });
+    })
 
 
     describe('when event data is given', function() {
     describe('when event data is given', function() {
 
 
       it('fires correctly', function(done) {
       it('fires correctly', function(done) {
-        var options = {};
-        
-        $('.drag').data('event', { title: 'hey' });
-        testExternalEventDrag(options, '2014-11-13', true, done);
-      });
+        var options = {}
+
+        $('.drag').data('event', { title: 'hey' })
+        testExternalEventDrag(options, '2014-11-13', true, done)
+      })
 
 
       describe('when given a start time', function() {
       describe('when given a start time', function() {
         describe('through the event object\'s start property', function() {
         describe('through the event object\'s start property', function() {
           beforeEach(function() {
           beforeEach(function() {
-            $('.drag').data('event', { start: '05:00' });
-          });
-          defineTests();
-        });
+            $('.drag').data('event', { start: '05:00' })
+          })
+          defineTests()
+        })
         describe('through the event object\'s time property', function() {
         describe('through the event object\'s time property', function() {
           beforeEach(function() {
           beforeEach(function() {
-            $('.drag').data('event', { time: '05:00' });
-          });
-          defineTests();
-        });
+            $('.drag').data('event', { time: '05:00' })
+          })
+          defineTests()
+        })
         describe('through the `start` data attribute', function() {
         describe('through the `start` data attribute', function() {
           beforeEach(function() {
           beforeEach(function() {
             $('.drag').data('event', true)
             $('.drag').data('event', true)
-              .data('start', '05:00');
-          });
-          defineTests();
-        });
+              .data('start', '05:00')
+          })
+          defineTests()
+        })
         describe('through the `time` data attribute', function() {
         describe('through the `time` data attribute', function() {
           beforeEach(function() {
           beforeEach(function() {
             $('.drag').data('event', true)
             $('.drag').data('event', true)
-              .data('time', '05:00');
-          });
-          defineTests();
-        });
+              .data('time', '05:00')
+          })
+          defineTests()
+        })
         function defineTests() {
         function defineTests() {
           it('accepts the given start time for the dropped day', function(done) {
           it('accepts the given start time for the dropped day', function(done) {
-            var options = {};
-            
+            var options = {}
+
             testExternalEventDrag(options, '2014-11-13', true, function() {
             testExternalEventDrag(options, '2014-11-13', true, function() {
               // the whole-day start was already checked. we still need to check the exact time
               // the whole-day start was already checked. we still need to check the exact time
-              var event = currentCalendar.clientEvents()[0];
-              expect(event.start).toEqualMoment('2014-11-13T05:00:00');
-              done();
-            });
-          });
+              var event = currentCalendar.clientEvents()[0]
+              expect(event.start).toEqualMoment('2014-11-13T05:00:00')
+              done()
+            })
+          })
         }
         }
-      });
-    });
-  });
+      })
+    })
+  })
 
 
 
 
   function testExternalElDrag(options, date, expectSuccess, callback) {
   function testExternalElDrag(options, date, expectSuccess, callback) {
-    options.droppable = true;
+    options.droppable = true
     options.drop = function(date, jsEvent, ui) {
     options.drop = function(date, jsEvent, ui) {
-      expect(moment.isMoment(date)).toBe(true);
-      expect(date).toEqualMoment(date);
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof ui).toBe('object');
-    };
-    options.eventReceive = function() { };
-    spyOn(options, 'drop').and.callThrough();
-    spyOn(options, 'eventReceive').and.callThrough();
+      expect(moment.isMoment(date)).toBe(true)
+      expect(date).toEqualMoment(date)
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof ui).toBe('object')
+    }
+    options.eventReceive = function() { }
+    spyOn(options, 'drop').and.callThrough()
+    spyOn(options, 'eventReceive').and.callThrough()
     testEventDrag(options, date, expectSuccess, function() {
     testEventDrag(options, date, expectSuccess, function() {
       if (expectSuccess) {
       if (expectSuccess) {
-        expect(options.drop).toHaveBeenCalled();
-      }
-      else {
-        expect(options.drop).not.toHaveBeenCalled();
+        expect(options.drop).toHaveBeenCalled()
+      } else {
+        expect(options.drop).not.toHaveBeenCalled()
       }
       }
-      expect(options.eventReceive).not.toHaveBeenCalled();
-      callback();
-    }, 'drag'); // .drag className
+      expect(options.eventReceive).not.toHaveBeenCalled()
+      callback()
+    }, 'drag') // .drag className
   }
   }
 
 
 
 
   function testExternalEventDrag(options, date, expectSuccess, callback) {
   function testExternalEventDrag(options, date, expectSuccess, callback) {
-    options.droppable = true;
+    options.droppable = true
     options.drop = function(date, jsEvent, ui) {
     options.drop = function(date, jsEvent, ui) {
-      expect(moment.isMoment(date)).toBe(true);
-      expect(date).toEqualMoment(date);
-      expect(typeof jsEvent).toBe('object');
-      expect(typeof ui).toBe('object');
-    };
+      expect(moment.isMoment(date)).toBe(true)
+      expect(date).toEqualMoment(date)
+      expect(typeof jsEvent).toBe('object')
+      expect(typeof ui).toBe('object')
+    }
     options.eventReceive = function(event) {
     options.eventReceive = function(event) {
       if ($.fullCalendar.moment.parseZone(date).hasTime()) { // dropped on an all-day slot
       if ($.fullCalendar.moment.parseZone(date).hasTime()) { // dropped on an all-day slot
-        expect(event.start).toEqualMoment(date);
+        expect(event.start).toEqualMoment(date)
+      } else { // event might have a time, which it is allowed to keep
+        expect(event.start.clone().stripTime()).toEqualMoment(date)
       }
       }
-      else { // event might have a time, which it is allowed to keep
-        expect(event.start.clone().stripTime()).toEqualMoment(date);
-      }
-    };
-    spyOn(options, 'drop').and.callThrough();
-    spyOn(options, 'eventReceive').and.callThrough();
+    }
+    spyOn(options, 'drop').and.callThrough()
+    spyOn(options, 'eventReceive').and.callThrough()
     testEventDrag(options, date, expectSuccess, function() {
     testEventDrag(options, date, expectSuccess, function() {
       if (expectSuccess) {
       if (expectSuccess) {
-        expect(options.drop).toHaveBeenCalled();
-        expect(options.eventReceive).toHaveBeenCalled();
-      }
-      else {
-        expect(options.drop).not.toHaveBeenCalled();
-        expect(options.eventReceive).not.toHaveBeenCalled();
+        expect(options.drop).toHaveBeenCalled()
+        expect(options.eventReceive).toHaveBeenCalled()
+      } else {
+        expect(options.drop).not.toHaveBeenCalled()
+        expect(options.eventReceive).not.toHaveBeenCalled()
       }
       }
-      callback();
-    }, 'drag'); // .drag className
+      callback()
+    }, 'drag') // .drag className
   }
   }
 
 
-});
+})
 
 

+ 174 - 177
tests/legacy/external-dnd.js

@@ -1,18 +1,18 @@
-import { countHandlers } from '../lib/dom-utils';
+import { countHandlers } from '../lib/dom-utils'
 
 
 describe('external drag and drop', function() {
 describe('external drag and drop', function() {
 
 
   // TODO: fill out tests for droppable/drop, with RTL
   // TODO: fill out tests for droppable/drop, with RTL
 
 
-  var doSortable;
-  var options;
+  var doSortable
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    doSortable = false;
+    doSortable = false
     options = {
     options = {
       defaultDate: '2014-08-23',
       defaultDate: '2014-08-23',
       droppable: true
       droppable: true
-    };
+    }
 
 
     $('body').append(
     $('body').append(
       '<div id="sidebar" style="width:200px">' +
       '<div id="sidebar" style="width:200px">' +
@@ -21,336 +21,333 @@ describe('external drag and drop', function() {
       '</div>' +
       '</div>' +
       '<div id="cal" style="width:600px;position:absolute;top:10px;left:220px">' +
       '<div id="cal" style="width:600px;position:absolute;top:10px;left:220px">' +
       '</div>'
       '</div>'
-    );
-  });
+    )
+  })
 
 
   afterEach(function() {
   afterEach(function() {
-    $('#cal').remove();
-    $('#sidebar').remove();
-  });
+    $('#cal').remove()
+    $('#sidebar').remove()
+  })
 
 
   function init() {
   function init() {
     if (doSortable) {
     if (doSortable) {
-      $('#sidebar').sortable();
-    }
-    else {
-      $('#sidebar a').draggable();
+      $('#sidebar').sortable()
+    } else {
+      $('#sidebar a').draggable()
     }
     }
 
 
-    $('#cal').fullCalendar(options);
+    $('#cal').fullCalendar(options)
   }
   }
 
 
   function getMonthCell(row, col) {
   function getMonthCell(row, col) {
-    return $('.fc-day-grid .fc-row:eq(' + row + ') .fc-bg td:not(.fc-axis):eq(' + col + ')');
+    return $('.fc-day-grid .fc-row:eq(' + row + ') .fc-bg td:not(.fc-axis):eq(' + col + ')')
   }
   }
 
 
   [ false, true ].forEach(function(_doSortable) {
   [ false, true ].forEach(function(_doSortable) {
     describe(_doSortable ? 'with sortable' : 'with draggable', function() {
     describe(_doSortable ? 'with sortable' : 'with draggable', function() {
       beforeEach(function() {
       beforeEach(function() {
-        doSortable = _doSortable;
-      });
+        doSortable = _doSortable
+      })
 
 
       describe('in month view', function() {
       describe('in month view', function() {
 
 
         beforeEach(function() {
         beforeEach(function() {
-          options.defaultView = 'month';
-        });
+          options.defaultView = 'month'
+        })
 
 
         it('works after the view is changed', function(done) { // issue 2240
         it('works after the view is changed', function(done) { // issue 2240
-          var callCnt = 0;
+          var callCnt = 0
 
 
           options.drop = function(date, jsEvent, ui) {
           options.drop = function(date, jsEvent, ui) {
             if (callCnt === 0) {
             if (callCnt === 0) {
-              expect(date).toEqualMoment('2014-08-06');
+              expect(date).toEqualMoment('2014-08-06')
 
 
-              $('#cal').fullCalendar('next');
-              $('#cal').fullCalendar('prev');
+              $('#cal').fullCalendar('next')
+              $('#cal').fullCalendar('prev')
 
 
               setTimeout(function() {
               setTimeout(function() {
-                $('#sidebar .event1').remove();
+                $('#sidebar .event1').remove()
 
 
                 $('#sidebar .event2').simulate('drag', {
                 $('#sidebar .event2').simulate('drag', {
                   end: getMonthCell(1, 3)
                   end: getMonthCell(1, 3)
-                });
-              }, 0);
+                })
+              }, 0)
+            } else if (callCnt === 1) {
+              expect(date).toEqualMoment('2014-08-06')
+              done()
             }
             }
-            else if (callCnt === 1) {
-              expect(date).toEqualMoment('2014-08-06');
-              done();
-            }
-            callCnt++;
-          };
+            callCnt++
+          }
 
 
-          init();
+          init()
 
 
           setTimeout(function() { // needed for IE8
           setTimeout(function() { // needed for IE8
             $('#sidebar .event1').simulate('drag', {
             $('#sidebar .event1').simulate('drag', {
               end: getMonthCell(1, 3)
               end: getMonthCell(1, 3)
-            });
-          }, 0);
-        });
+            })
+          }, 0)
+        })
 
 
         describe('dropAccept', function() {
         describe('dropAccept', function() {
 
 
           it('works with a className that does match', function(done) {
           it('works with a className that does match', function(done) {
-            options.dropAccept = '.event1';
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+            options.dropAccept = '.event1'
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: getMonthCell(1, 3),
                 end: getMonthCell(1, 3),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).toHaveBeenCalled();
-                  done();
+                  expect(options.drop).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
+              })
+            }, 0)
+          })
 
 
           it('prevents a classNames that doesn\'t match', function(done) {
           it('prevents a classNames that doesn\'t match', function(done) {
-            options.dropAccept = '.event2';
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+            options.dropAccept = '.event2'
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: getMonthCell(1, 3),
                 end: getMonthCell(1, 3),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).not.toHaveBeenCalled();
-                  done();
+                  expect(options.drop).not.toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
+              })
+            }, 0)
+          })
 
 
           it('works with a filter function that returns true', function(done) {
           it('works with a filter function that returns true', function(done) {
             options.dropAccept = function(jqEl) {
             options.dropAccept = function(jqEl) {
-              expect(typeof jqEl).toBe('object');
-              expect(jqEl.length).toBe(1);
-              return true;
-            };
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+              expect(typeof jqEl).toBe('object')
+              expect(jqEl.length).toBe(1)
+              return true
+            }
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: getMonthCell(1, 3),
                 end: getMonthCell(1, 3),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).toHaveBeenCalled();
-                  done();
+                  expect(options.drop).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
+              })
+            }, 0)
+          })
 
 
           it('prevents a drop with a filter function that returns false', function(done) {
           it('prevents a drop with a filter function that returns false', function(done) {
             options.dropAccept = function(jqEl) {
             options.dropAccept = function(jqEl) {
-              expect(typeof jqEl).toBe('object');
-              expect(jqEl.length).toBe(1);
-              return false;
-            };
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+              expect(typeof jqEl).toBe('object')
+              expect(jqEl.length).toBe(1)
+              return false
+            }
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: getMonthCell(1, 3),
                 end: getMonthCell(1, 3),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).not.toHaveBeenCalled();
-                  done();
+                  expect(options.drop).not.toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
-        });
-      });
+              })
+            }, 0)
+          })
+        })
+      })
 
 
       describe('in agenda view', function() {
       describe('in agenda view', function() {
 
 
         beforeEach(function() {
         beforeEach(function() {
-          options.defaultView = 'agendaWeek';
-          options.dragScroll = false;
-          options.scrollTime = '00:00:00';
-        });
+          options.defaultView = 'agendaWeek'
+          options.dragScroll = false
+          options.scrollTime = '00:00:00'
+        })
 
 
         it('works after the view is changed', function(done) {
         it('works after the view is changed', function(done) {
-          var callCnt = 0;
+          var callCnt = 0
 
 
           options.drop = function(date, jsEvent, ui) {
           options.drop = function(date, jsEvent, ui) {
             if (callCnt === 0) {
             if (callCnt === 0) {
-              expect(date).toEqualMoment('2014-08-20T01:00:00');
+              expect(date).toEqualMoment('2014-08-20T01:00:00')
 
 
-              $('#cal').fullCalendar('next');
-              $('#cal').fullCalendar('prev');
+              $('#cal').fullCalendar('next')
+              $('#cal').fullCalendar('prev')
 
 
               setTimeout(function() { // needed for IE8, for firing the second time, for some reason
               setTimeout(function() { // needed for IE8, for firing the second time, for some reason
-                $('#sidebar .event1').remove();
+                $('#sidebar .event1').remove()
 
 
                 $('#sidebar .event2').simulate('drag', {
                 $('#sidebar .event2').simulate('drag', {
                   end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20
                   end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20
-                });
-              }, 0);
-            }
-            else if (callCnt === 1) {
-              expect(date).toEqualMoment('2014-08-20T01:00:00');
-              done();
+                })
+              }, 0)
+            } else if (callCnt === 1) {
+              expect(date).toEqualMoment('2014-08-20T01:00:00')
+              done()
             }
             }
-            callCnt++;
-          };
+            callCnt++
+          }
 
 
-          init();
+          init()
 
 
           setTimeout(function() { // needed for IE8
           setTimeout(function() { // needed for IE8
             $('#sidebar .event1').simulate('drag', {
             $('#sidebar .event1').simulate('drag', {
               end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20
               end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20
-            });
-          }, 0);
-        });
+            })
+          }, 0)
+        })
 
 
         it('works with timezone as "local"', function(done) { // for issue 2225
         it('works with timezone as "local"', function(done) { // for issue 2225
-          options.timezone = 'local';
+          options.timezone = 'local'
           options.drop = function(date, jsEvent) {
           options.drop = function(date, jsEvent) {
-            expect(date).toEqualMoment(moment('2014-08-20T01:00:00')); // compate it to a local moment
-            done();
-          };
+            expect(date).toEqualMoment(moment('2014-08-20T01:00:00')) // compate it to a local moment
+            done()
+          }
 
 
-          init();
+          init()
 
 
           setTimeout(function() { // needed for IE8
           setTimeout(function() { // needed for IE8
             $('#sidebar .event1').simulate('drag', {
             $('#sidebar .event1').simulate('drag', {
               end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20, LOCAL TIME
               end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20, LOCAL TIME
-            });
-          }, 0);
-        });
+            })
+          }, 0)
+        })
 
 
         it('works with timezone as "UTC"', function(done) { // for issue 2225
         it('works with timezone as "UTC"', function(done) { // for issue 2225
-          options.timezone = 'UTC';
+          options.timezone = 'UTC'
           options.drop = function(date, jsEvent) {
           options.drop = function(date, jsEvent) {
-            expect(date).toEqualMoment('2014-08-20T01:00:00+00:00');
-            done();
-          };
+            expect(date).toEqualMoment('2014-08-20T01:00:00+00:00')
+            done()
+          }
 
 
-          init();
+          init()
 
 
           setTimeout(function() { // needed for IE8
           setTimeout(function() { // needed for IE8
             $('#sidebar .event1').simulate('drag', {
             $('#sidebar .event1').simulate('drag', {
               end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20, UTC TIME
               end: $('.fc-slats tr:eq(2)') // middle is 1:00am on 2014-08-20, UTC TIME
-            });
-          }, 0);
-        });
+            })
+          }, 0)
+        })
 
 
         describe('dropAccept', function() {
         describe('dropAccept', function() {
 
 
           it('works with a className that does match', function(done) {
           it('works with a className that does match', function(done) {
-            options.dropAccept = '.event1';
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+            options.dropAccept = '.event1'
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: $('.fc-slats tr:eq(2)'),
                 end: $('.fc-slats tr:eq(2)'),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).toHaveBeenCalled();
-                  done();
+                  expect(options.drop).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
+              })
+            }, 0)
+          })
 
 
           it('prevents a classNames that doesn\'t match', function(done) {
           it('prevents a classNames that doesn\'t match', function(done) {
-            options.dropAccept = '.event2';
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+            options.dropAccept = '.event2'
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: $('.fc-slats tr:eq(2)'),
                 end: $('.fc-slats tr:eq(2)'),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).not.toHaveBeenCalled();
-                  done();
+                  expect(options.drop).not.toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
+              })
+            }, 0)
+          })
 
 
           it('works with a filter function that returns true', function(done) {
           it('works with a filter function that returns true', function(done) {
             options.dropAccept = function(jqEl) {
             options.dropAccept = function(jqEl) {
-              expect(typeof jqEl).toBe('object');
-              expect(jqEl.length).toBe(1);
-              return true;
-            };
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+              expect(typeof jqEl).toBe('object')
+              expect(jqEl.length).toBe(1)
+              return true
+            }
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: $('.fc-slats tr:eq(2)'),
                 end: $('.fc-slats tr:eq(2)'),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).toHaveBeenCalled();
-                  done();
+                  expect(options.drop).toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
+              })
+            }, 0)
+          })
 
 
           it('prevents a drop with a filter function that returns false', function(done) {
           it('prevents a drop with a filter function that returns false', function(done) {
             options.dropAccept = function(jqEl) {
             options.dropAccept = function(jqEl) {
-              expect(typeof jqEl).toBe('object');
-              expect(jqEl.length).toBe(1);
-              return false;
-            };
-            options.drop = function() { };
-            spyOn(options, 'drop').and.callThrough();
+              expect(typeof jqEl).toBe('object')
+              expect(jqEl.length).toBe(1)
+              return false
+            }
+            options.drop = function() { }
+            spyOn(options, 'drop').and.callThrough()
 
 
-            init();
+            init()
 
 
             setTimeout(function() { // needed for IE8
             setTimeout(function() { // needed for IE8
               $('#sidebar .event1').simulate('drag', {
               $('#sidebar .event1').simulate('drag', {
                 end: $('.fc-slats tr:eq(2)'),
                 end: $('.fc-slats tr:eq(2)'),
                 callback: function() {
                 callback: function() {
-                  expect(options.drop).not.toHaveBeenCalled();
-                  done();
+                  expect(options.drop).not.toHaveBeenCalled()
+                  done()
                 }
                 }
-              });
-            }, 0);
-          });
-        });
-      });
+              })
+            }, 0)
+          })
+        })
+      })
 
 
       // Issue 2433
       // Issue 2433
       it('should not have drag handlers cleared when other calendar navigates', function() {
       it('should not have drag handlers cleared when other calendar navigates', function() {
 
 
-        init();
-        var el1 = $('#cal');
+        init()
+        var el1 = $('#cal')
 
 
-        $('#cal').after('<div id="cal2"/>');
-        var el2 = $('#cal2').fullCalendar(options);
+        $('#cal').after('<div id="cal2"/>')
+        var el2 = $('#cal2').fullCalendar(options)
 
 
-        var beforeCnt = countHandlers(document);
-        var afterCnt;
+        var beforeCnt = countHandlers(document)
+        var afterCnt
 
 
-        el1.fullCalendar('next');
-        afterCnt = countHandlers(document);
-        expect(beforeCnt).toBe(afterCnt);
+        el1.fullCalendar('next')
+        afterCnt = countHandlers(document)
+        expect(beforeCnt).toBe(afterCnt)
 
 
-        el1.remove();
-        el2.remove();
-      });
-    });
-  });
-});
+        el1.remove()
+        el2.remove()
+      })
+    })
+  })
+})

+ 143 - 143
tests/legacy/firstDay.js

@@ -2,219 +2,219 @@
 describe('First Day', function() {
 describe('First Day', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-  });
+    affix('#cal')
+  })
 
 
   describe('when using default settings', function() {
   describe('when using default settings', function() {
     beforeEach(function() {
     beforeEach(function() {
-      $('#cal').fullCalendar();
-    });
+      $('#cal').fullCalendar()
+    })
     it('should make Sunday the first day of the week', function() {
     it('should make Sunday the first day of the week', function() {
-      var dayFirst = $('.fc-day-header')[0];
-      expect(dayFirst).toHaveClass('fc-sun');
-    });
-  });
+      var dayFirst = $('.fc-day-header')[0]
+      expect(dayFirst).toHaveClass('fc-sun')
+    })
+  })
 
 
   describe('when setting firstDay to 0', function() {
   describe('when setting firstDay to 0', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 0
         firstDay: 0
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Sunday the first day of the week', function() {
     it('should make Sunday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-sun');
-      expect(daysOfWeek[1]).toHaveClass('fc-mon');
-      expect(daysOfWeek[2]).toHaveClass('fc-tue');
-      expect(daysOfWeek[3]).toHaveClass('fc-wed');
-      expect(daysOfWeek[4]).toHaveClass('fc-thu');
-      expect(daysOfWeek[5]).toHaveClass('fc-fri');
-      expect(daysOfWeek[6]).toHaveClass('fc-sat');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-sun')
+      expect(daysOfWeek[1]).toHaveClass('fc-mon')
+      expect(daysOfWeek[2]).toHaveClass('fc-tue')
+      expect(daysOfWeek[3]).toHaveClass('fc-wed')
+      expect(daysOfWeek[4]).toHaveClass('fc-thu')
+      expect(daysOfWeek[5]).toHaveClass('fc-fri')
+      expect(daysOfWeek[6]).toHaveClass('fc-sat')
+    })
+  })
 
 
   describe('when setting firstDay to 1', function() {
   describe('when setting firstDay to 1', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 1
         firstDay: 1
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Monday the first day of the week', function() {
     it('should make Monday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-mon');
-      expect(daysOfWeek[1]).toHaveClass('fc-tue');
-      expect(daysOfWeek[2]).toHaveClass('fc-wed');
-      expect(daysOfWeek[3]).toHaveClass('fc-thu');
-      expect(daysOfWeek[4]).toHaveClass('fc-fri');
-      expect(daysOfWeek[5]).toHaveClass('fc-sat');
-      expect(daysOfWeek[6]).toHaveClass('fc-sun');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-mon')
+      expect(daysOfWeek[1]).toHaveClass('fc-tue')
+      expect(daysOfWeek[2]).toHaveClass('fc-wed')
+      expect(daysOfWeek[3]).toHaveClass('fc-thu')
+      expect(daysOfWeek[4]).toHaveClass('fc-fri')
+      expect(daysOfWeek[5]).toHaveClass('fc-sat')
+      expect(daysOfWeek[6]).toHaveClass('fc-sun')
+    })
+  })
 
 
   describe('when setting weekNumberCalculation to ISO', function() {
   describe('when setting weekNumberCalculation to ISO', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         weekNumberCalculation: 'ISO'
         weekNumberCalculation: 'ISO'
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Monday the first day of the week', function() {
     it('should make Monday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-mon');
-      expect(daysOfWeek[1]).toHaveClass('fc-tue');
-      expect(daysOfWeek[2]).toHaveClass('fc-wed');
-      expect(daysOfWeek[3]).toHaveClass('fc-thu');
-      expect(daysOfWeek[4]).toHaveClass('fc-fri');
-      expect(daysOfWeek[5]).toHaveClass('fc-sat');
-      expect(daysOfWeek[6]).toHaveClass('fc-sun');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-mon')
+      expect(daysOfWeek[1]).toHaveClass('fc-tue')
+      expect(daysOfWeek[2]).toHaveClass('fc-wed')
+      expect(daysOfWeek[3]).toHaveClass('fc-thu')
+      expect(daysOfWeek[4]).toHaveClass('fc-fri')
+      expect(daysOfWeek[5]).toHaveClass('fc-sat')
+      expect(daysOfWeek[6]).toHaveClass('fc-sun')
+    })
+  })
 
 
   describe('when setting firstDay to 2', function() {
   describe('when setting firstDay to 2', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 2
         firstDay: 2
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Tuesday the first day of the week', function() {
     it('should make Tuesday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-tue');
-      expect(daysOfWeek[1]).toHaveClass('fc-wed');
-      expect(daysOfWeek[2]).toHaveClass('fc-thu');
-      expect(daysOfWeek[3]).toHaveClass('fc-fri');
-      expect(daysOfWeek[4]).toHaveClass('fc-sat');
-      expect(daysOfWeek[5]).toHaveClass('fc-sun');
-      expect(daysOfWeek[6]).toHaveClass('fc-mon');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-tue')
+      expect(daysOfWeek[1]).toHaveClass('fc-wed')
+      expect(daysOfWeek[2]).toHaveClass('fc-thu')
+      expect(daysOfWeek[3]).toHaveClass('fc-fri')
+      expect(daysOfWeek[4]).toHaveClass('fc-sat')
+      expect(daysOfWeek[5]).toHaveClass('fc-sun')
+      expect(daysOfWeek[6]).toHaveClass('fc-mon')
+    })
+  })
 
 
   describe('when setting firstDay to 3', function() {
   describe('when setting firstDay to 3', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 3
         firstDay: 3
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Wednesday the first day of the week', function() {
     it('should make Wednesday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-wed');
-      expect(daysOfWeek[1]).toHaveClass('fc-thu');
-      expect(daysOfWeek[2]).toHaveClass('fc-fri');
-      expect(daysOfWeek[3]).toHaveClass('fc-sat');
-      expect(daysOfWeek[4]).toHaveClass('fc-sun');
-      expect(daysOfWeek[5]).toHaveClass('fc-mon');
-      expect(daysOfWeek[6]).toHaveClass('fc-tue');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-wed')
+      expect(daysOfWeek[1]).toHaveClass('fc-thu')
+      expect(daysOfWeek[2]).toHaveClass('fc-fri')
+      expect(daysOfWeek[3]).toHaveClass('fc-sat')
+      expect(daysOfWeek[4]).toHaveClass('fc-sun')
+      expect(daysOfWeek[5]).toHaveClass('fc-mon')
+      expect(daysOfWeek[6]).toHaveClass('fc-tue')
+    })
+  })
 
 
   describe('when setting firstDay to 4', function() {
   describe('when setting firstDay to 4', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 4
         firstDay: 4
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Thursday the first day of the week', function() {
     it('should make Thursday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-thu');
-      expect(daysOfWeek[1]).toHaveClass('fc-fri');
-      expect(daysOfWeek[2]).toHaveClass('fc-sat');
-      expect(daysOfWeek[3]).toHaveClass('fc-sun');
-      expect(daysOfWeek[4]).toHaveClass('fc-mon');
-      expect(daysOfWeek[5]).toHaveClass('fc-tue');
-      expect(daysOfWeek[6]).toHaveClass('fc-wed');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-thu')
+      expect(daysOfWeek[1]).toHaveClass('fc-fri')
+      expect(daysOfWeek[2]).toHaveClass('fc-sat')
+      expect(daysOfWeek[3]).toHaveClass('fc-sun')
+      expect(daysOfWeek[4]).toHaveClass('fc-mon')
+      expect(daysOfWeek[5]).toHaveClass('fc-tue')
+      expect(daysOfWeek[6]).toHaveClass('fc-wed')
+    })
+  })
 
 
   describe('when setting firstDay to 5', function() {
   describe('when setting firstDay to 5', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 5
         firstDay: 5
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Friday the first day of the week', function() {
     it('should make Friday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-fri');
-      expect(daysOfWeek[1]).toHaveClass('fc-sat');
-      expect(daysOfWeek[2]).toHaveClass('fc-sun');
-      expect(daysOfWeek[3]).toHaveClass('fc-mon');
-      expect(daysOfWeek[4]).toHaveClass('fc-tue');
-      expect(daysOfWeek[5]).toHaveClass('fc-wed');
-      expect(daysOfWeek[6]).toHaveClass('fc-thu');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-fri')
+      expect(daysOfWeek[1]).toHaveClass('fc-sat')
+      expect(daysOfWeek[2]).toHaveClass('fc-sun')
+      expect(daysOfWeek[3]).toHaveClass('fc-mon')
+      expect(daysOfWeek[4]).toHaveClass('fc-tue')
+      expect(daysOfWeek[5]).toHaveClass('fc-wed')
+      expect(daysOfWeek[6]).toHaveClass('fc-thu')
+    })
+  })
 
 
   describe('when setting firstDay to 6', function() {
   describe('when setting firstDay to 6', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 6
         firstDay: 6
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should make Saturday the first day of the week', function() {
     it('should make Saturday the first day of the week', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-sat');
-      expect(daysOfWeek[1]).toHaveClass('fc-sun');
-      expect(daysOfWeek[2]).toHaveClass('fc-mon');
-      expect(daysOfWeek[3]).toHaveClass('fc-tue');
-      expect(daysOfWeek[4]).toHaveClass('fc-wed');
-      expect(daysOfWeek[5]).toHaveClass('fc-thu');
-      expect(daysOfWeek[6]).toHaveClass('fc-fri');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-sat')
+      expect(daysOfWeek[1]).toHaveClass('fc-sun')
+      expect(daysOfWeek[2]).toHaveClass('fc-mon')
+      expect(daysOfWeek[3]).toHaveClass('fc-tue')
+      expect(daysOfWeek[4]).toHaveClass('fc-wed')
+      expect(daysOfWeek[5]).toHaveClass('fc-thu')
+      expect(daysOfWeek[6]).toHaveClass('fc-fri')
+    })
+  })
 
 
   describe('when new firstDay options are set', function() {
   describe('when new firstDay options are set', function() {
     it('should change the first day of week to Monday', function() {
     it('should change the first day of week to Monday', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         firstDay: 1
         firstDay: 1
-      });
-      expect($('.fc-day-header')[0]).toHaveClass('fc-mon');
-    });
+      })
+      expect($('.fc-day-header')[0]).toHaveClass('fc-mon')
+    })
     it('shoule change the first day of week to Thursday', function() {
     it('shoule change the first day of week to Thursday', function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         firstDay: 4
         firstDay: 4
-      });
-      expect($('.fc-day-header')[0]).toHaveClass('fc-thu');
-    });
-  });
+      })
+      expect($('.fc-day-header')[0]).toHaveClass('fc-thu')
+    })
+  })
 
 
   describe('when first day is set to Tuesday and isRTL is true', function() {
   describe('when first day is set to Tuesday and isRTL is true', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         firstDay: 2,
         firstDay: 2,
         isRTL: true
         isRTL: true
-      };
-      $('#cal').fullCalendar(options);
-    });
+      }
+      $('#cal').fullCalendar(options)
+    })
     it('should put days mon, sun, sat ...', function() {
     it('should put days mon, sun, sat ...', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-mon');
-      expect(daysOfWeek[1]).toHaveClass('fc-sun');
-      expect(daysOfWeek[2]).toHaveClass('fc-sat');
-      expect(daysOfWeek[3]).toHaveClass('fc-fri');
-      expect(daysOfWeek[4]).toHaveClass('fc-thu');
-      expect(daysOfWeek[5]).toHaveClass('fc-wed');
-      expect(daysOfWeek[6]).toHaveClass('fc-tue');
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-mon')
+      expect(daysOfWeek[1]).toHaveClass('fc-sun')
+      expect(daysOfWeek[2]).toHaveClass('fc-sat')
+      expect(daysOfWeek[3]).toHaveClass('fc-fri')
+      expect(daysOfWeek[4]).toHaveClass('fc-thu')
+      expect(daysOfWeek[5]).toHaveClass('fc-wed')
+      expect(daysOfWeek[6]).toHaveClass('fc-tue')
+    })
+  })
 
 
   it('should have a different default value based on the locale', function() {
   it('should have a different default value based on the locale', function() {
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
       locale: 'en-gb'
       locale: 'en-gb'
-    });
+    })
     // firstDay will be 1 (Monday) in Great Britain
     // firstDay will be 1 (Monday) in Great Britain
-    var daysOfWeek = $('.fc-day-header');
-    expect(daysOfWeek[0]).toHaveClass('fc-mon');
-    expect(daysOfWeek[1]).toHaveClass('fc-tue');
-    expect(daysOfWeek[2]).toHaveClass('fc-wed');
-    expect(daysOfWeek[3]).toHaveClass('fc-thu');
-    expect(daysOfWeek[4]).toHaveClass('fc-fri');
-    expect(daysOfWeek[5]).toHaveClass('fc-sat');
-    expect(daysOfWeek[6]).toHaveClass('fc-sun');
-  });
+    var daysOfWeek = $('.fc-day-header')
+    expect(daysOfWeek[0]).toHaveClass('fc-mon')
+    expect(daysOfWeek[1]).toHaveClass('fc-tue')
+    expect(daysOfWeek[2]).toHaveClass('fc-wed')
+    expect(daysOfWeek[3]).toHaveClass('fc-thu')
+    expect(daysOfWeek[4]).toHaveClass('fc-fri')
+    expect(daysOfWeek[5]).toHaveClass('fc-sat')
+    expect(daysOfWeek[6]).toHaveClass('fc-sun')
+  })
 
 
-});
+})

+ 20 - 20
tests/legacy/fixedWeekCount.js

@@ -3,33 +3,33 @@ describe('fixedWeekCount', function() {
   pushOptions({
   pushOptions({
     defaultView: 'month',
     defaultView: 'month',
     defaultDate: '2014-07-01' // has 5 weeks
     defaultDate: '2014-07-01' // has 5 weeks
-  });
+  })
 
 
   describe('when true', function() {
   describe('when true', function() {
 
 
     pushOptions({
     pushOptions({
       fixedWeekCount: true
       fixedWeekCount: true
-    });
+    })
 
 
     it('renders a 5-week month with 6 rows', function() {
     it('renders a 5-week month with 6 rows', function() {
-      initCalendar();
-      var weeks = $('.fc-week');
-      expect(weeks.length).toBe(6);
-    });
+      initCalendar()
+      var weeks = $('.fc-week')
+      expect(weeks.length).toBe(6)
+    })
 
 
-  });
+  })
 
 
   describe('when false', function() {
   describe('when false', function() {
 
 
     pushOptions({
     pushOptions({
       fixedWeekCount: false
       fixedWeekCount: false
-    });
+    })
 
 
     it('renders a 5-week month with 5 rows', function() {
     it('renders a 5-week month with 5 rows', function() {
-      initCalendar();
-      var weeks = $('.fc-week');
-      expect(weeks.length).toBe(5);
-    });
+      initCalendar()
+      var weeks = $('.fc-week')
+      expect(weeks.length).toBe(5)
+    })
 
 
   });
   });
 
 
@@ -39,15 +39,15 @@ describe('fixedWeekCount', function() {
       pushOptions({
       pushOptions({
         fixedWeekCount: bool,
         fixedWeekCount: bool,
         defaultDate: '2014-08-01' // has 6 weeks
         defaultDate: '2014-08-01' // has 6 weeks
-      });
+      })
 
 
       it('should render a 6-week month consistently', function() {
       it('should render a 6-week month consistently', function() {
-        initCalendar();
-        var weeks = $('.fc-week');
-        expect(weeks.length).toBe(6);
-      });
+        initCalendar()
+        var weeks = $('.fc-week')
+        expect(weeks.length).toBe(6)
+      })
 
 
-    });
-  });
+    })
+  })
 
 
-});
+})

+ 36 - 36
tests/legacy/footer-navigation.js

@@ -1,9 +1,9 @@
 
 
 describe('footer navigation', function() {
 describe('footer navigation', function() {
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#calendar');
+    affix('#calendar')
     options = {
     options = {
       now: '2010-02-01',
       now: '2010-02-01',
       footer: {
       footer: {
@@ -11,52 +11,52 @@ describe('footer navigation', function() {
         center: '',
         center: '',
         right: 'title'
         right: 'title'
       }
       }
-    };
-  });
+    }
+  })
 
 
   describe('and click next', function() {
   describe('and click next', function() {
     it('should change view to next month', function() {
     it('should change view to next month', function() {
-      $('#calendar').fullCalendar(options);
-      $('.fc-footer-toolbar .fc-next-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2010-03-01');
-    });
-  });
+      $('#calendar').fullCalendar(options)
+      $('.fc-footer-toolbar .fc-next-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2010-03-01')
+    })
+  })
 
 
   describe('and click prev', function() {
   describe('and click prev', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      $('#calendar').fullCalendar(options);
-      $('.fc-footer-toolbar .fc-prev-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2010-01-01');
-    });
-  });
+      $('#calendar').fullCalendar(options)
+      $('.fc-footer-toolbar .fc-prev-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2010-01-01')
+    })
+  })
 
 
   describe('and click prevYear', function() {
   describe('and click prevYear', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      $('#calendar').fullCalendar(options);
-      $('.fc-footer-toolbar .fc-prevYear-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2009-02-01');
-    });
-  });
+      $('#calendar').fullCalendar(options)
+      $('.fc-footer-toolbar .fc-prevYear-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2009-02-01')
+    })
+  })
 
 
   describe('and click nextYear', function() {
   describe('and click nextYear', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      $('#calendar').fullCalendar(options);
-      $('.fc-footer-toolbar .fc-nextYear-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2011-02-01');
-    });
-  });
+      $('#calendar').fullCalendar(options)
+      $('.fc-footer-toolbar .fc-nextYear-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2011-02-01')
+    })
+  })
 
 
   describe('and click today', function() {
   describe('and click today', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      options.defaultDate = '2010-03-15'; // something other than the `now` date
-      $('#calendar').fullCalendar(options);
-      $('.fc-footer-toolbar .fc-today-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate'); // will be ambig zone
-      expect(newDate).toEqualMoment('2010-02-01');
-    });
-  });
-});
+      options.defaultDate = '2010-03-15' // something other than the `now` date
+      $('#calendar').fullCalendar(options)
+      $('.fc-footer-toolbar .fc-today-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate') // will be ambig zone
+      expect(newDate).toEqualMoment('2010-02-01')
+    })
+  })
+})

+ 16 - 16
tests/legacy/footer-rendering.js

@@ -3,7 +3,7 @@ describe('footer rendering', function() {
   pushOptions({
   pushOptions({
     defaultDate: '2014-06-04',
     defaultDate: '2014-06-04',
     defaultView: 'agendaWeek'
     defaultView: 'agendaWeek'
-  });
+  })
 
 
   describe('when supplying footer options', function() {
   describe('when supplying footer options', function() {
     it('should append a .fc-footer-toolbar to the DOM', function() {
     it('should append a .fc-footer-toolbar to the DOM', function() {
@@ -13,20 +13,20 @@ describe('footer rendering', function() {
           center: 'prevYear today nextYear agendaView,dayView',
           center: 'prevYear today nextYear agendaView,dayView',
           right: 'title'
           right: 'title'
         }
         }
-      });
-      var footer = $('#calendar .fc-footer-toolbar');
-      expect(footer.length).toBe(1);
-    });
-  });
+      })
+      var footer = $('#calendar .fc-footer-toolbar')
+      expect(footer.length).toBe(1)
+    })
+  })
 
 
   describe('when setting footer to false', function() {
   describe('when setting footer to false', function() {
     it('should not have footer table', function() {
     it('should not have footer table', function() {
       initCalendar({
       initCalendar({
         footer: false
         footer: false
-      });
-      expect($('.fc-footer-toolbar')).not.toBeInDOM();
-    });
-  });
+      })
+      expect($('.fc-footer-toolbar')).not.toBeInDOM()
+    })
+  })
 
 
   it('allow for dynamically changing', function() {
   it('allow for dynamically changing', function() {
     initCalendar({
     initCalendar({
@@ -35,10 +35,10 @@ describe('footer rendering', function() {
         center: 'prevYear today nextYear agendaView,dayView',
         center: 'prevYear today nextYear agendaView,dayView',
         right: 'title'
         right: 'title'
       }
       }
-    });
-    expect($('.fc-footer-toolbar')).toBeInDOM();
-    currentCalendar.option('footer', false);
-    expect($('.fc-footer-toolbar')).not.toBeInDOM();
-  });
+    })
+    expect($('.fc-footer-toolbar')).toBeInDOM()
+    currentCalendar.option('footer', false)
+    expect($('.fc-footer-toolbar')).not.toBeInDOM()
+  })
 
 
-});
+})

+ 25 - 25
tests/legacy/forceEventDuration.js

@@ -1,20 +1,20 @@
 describe('forceEventDuration', function() {
 describe('forceEventDuration', function() {
 
 
-  var options;
+  var options
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
+    affix('#cal')
 
 
     options = {
     options = {
       defaultDate: '2014-05-01',
       defaultDate: '2014-05-01',
       defaultView: 'month'
       defaultView: 'month'
-    };
-  });
+    }
+  })
 
 
   describe('when turned off', function() {
   describe('when turned off', function() {
     beforeEach(function() {
     beforeEach(function() {
-      options.forceEventDuration = false;
-    });
+      options.forceEventDuration = false
+    })
     it('allows a null end date for all-day and timed events', function() {
     it('allows a null end date for all-day and timed events', function() {
       options.events = [
       options.events = [
         {
         {
@@ -25,18 +25,18 @@ describe('forceEventDuration', function() {
           id: '2',
           id: '2',
           start: '2014-05-10T14:00:00'
           start: '2014-05-10T14:00:00'
         }
         }
-      ];
-      $('#cal').fullCalendar(options);
-      var events = $('#cal').fullCalendar('clientEvents');
-      expect(events[0].end).toBeNull();
-      expect(events[1].end).toBeNull();
-    });
-  });
+      ]
+      $('#cal').fullCalendar(options)
+      var events = $('#cal').fullCalendar('clientEvents')
+      expect(events[0].end).toBeNull()
+      expect(events[1].end).toBeNull()
+    })
+  })
 
 
   describe('when turned on', function() {
   describe('when turned on', function() {
     beforeEach(function() {
     beforeEach(function() {
-      options.forceEventDuration = true;
-    });
+      options.forceEventDuration = true
+    })
     it('allows a null end date for all-day and timed events', function() {
     it('allows a null end date for all-day and timed events', function() {
       options.events = [
       options.events = [
         {
         {
@@ -47,18 +47,18 @@ describe('forceEventDuration', function() {
           id: '2',
           id: '2',
           start: '2014-05-10T14:00:00'
           start: '2014-05-10T14:00:00'
         }
         }
-      ];
-      $('#cal').fullCalendar(options);
-      var events = $('#cal').fullCalendar('clientEvents');
-      expect(events[0].id).toEqual('1');
-      expect(moment.isMoment(events[0].end)).toEqual(true);
-      expect(events[1].id).toEqual('2');
-      expect(moment.isMoment(events[1].end)).toEqual(true);
-    });
-  });
+      ]
+      $('#cal').fullCalendar(options)
+      var events = $('#cal').fullCalendar('clientEvents')
+      expect(events[0].id).toEqual('1')
+      expect(moment.isMoment(events[0].end)).toEqual(true)
+      expect(events[1].id).toEqual('2')
+      expect(moment.isMoment(events[1].end)).toEqual(true)
+    })
+  })
 
 
   // NOTE: the actual verification of the correct calculation of the end
   // NOTE: the actual verification of the correct calculation of the end
   // (using defaultTimedEventDuration and defaultAllDayEventDuration)
   // (using defaultTimedEventDuration and defaultAllDayEventDuration)
   // is done in those test files.
   // is done in those test files.
 
 
-});
+})

+ 87 - 87
tests/legacy/formatRange.js

@@ -2,70 +2,70 @@
 describe('formatRange', function() {
 describe('formatRange', function() {
 
 
   it('doesn\'t do any splitting when dates have different years', function() {
   it('doesn\'t do any splitting when dates have different years', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01', '2015-01-01', 'MMMM Do YYYY');
-    expect(s).toEqual('January 1st 2014 - January 1st 2015');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01', '2015-01-01', 'MMMM Do YYYY')
+    expect(s).toEqual('January 1st 2014 - January 1st 2015')
+  })
 
 
   it('splits correctly on day when dates have same month', function() {
   it('splits correctly on day when dates have same month', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'MMMM Do YYYY');
-    expect(s).toEqual('January 1st - 5th 2014');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'MMMM Do YYYY')
+    expect(s).toEqual('January 1st - 5th 2014')
+  })
 
 
   it('splits correctly on day when dates have same month and smaller unit in front', function() {
   it('splits correctly on day when dates have same month and smaller unit in front', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'dddd MMMM Do YYYY');
-    expect(s).toEqual('Wednesday January 1st - Sunday January 5th 2014');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'dddd MMMM Do YYYY')
+    expect(s).toEqual('Wednesday January 1st - Sunday January 5th 2014')
+  })
 
 
   it('splits correctly on the time when dates have the same day', function() {
   it('splits correctly on the time when dates have the same day', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T08:00:00', 'MMMM Do YYYY h:mma');
-    expect(s).toEqual('January 1st 2014 6:00am - 8:00am');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T08:00:00', 'MMMM Do YYYY h:mma')
+    expect(s).toEqual('January 1st 2014 6:00am - 8:00am')
+  })
 
 
   it('splits correctly on the time when dates have the same day and hour but different am/pm', function() {
   it('splits correctly on the time when dates have the same day and hour but different am/pm', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T18:00:00', 'MMMM Do YYYY h:mma');
-    expect(s).toEqual('January 1st 2014 6:00am - 6:00pm');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T18:00:00', 'MMMM Do YYYY h:mma')
+    expect(s).toEqual('January 1st 2014 6:00am - 6:00pm')
+  })
 
 
   it('splits correctly on the time when the dates have the same hour', function() {
   it('splits correctly on the time when the dates have the same hour', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:30:00', 'MMMM Do YYYY h:mma');
-    expect(s).toEqual('January 1st 2014 6:00am - 6:30am');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:30:00', 'MMMM Do YYYY h:mma')
+    expect(s).toEqual('January 1st 2014 6:00am - 6:30am')
+  })
 
 
   it('doesn\'t split a period (German)', function() {
   it('doesn\'t split a period (German)', function() {
-    var date1 = moment('2014-08-11').locale('de');
-    var date2 = moment('2014-08-17').locale('de');
-    var s = $.fullCalendar.formatRange(date1, date2, 'll');
-    expect(s).toEqual('11. - 17. Aug. 2014');
-  });
+    var date1 = moment('2014-08-11').locale('de')
+    var date2 = moment('2014-08-17').locale('de')
+    var s = $.fullCalendar.formatRange(date1, date2, 'll')
+    expect(s).toEqual('11. - 17. Aug. 2014')
+  })
 
 
   it('doesn\'t split a period (Czech)', function() {
   it('doesn\'t split a period (Czech)', function() {
-    var date1 = moment('2017-01-15').locale('cs');
-    var date2 = moment('2017-01-21').locale('cs');
-    var s = $.fullCalendar.formatRange(date1, date2, 'D. M. YYYY');
-    expect(s).toEqual('15. - 21. 1. 2017');
-  });
+    var date1 = moment('2017-01-15').locale('cs')
+    var date2 = moment('2017-01-21').locale('cs')
+    var s = $.fullCalendar.formatRange(date1, date2, 'D. M. YYYY')
+    expect(s).toEqual('15. - 21. 1. 2017')
+  })
 
 
   it('uses non-standalone version of month (Russian)', function() {
   it('uses non-standalone version of month (Russian)', function() {
-    var date1 = moment('2015-01-02').locale('ru');
-    var date2 = moment('2015-01-08').locale('ru');
-    var s = $.fullCalendar.formatRange(date1, date2, 'DD MMMM YYYY');
-    expect(s).toEqual('02 - 08 января 2015');
-  });
+    var date1 = moment('2015-01-02').locale('ru')
+    var date2 = moment('2015-01-08').locale('ru')
+    var s = $.fullCalendar.formatRange(date1, date2, 'DD MMMM YYYY')
+    expect(s).toEqual('02 - 08 января 2015')
+  })
 
 
   it('outputs the single date when the dates have the same day and time', function() {
   it('outputs the single date when the dates have the same day and time', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:00:00', 'MMMM Do YYYY h:mma');
-    expect(s).toEqual('January 1st 2014 6:00am');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:00:00', 'MMMM Do YYYY h:mma')
+    expect(s).toEqual('January 1st 2014 6:00am')
+  })
 
 
   it('outputs the single date when the dates have the same day and the format string is vague', function() {
   it('outputs the single date when the dates have the same day and the format string is vague', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-01', 'MMMM Do YYYY');
-    expect(s).toEqual('January 1st 2014');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-01', 'MMMM Do YYYY')
+    expect(s).toEqual('January 1st 2014')
+  })
 
 
   it('outputs the single week number when dates have the same week and format string is week', function() {
   it('outputs the single week number when dates have the same week and format string is week', function() {
-    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-01', 'W');
-    expect(s).toEqual('1');
-  });
+    var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-01', 'W')
+    expect(s).toEqual('1')
+  })
 
 
   it('uses a custom separator', function() {
   it('uses a custom separator', function() {
     var s = $.fullCalendar.formatRange(
     var s = $.fullCalendar.formatRange(
@@ -73,51 +73,51 @@ describe('formatRange', function() {
       '2014-01-01T06:30:00',
       '2014-01-01T06:30:00',
       'MMMM Do YYYY h:mma',
       'MMMM Do YYYY h:mma',
       '<...>'
       '<...>'
-    );
-    expect(s).toEqual('January 1st 2014 6:00am<...>6:30am');
-  });
+    )
+    expect(s).toEqual('January 1st 2014 6:00am<...>6:30am')
+  })
 
 
   describe('when called with isRTL', function() {
   describe('when called with isRTL', function() {
 
 
     it('doesn\'t do any splitting when dates have different years', function() {
     it('doesn\'t do any splitting when dates have different years', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01', '2015-01-01', 'MMMM Do YYYY', null, true);
-      expect(s).toEqual('January 1st 2015 - January 1st 2014');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01', '2015-01-01', 'MMMM Do YYYY', null, true)
+      expect(s).toEqual('January 1st 2015 - January 1st 2014')
+    })
 
 
     it('splits correctly on day when dates have same month', function() {
     it('splits correctly on day when dates have same month', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'MMMM Do YYYY', null, true);
-      expect(s).toEqual('January 5th - 1st 2014');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'MMMM Do YYYY', null, true)
+      expect(s).toEqual('January 5th - 1st 2014')
+    })
 
 
     it('splits correctly on day when dates have same month and smaller unit in front', function() {
     it('splits correctly on day when dates have same month and smaller unit in front', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'dddd MMMM Do YYYY', null, true);
-      expect(s).toEqual('Sunday January 5th - Wednesday January 1st 2014');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-05', 'dddd MMMM Do YYYY', null, true)
+      expect(s).toEqual('Sunday January 5th - Wednesday January 1st 2014')
+    })
 
 
     it('splits correctly on the time when dates have the same day', function() {
     it('splits correctly on the time when dates have the same day', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T08:00:00', 'MMMM Do YYYY h:mma', null, true);
-      expect(s).toEqual('January 1st 2014 8:00am - 6:00am');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T08:00:00', 'MMMM Do YYYY h:mma', null, true)
+      expect(s).toEqual('January 1st 2014 8:00am - 6:00am')
+    })
 
 
     it('splits correctly on the time when dates have the same day and hour but different am/pm', function() {
     it('splits correctly on the time when dates have the same day and hour but different am/pm', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T18:00:00', 'MMMM Do YYYY h:mma', null, true);
-      expect(s).toEqual('January 1st 2014 6:00pm - 6:00am');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T18:00:00', 'MMMM Do YYYY h:mma', null, true)
+      expect(s).toEqual('January 1st 2014 6:00pm - 6:00am')
+    })
 
 
     it('splits correctly on the time when the dates have the same hour', function() {
     it('splits correctly on the time when the dates have the same hour', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:30:00', 'MMMM Do YYYY h:mma', null, true);
-      expect(s).toEqual('January 1st 2014 6:30am - 6:00am');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:30:00', 'MMMM Do YYYY h:mma', null, true)
+      expect(s).toEqual('January 1st 2014 6:30am - 6:00am')
+    })
 
 
     it('outputs the single date when the dates have the same day and time', function() {
     it('outputs the single date when the dates have the same day and time', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:00:00', 'MMMM Do YYYY h:mma', null, true);
-      expect(s).toEqual('January 1st 2014 6:00am');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01T06:00:00', '2014-01-01T06:00:00', 'MMMM Do YYYY h:mma', null, true)
+      expect(s).toEqual('January 1st 2014 6:00am')
+    })
 
 
     it('outputs the single date when the dates have the same day and the format string is vague', function() {
     it('outputs the single date when the dates have the same day and the format string is vague', function() {
-      var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-01', 'MMMM Do YYYY', null, true);
-      expect(s).toEqual('January 1st 2014');
-    });
+      var s = $.fullCalendar.formatRange('2014-01-01', '2014-01-01', 'MMMM Do YYYY', null, true)
+      expect(s).toEqual('January 1st 2014')
+    })
 
 
     it('uses a custom separator', function() {
     it('uses a custom separator', function() {
       var s = $.fullCalendar.formatRange(
       var s = $.fullCalendar.formatRange(
@@ -126,51 +126,51 @@ describe('formatRange', function() {
         'MMMM Do YYYY h:mma',
         'MMMM Do YYYY h:mma',
         '<...>',
         '<...>',
         true
         true
-      );
-      expect(s).toEqual('January 1st 2014 6:30am<...>6:00am');
-    });
+      )
+      expect(s).toEqual('January 1st 2014 6:30am<...>6:00am')
+    })
 
 
-  });
+  })
 
 
   describe('when calendar has isRTL', function() {
   describe('when calendar has isRTL', function() {
 
 
     it('splits correctly on day when dates have same month', function() {
     it('splits correctly on day when dates have same month', function() {
-      affix('#cal');
+      affix('#cal')
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         defaultView: 'basicWeek',
         defaultView: 'basicWeek',
         defaultDate: '2014-05-20',
         defaultDate: '2014-05-20',
         isRTL: true,
         isRTL: true,
         titleFormat: 'MMMM Do YYYY',
         titleFormat: 'MMMM Do YYYY',
         titleRangeSeparator: ' - '
         titleRangeSeparator: ' - '
-      });
-      expect($('.fc-toolbar h2')).toHaveText('May 24th - 18th 2014');
-    });
+      })
+      expect($('.fc-toolbar h2')).toHaveText('May 24th - 18th 2014')
+    })
 
 
-  });
+  })
 
 
   describe('when calendar has a customized locale', function() {
   describe('when calendar has a customized locale', function() {
 
 
     it('uses locale and splits correctly on day when dates have same month', function() {
     it('uses locale and splits correctly on day when dates have same month', function() {
-      affix('#cal');
+      affix('#cal')
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         defaultView: 'basicWeek',
         defaultView: 'basicWeek',
         defaultDate: '2014-05-20',
         defaultDate: '2014-05-20',
         locale: 'fr',
         locale: 'fr',
         titleFormat: 'dddd MMMM D YYYY',
         titleFormat: 'dddd MMMM D YYYY',
         titleRangeSeparator: ' - '
         titleRangeSeparator: ' - '
-      });
-      expect($('.fc-toolbar h2')).toHaveText('lundi mai 19 - dimanche mai 25 2014');
-    });
+      })
+      expect($('.fc-toolbar h2')).toHaveText('lundi mai 19 - dimanche mai 25 2014')
+    })
 
 
-  });
+  })
 
 
   it('splits correctly on day when dates have same month, when given real moments', function() {
   it('splits correctly on day when dates have same month, when given real moments', function() {
     var s = $.fullCalendar.formatRange(
     var s = $.fullCalendar.formatRange(
       moment.utc('2014-01-01'),
       moment.utc('2014-01-01'),
       moment.utc('2015-01-01'),
       moment.utc('2015-01-01'),
       'MMMM Do YYYY'
       'MMMM Do YYYY'
-    );
-    expect(s).toEqual('January 1st 2014 - January 1st 2015');
-  });
+    )
+    expect(s).toEqual('January 1st 2014 - January 1st 2015')
+  })
 
 
-});
+})

+ 37 - 38
tests/legacy/getClientRect.js

@@ -1,89 +1,88 @@
-import { getStockScrollbarWidths } from '../lib/dom-utils';
+import { getStockScrollbarWidths } from '../lib/dom-utils'
 
 
 describe('getClientRect', function() {
 describe('getClientRect', function() {
 
 
-  var getClientRect = $.fullCalendar.getClientRect;
+  var getClientRect = $.fullCalendar.getClientRect
 
 
   defineTests(
   defineTests(
     'when margin',
     'when margin',
     { margin: '5px 10px' },
     { margin: '5px 10px' },
     { width: 100, height: 100 },
     { width: 100, height: 100 },
     { width: 100, height: 100 }
     { width: 100, height: 100 }
-  );
+  )
   defineTests(
   defineTests(
     'when padding',
     'when padding',
     { padding: '5px 10px' },
     { padding: '5px 10px' },
     { width: 100, height: 100 },
     { width: 100, height: 100 },
     { width: 120, height: 110 }
     { width: 120, height: 110 }
-  );
+  )
 
 
-  //// getClientRect doesn't work with borders anymore
-  //defineTests(
+  /// / getClientRect doesn't work with borders anymore
+  // defineTests(
   //  'when border',
   //  'when border',
   //  { border: '5px solid red' },
   //  { border: '5px solid red' },
   //  { width: 100, height: 100 },
   //  { width: 100, height: 100 },
   //  { width: 100, height: 100 }
   //  { width: 100, height: 100 }
-  //);
-  //defineTests(
+  // );
+  // defineTests(
   //  'when border and padding',
   //  'when border and padding',
   //  { border: '5px solid red', padding: '5px 10px' },
   //  { border: '5px solid red', padding: '5px 10px' },
   //  { width: 100, height: 100 },
   //  { width: 100, height: 100 },
   //  { width: 120, height: 110 }
   //  { width: 120, height: 110 }
-  //);
+  // );
 
 
   function defineTests(description, cssProps, innerDims, dims) {
   function defineTests(description, cssProps, innerDims, dims) {
     describe(description, function() {
     describe(description, function() {
       describe('when no scrolling', function() {
       describe('when no scrolling', function() {
         describe('when LTR', function() {
         describe('when LTR', function() {
-          defineTest(false, 'ltr', cssProps, innerDims, dims);
-        });
+          defineTest(false, 'ltr', cssProps, innerDims, dims)
+        })
         describe('when RTL', function() {
         describe('when RTL', function() {
-          defineTest(false, 'rtl', cssProps, innerDims, dims);
-        });
-      });
+          defineTest(false, 'rtl', cssProps, innerDims, dims)
+        })
+      })
       describe('when scrolling', function() {
       describe('when scrolling', function() {
         describe('when LTR', function() {
         describe('when LTR', function() {
-          defineTest(true, 'ltr', cssProps, innerDims, dims);
-        });
+          defineTest(true, 'ltr', cssProps, innerDims, dims)
+        })
         describe('when RTL', function() {
         describe('when RTL', function() {
-          defineTest(true, 'rtl', cssProps, innerDims, dims);
-        });
-      });
-    });
+          defineTest(true, 'rtl', cssProps, innerDims, dims)
+        })
+      })
+    })
   }
   }
 
 
   function defineTest(isScrolling, dir, cssProps, innerDims, dims) {
   function defineTest(isScrolling, dir, cssProps, innerDims, dims) {
     it('computes correct dimensions', function() {
     it('computes correct dimensions', function() {
       var el = $(
       var el = $(
         '<div style="position:absolute" />'
         '<div style="position:absolute" />'
-        )
+      )
         .css('overflow', isScrolling ? 'scroll' : 'hidden')
         .css('overflow', isScrolling ? 'scroll' : 'hidden')
         .css('direction', dir)
         .css('direction', dir)
         .css(cssProps)
         .css(cssProps)
         .append(
         .append(
           $('<div style="position:relative" />').css(innerDims)
           $('<div style="position:relative" />').css(innerDims)
         )
         )
-        .appendTo('body');
+        .appendTo('body')
 
 
-      var rect = getClientRect(el);
-      var offset = el.offset();
-      var borderLeftWidth = parseFloat(el.css('border-left-width')) || 0;
-      var borderTopWidth = parseFloat(el.css('border-top-width')) || 0;
-      var scrollbarWidths;
+      var rect = getClientRect(el)
+      var offset = el.offset()
+      var borderLeftWidth = parseFloat(el.css('border-left-width')) || 0
+      var borderTopWidth = parseFloat(el.css('border-top-width')) || 0
+      var scrollbarWidths
 
 
       if (isScrolling) {
       if (isScrolling) {
-        scrollbarWidths = getStockScrollbarWidths(dir);
-      }
-      else {
-        scrollbarWidths = { left: 0, right: 0, top: 0, bottom: 0 };
+        scrollbarWidths = getStockScrollbarWidths(dir)
+      } else {
+        scrollbarWidths = { left: 0, right: 0, top: 0, bottom: 0 }
       }
       }
 
 
-      expect(rect.left).toBe(offset.left + borderLeftWidth + scrollbarWidths.left);
-      expect(rect.top).toBe(offset.top + borderTopWidth + scrollbarWidths.top);
-      expect(rect.right - rect.left).toBe(dims.width);
-      expect(rect.bottom - rect.top).toBe(dims.height);
+      expect(rect.left).toBe(offset.left + borderLeftWidth + scrollbarWidths.left)
+      expect(rect.top).toBe(offset.top + borderTopWidth + scrollbarWidths.top)
+      expect(rect.right - rect.left).toBe(dims.width)
+      expect(rect.bottom - rect.top).toBe(dims.height)
 
 
-      el.remove();
-    });
+      el.remove()
+    })
   }
   }
-});
+})

+ 9 - 9
tests/legacy/getEventSourceById.js

@@ -23,18 +23,18 @@ describe('getEventSource', function() {
         id: 'source3'
         id: 'source3'
       }
       }
     ]
     ]
-  });
+  })
 
 
   it('retreives the queried event source', function(done) {
   it('retreives the queried event source', function(done) {
-    initCalendar();
+    initCalendar()
 
 
-    var eventSource1 = currentCalendar.getEventSourceById('source1');
-    var eventSource2 = currentCalendar.getEventSourceById('source2');
+    var eventSource1 = currentCalendar.getEventSourceById('source1')
+    var eventSource2 = currentCalendar.getEventSourceById('source2')
 
 
-    expect(eventSource1.id).toBe('source1');
-    expect(eventSource2.id).toBe('source2');
+    expect(eventSource1.id).toBe('source1')
+    expect(eventSource2.id).toBe('source2')
 
 
-    done();
-  });
+    done()
+  })
 
 
-});
+})

+ 9 - 9
tests/legacy/getEventSources.js

@@ -20,19 +20,19 @@ describe('getEventSources', function() {
         ]
         ]
       }
       }
     ]
     ]
-  });
+  })
 
 
   it('does not mutate when removeEventSource is called', function(done) {
   it('does not mutate when removeEventSource is called', function(done) {
-    initCalendar();
-    var eventSources = currentCalendar.getEventSources();
-    expect(eventSources.length).toBe(3);
+    initCalendar()
+    var eventSources = currentCalendar.getEventSources()
+    expect(eventSources.length).toBe(3)
 
 
     // prove that eventSources is a copy, and wasn't mutated
     // prove that eventSources is a copy, and wasn't mutated
-    currentCalendar.removeEventSource(eventSources[0]);
-    expect(eventSources.length).toBe(3);
+    currentCalendar.removeEventSource(eventSources[0])
+    expect(eventSources.length).toBe(3)
 
 
-    done();
-  });
+    done()
+  })
 
 
-});
+})
 
 

+ 34 - 35
tests/legacy/getScrollbarWidths.js

@@ -1,76 +1,75 @@
-import { getStockScrollbarWidths } from '../lib/dom-utils';
+import { getStockScrollbarWidths } from '../lib/dom-utils'
 
 
 describe('getScrollbarWidths', function() {
 describe('getScrollbarWidths', function() {
 
 
-  var getScrollbarWidths = $.fullCalendar.getScrollbarWidths;
+  var getScrollbarWidths = $.fullCalendar.getScrollbarWidths
 
 
   defineTests(
   defineTests(
     'when margin',
     'when margin',
     { margin: '5px 10px' }
     { margin: '5px 10px' }
-  );
+  )
   defineTests(
   defineTests(
     'when padding',
     'when padding',
     { padding: '5px 10px' }
     { padding: '5px 10px' }
-  );
+  )
 
 
-  //// getScrollbarWidths doesn't work with borders anymore
-  //defineTests(
+  /// / getScrollbarWidths doesn't work with borders anymore
+  // defineTests(
   //  'when border',
   //  'when border',
   //  { border: '5px solid red' }
   //  { border: '5px solid red' }
-  //);
-  //defineTests(
+  // );
+  // defineTests(
   //  'when border and padding',
   //  'when border and padding',
   //  { border: '5px solid red', padding: '5px 10px' }
   //  { border: '5px solid red', padding: '5px 10px' }
-  //);
+  // );
 
 
   function defineTests(description, cssProps) {
   function defineTests(description, cssProps) {
     describe(description, function() {
     describe(description, function() {
       describe('when no scrolling', function() {
       describe('when no scrolling', function() {
         describe('when LTR', function() {
         describe('when LTR', function() {
-          defineTest(false, 'ltr', cssProps);
-        });
+          defineTest(false, 'ltr', cssProps)
+        })
         describe('when RTL', function() {
         describe('when RTL', function() {
-          defineTest(false, 'rtl', cssProps);
-        });
-      });
+          defineTest(false, 'rtl', cssProps)
+        })
+      })
       describe('when scrolling', function() {
       describe('when scrolling', function() {
         describe('when LTR', function() {
         describe('when LTR', function() {
-          defineTest(true, 'ltr', cssProps);
-        });
+          defineTest(true, 'ltr', cssProps)
+        })
         describe('when RTL', function() {
         describe('when RTL', function() {
-          defineTest(true, 'rtl', cssProps);
-        });
-      });
-    });
+          defineTest(true, 'rtl', cssProps)
+        })
+      })
+    })
   }
   }
 
 
   function defineTest(isScrolling, dir, cssProps) {
   function defineTest(isScrolling, dir, cssProps) {
     it('computes correct widths', function() {
     it('computes correct widths', function() {
       var el = $(
       var el = $(
         '<div style="position:absolute" />'
         '<div style="position:absolute" />'
-        )
+      )
         .css('overflow', isScrolling ? 'scroll' : 'hidden')
         .css('overflow', isScrolling ? 'scroll' : 'hidden')
         .css('direction', dir)
         .css('direction', dir)
         .css(cssProps)
         .css(cssProps)
         .append('<div style="position:relative;width:100px;height:100px" />')
         .append('<div style="position:relative;width:100px;height:100px" />')
-        .appendTo('body');
+        .appendTo('body')
 
 
-      var widths = getScrollbarWidths(el);
-      var correctWidths;
+      var widths = getScrollbarWidths(el)
+      var correctWidths
 
 
       if (isScrolling) {
       if (isScrolling) {
-        correctWidths = getStockScrollbarWidths(dir);
-      }
-      else {
-        correctWidths = { left: 0, right: 0, top: 0, bottom: 0 };
+        correctWidths = getStockScrollbarWidths(dir)
+      } else {
+        correctWidths = { left: 0, right: 0, top: 0, bottom: 0 }
       }
       }
 
 
-      expect(widths.left).toBe(correctWidths.left);
-      expect(widths.right).toBe(correctWidths.right);
-      expect(widths.top).toBe(correctWidths.top);
-      expect(widths.bottom).toBe(correctWidths.bottom);
+      expect(widths.left).toBe(correctWidths.left)
+      expect(widths.right).toBe(correctWidths.right)
+      expect(widths.top).toBe(correctWidths.top)
+      expect(widths.bottom).toBe(correctWidths.bottom)
 
 
-      el.remove();
-    });
+      el.remove()
+    })
   }
   }
-});
+})

+ 1 - 1
tests/legacy/handleWindowResize.js

@@ -15,4 +15,4 @@ describe('handleWindowResize', function() {
     });
     });
   });
   });
   */
   */
-});
+})

+ 36 - 36
tests/legacy/header-navigation.js

@@ -2,60 +2,60 @@
 describe('header navigation', function() {
 describe('header navigation', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#calendar');
+    affix('#calendar')
     var options = {
     var options = {
       header: {
       header: {
         left: 'next,prev,prevYear,nextYear today',
         left: 'next,prev,prevYear,nextYear today',
         center: '',
         center: '',
         right: 'title'
         right: 'title'
       }
       }
-    };
-    $('#calendar').fullCalendar(options);
-  });
+    }
+    $('#calendar').fullCalendar(options)
+  })
 
 
   describe('and click next', function() {
   describe('and click next', function() {
     it('should change view to next month', function() {
     it('should change view to next month', function() {
-      $('#calendar').fullCalendar('gotoDate', '2010-02-01');
-      $('.fc-next-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2010-03-01');
-    });
-  });
+      $('#calendar').fullCalendar('gotoDate', '2010-02-01')
+      $('.fc-next-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2010-03-01')
+    })
+  })
 
 
   describe('and click prev', function() {
   describe('and click prev', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      $('#calendar').fullCalendar('gotoDate', '2010-02-01');
-      $('.fc-prev-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2010-01-01');
-    });
-  });
+      $('#calendar').fullCalendar('gotoDate', '2010-02-01')
+      $('.fc-prev-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2010-01-01')
+    })
+  })
 
 
   describe('and click prevYear', function() {
   describe('and click prevYear', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      $('#calendar').fullCalendar('gotoDate', '2010-02-01');
-      $('.fc-prevYear-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2009-02-01');
-    });
-  });
+      $('#calendar').fullCalendar('gotoDate', '2010-02-01')
+      $('.fc-prevYear-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2009-02-01')
+    })
+  })
 
 
   describe('and click nextYear', function() {
   describe('and click nextYear', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      $('#calendar').fullCalendar('gotoDate', '2010-02-01');
-      $('.fc-nextYear-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate');
-      expect(newDate).toEqualMoment('2011-02-01');
-    });
-  });
+      $('#calendar').fullCalendar('gotoDate', '2010-02-01')
+      $('.fc-nextYear-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate')
+      expect(newDate).toEqualMoment('2011-02-01')
+    })
+  })
 
 
   describe('and click today', function() {
   describe('and click today', function() {
     it('should change view to prev month', function() {
     it('should change view to prev month', function() {
-      $('#calendar').fullCalendar('gotoDate', '2010-02-01');
-      $('.fc-today-button').simulate('click');
-      var newDate = $('#calendar').fullCalendar('getDate'); // will be ambig zone
-      newDate.local(); // assign the local timezone
-      expect(newDate).toEqualNow();
-    });
-  });
-});
+      $('#calendar').fullCalendar('gotoDate', '2010-02-01')
+      $('.fc-today-button').simulate('click')
+      var newDate = $('#calendar').fullCalendar('getDate') // will be ambig zone
+      newDate.local() // assign the local timezone
+      expect(newDate).toEqualNow()
+    })
+  })
+})

+ 81 - 81
tests/legacy/header-rendering.js

@@ -2,31 +2,31 @@
 describe('header rendering', function() {
 describe('header rendering', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#calendar');
-  });
+    affix('#calendar')
+  })
 
 
   describe('when using default header options', function() {
   describe('when using default header options', function() {
     it('should have title as default on left', function() {
     it('should have title as default on left', function() {
-      $('#calendar').fullCalendar();
-      expect($('#calendar > .fc-toolbar > .fc-left > *')).toBeMatchedBy('h2');
-    });
+      $('#calendar').fullCalendar()
+      expect($('#calendar > .fc-toolbar > .fc-left > *')).toBeMatchedBy('h2')
+    })
     it('should have empty center', function() {
     it('should have empty center', function() {
-      $('#calendar').fullCalendar();
-      var center = $('#calendar > .fc-toolbar > .fc-center');
-      expect(center).toBeEmpty();
-    });
+      $('#calendar').fullCalendar()
+      var center = $('#calendar > .fc-toolbar > .fc-center')
+      expect(center).toBeEmpty()
+    })
     it('should have right with today|space|left|right', function() {
     it('should have right with today|space|left|right', function() {
-      $('#calendar').fullCalendar();
-      var rightChildren = $('#calendar > .fc-toolbar > .fc-right > *');
-      var todayButton = rightChildren.eq(0);
-      var buttonGroup = rightChildren.eq(1);
-      var prevNextButtons = buttonGroup.children();
-      expect(todayButton).toHaveClass('fc-today-button');
-      expect(buttonGroup).toHaveClass('fc-button-group');
-      expect(prevNextButtons.eq(0)).toHaveClass('fc-prev-button');
-      expect(prevNextButtons.eq(1)).toHaveClass('fc-next-button');
-    });
-  });
+      $('#calendar').fullCalendar()
+      var rightChildren = $('#calendar > .fc-toolbar > .fc-right > *')
+      var todayButton = rightChildren.eq(0)
+      var buttonGroup = rightChildren.eq(1)
+      var prevNextButtons = buttonGroup.children()
+      expect(todayButton).toHaveClass('fc-today-button')
+      expect(buttonGroup).toHaveClass('fc-button-group')
+      expect(prevNextButtons.eq(0)).toHaveClass('fc-prev-button')
+      expect(prevNextButtons.eq(1)).toHaveClass('fc-next-button')
+    })
+  })
 
 
   describe('when supplying header options', function() {
   describe('when supplying header options', function() {
     beforeEach(function() {
     beforeEach(function() {
@@ -36,50 +36,50 @@ describe('header rendering', function() {
           center: 'prevYear today nextYear agendaView,dayView',
           center: 'prevYear today nextYear agendaView,dayView',
           right: 'title'
           right: 'title'
         }
         }
-      };
-      $('#calendar').fullCalendar(options);
-    });
+      }
+      $('#calendar').fullCalendar(options)
+    })
     it('should have title on the right', function() {
     it('should have title on the right', function() {
-      expect($('#calendar > .fc-toolbar > .fc-right > *')).toBeMatchedBy('h2');
-    });
+      expect($('#calendar > .fc-toolbar > .fc-right > *')).toBeMatchedBy('h2')
+    })
     it('should have next|prev on left', function() {
     it('should have next|prev on left', function() {
-      var buttonGroup = $('#calendar > .fc-toolbar > .fc-left > *');
-      var prevNextButtons = buttonGroup.children();
-      expect(prevNextButtons.eq(0)).toHaveClass('fc-next-button');
-      expect(prevNextButtons.eq(1)).toHaveClass('fc-prev-button');
-    });
+      var buttonGroup = $('#calendar > .fc-toolbar > .fc-left > *')
+      var prevNextButtons = buttonGroup.children()
+      expect(prevNextButtons.eq(0)).toHaveClass('fc-next-button')
+      expect(prevNextButtons.eq(1)).toHaveClass('fc-prev-button')
+    })
     it('should have prevYear|space|today|space|nextYear in center', function() {
     it('should have prevYear|space|today|space|nextYear in center', function() {
-      var items = $('#calendar > .fc-toolbar > .fc-center > *');
-      expect(items.eq(0)).toHaveClass('fc-prevYear-button');
-      expect(items.eq(1)).toHaveClass('fc-today-button');
-      expect(items.eq(2)).toHaveClass('fc-nextYear-button');
-    });
-  });
+      var items = $('#calendar > .fc-toolbar > .fc-center > *')
+      expect(items.eq(0)).toHaveClass('fc-prevYear-button')
+      expect(items.eq(1)).toHaveClass('fc-today-button')
+      expect(items.eq(2)).toHaveClass('fc-nextYear-button')
+    })
+  })
 
 
   describe('when setting header to false', function() {
   describe('when setting header to false', function() {
     beforeEach(function() {
     beforeEach(function() {
       var options = {
       var options = {
         header: false
         header: false
-      };
-      $('#calendar').fullCalendar(options);
-    });
+      }
+      $('#calendar').fullCalendar(options)
+    })
     it('should not have header table', function() {
     it('should not have header table', function() {
-      expect($('.fc-toolbar')).not.toBeInDOM();
-    });
-  });
+      expect($('.fc-toolbar')).not.toBeInDOM()
+    })
+  })
 
 
   it('allow for dynamically changing', function() {
   it('allow for dynamically changing', function() {
-    $('#calendar').fullCalendar();
-    expect($('.fc-toolbar')).toBeInDOM();
-    $('#calendar').fullCalendar('option', 'header', false);
-    expect($('.fc-toolbar')).not.toBeInDOM();
-  });
+    $('#calendar').fullCalendar()
+    expect($('.fc-toolbar')).toBeInDOM()
+    $('#calendar').fullCalendar('option', 'header', false)
+    expect($('.fc-toolbar')).not.toBeInDOM()
+  })
 
 
   describe('renders left and right literally', function() {
   describe('renders left and right literally', function() {
     [ true, false ].forEach(function(isRTL) {
     [ true, false ].forEach(function(isRTL) {
       describe('when isRTL is ' + isRTL, function() {
       describe('when isRTL is ' + isRTL, function() {
         beforeEach(function() {
         beforeEach(function() {
-          var options = {};
+          var options = {}
           $('#calendar').fullCalendar({
           $('#calendar').fullCalendar({
             header: {
             header: {
               left: 'prev',
               left: 'prev',
@@ -87,57 +87,57 @@ describe('header rendering', function() {
               right: 'next'
               right: 'next'
             },
             },
             isRTL: isRTL
             isRTL: isRTL
-          });
-        });
+          })
+        })
         it('should have prev in left', function() {
         it('should have prev in left', function() {
-          var fcHeaderLeft = $('#calendar .fc-toolbar > .fc-left');
-          expect(fcHeaderLeft).toContainElement('.fc-prev-button');
-        });
+          var fcHeaderLeft = $('#calendar .fc-toolbar > .fc-left')
+          expect(fcHeaderLeft).toContainElement('.fc-prev-button')
+        })
         it('should have today in center', function() {
         it('should have today in center', function() {
-          var fcHeaderCenter = $('#calendar .fc-toolbar > .fc-center');
-          expect(fcHeaderCenter).toContainElement('.fc-today-button');
-        });
+          var fcHeaderCenter = $('#calendar .fc-toolbar > .fc-center')
+          expect(fcHeaderCenter).toContainElement('.fc-today-button')
+        })
         it('should have next in right', function() {
         it('should have next in right', function() {
-          var fcHeaderRight = $('#calendar .fc-toolbar > .fc-right');
-          expect(fcHeaderRight).toContainElement('.fc-next-button');
-        });
-      });
-    });
-  });
+          var fcHeaderRight = $('#calendar .fc-toolbar > .fc-right')
+          expect(fcHeaderRight).toContainElement('.fc-next-button')
+        })
+      })
+    })
+  })
 
 
   describe('when calendar is within a form', function() {
   describe('when calendar is within a form', function() {
     beforeEach(function() {
     beforeEach(function() {
-      $('#calendar').wrap('<form action="http://google.com/"></form>');
-    });
+      $('#calendar').wrap('<form action="http://google.com/"></form>')
+    })
     it('should not submit the form when clicking the button', function(done) {
     it('should not submit the form when clicking the button', function(done) {
       var options = {
       var options = {
         header: {
         header: {
           left: 'prev,next',
           left: 'prev,next',
           right: 'title'
           right: 'title'
         }
         }
-      };
-      var unloadCalled = false;
+      }
+      var unloadCalled = false
 
 
       function beforeUnloadHandler() {
       function beforeUnloadHandler() {
-        console.log('when calendar is within a form, it submits!!!');
-        unloadCalled = true;
-        cleanup();
-        return 'click stay on this page';
+        console.log('when calendar is within a form, it submits!!!')
+        unloadCalled = true
+        cleanup()
+        return 'click stay on this page'
       }
       }
-      $(window).on('beforeunload', beforeUnloadHandler);
+      $(window).on('beforeunload', beforeUnloadHandler)
 
 
       function cleanup() {
       function cleanup() {
-        $(window).off('beforeunload', beforeUnloadHandler);
+        $(window).off('beforeunload', beforeUnloadHandler)
       }
       }
 
 
-      $('#calendar').fullCalendar(options);
-      $('.fc-next-button').simulate('click');
+      $('#calendar').fullCalendar(options)
+      $('.fc-next-button').simulate('click')
 
 
       setTimeout(function() { // wait to see if handler was called
       setTimeout(function() { // wait to see if handler was called
-        expect(unloadCalled).toBe(false);
-        cleanup();
-        done();
-      }, 100);
-    });
-  });
-});
+        expect(unloadCalled).toBe(false)
+        cleanup()
+        done()
+      }, 100)
+    })
+  })
+})

+ 290 - 289
tests/legacy/height-and-contentHeight.js

@@ -1,316 +1,317 @@
 (function() {
 (function() {
 
 
-[ 'height', 'contentHeight' ].forEach(function(heightProp) { describe(heightProp, function() {
-
-  var calendarEl;
-  var options;
-  var heightElm;
-  var asAMethod;
-  var heightPropDescriptions = [
-    { description: 'as a number', height: 600 },
-    { description: 'as a function', height: getParentHeight, heightWrapper: true }
-  ];
-
-  if (heightProp === 'height') {
-    heightPropDescriptions.push({ description: 'as "parent"', height: 'parent', heightWrapper: true });
-  }
-
-  beforeEach(function() {
-    affix('#cal');
-    calendarEl = $('#cal');
-    calendarEl.width(900);
-    options = {
-      defaultDate: '2014-08-01'
-    };
-  });
-
-  function getParentHeight() {
-    return calendarEl.parent().height();
-  }
-
-  // relies on asAMethod (boolean)
-  // otherOptions: other calendar options to dynamically set (assumes asAMethod)
-  function init(heightVal, otherOptions) {
-    if (asAMethod) {
-      calendarEl.fullCalendar(options);
-
-      if (otherOptions === undefined) {
-        calendarEl.fullCalendar('option', heightProp, heightVal);
-      }
-      else {
-        otherOptions[heightProp] = heightVal; // reuse same object. insert height option
-        calendarEl.fullCalendar('option', otherOptions);
+  [ 'height', 'contentHeight' ].forEach(function(heightProp) {
+    describe(heightProp, function() {
+
+      var calendarEl
+      var options
+      var heightElm
+      var asAMethod
+      var heightPropDescriptions = [
+        { description: 'as a number', height: 600 },
+        { description: 'as a function', height: getParentHeight, heightWrapper: true }
+      ]
+
+      if (heightProp === 'height') {
+        heightPropDescriptions.push({ description: 'as "parent"', height: 'parent', heightWrapper: true })
       }
       }
-    }
-    else {
-      options[heightProp] = heightVal;
-      calendarEl.fullCalendar(options);
-    }
-
-    if (heightProp === 'height') {
-      heightElm = $('.fc');
-    }
-    else {
-      heightElm = $('.fc-view');
-    }
-  }
 
 
-  function expectHeight(heightVal) {
-    var diff = Math.abs(heightElm.outerHeight() - heightVal);
-    expect(diff).toBeLessThan(2); // off-by-one or exactly the same. for zoom, and firefox
-  }
-
-  $.each({
-    'as an init option': false,
-    'as a method': true
-  }, function(desc, bool) { describe(desc, function() {
-
-    beforeEach(function() {
-      asAMethod = bool;
-    });
-
-    describe('for ' + heightProp, function() {
-      describe('when in month view', function() {
-        beforeEach(function() {
-          options.defaultView = 'month';
-        });
-
-        heightPropDescriptions.forEach(function(testInfo) {
-          describe(testInfo.description, function() {
-            if (testInfo.heightWrapper) {
-              beforeEach(function() {
-                calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />');
-              });
-            }
-
-            describe('when there are no events', function() {
-              it('should be the specified height, with no scrollbars', function() {
-                var diff;
-                init(testInfo.height);
-                diff = Math.abs(heightElm.outerHeight() - 600);
-                expect(diff).toBeLessThan(2);
-                expect('.fc-day-grid-container').not.toHaveScrollbars();
-              });
-            });
-
-            describe('when there is one tall row of events', function() {
-              beforeEach(function() {
-                options.events = repeatClone({ title: 'event', start: '2014-08-04' }, 9);
-              });
-
-              it('should take away height from other rows, but not do scrollbars', function() {
-                init(testInfo.height);
-                var rows = $('.fc-day-grid .fc-row');
-                var tallRow = rows.eq(1);
-                var shortRows = rows.not(tallRow); // 0, 2, 3, 4, 5
-                var shortHeight = shortRows.eq(0).outerHeight();
-
-                expectHeight(600);
-
-                shortRows.each(function(i, node) {
-                  var rowHeight = $(node).outerHeight();
-                  var diff = Math.abs(rowHeight - shortHeight);
-                  expect(diff).toBeLessThan(10); // all roughly the same
-                });
-
-                expect(tallRow.outerHeight()).toBeGreaterThan(shortHeight * 2); // much taller
-                expect('.fc-day-grid-container').not.toHaveScrollbars();
-              });
-            });
+      beforeEach(function() {
+        affix('#cal')
+        calendarEl = $('#cal')
+        calendarEl.width(900)
+        options = {
+          defaultDate: '2014-08-01'
+        }
+      })
+
+      function getParentHeight() {
+        return calendarEl.parent().height()
+      }
 
 
-            describe('when there are many tall rows of events', function() {
-              beforeEach(function() {
-                options.events = [].concat(
-                  repeatClone({ title: 'event0', start: '2014-07-28' }, 9),
-                  repeatClone({ title: 'event1', start: '2014-08-04' }, 9),
-                  repeatClone({ title: 'event2', start: '2014-08-11' }, 9),
-                  repeatClone({ title: 'event3', start: '2014-08-18' }, 9),
-                  repeatClone({ title: 'event4', start: '2014-08-25' }, 9),
-                  repeatClone({ title: 'event5', start: '2014-09-01' }, 9)
-                );
-              });
-
-              it('height is correct and scrollbars show up', function() {
-                init(testInfo.height);
-                expectHeight(600);
-                expect($('.fc-day-grid-container')).toHaveScrollbars();
-              });
-            });
+      // relies on asAMethod (boolean)
+      // otherOptions: other calendar options to dynamically set (assumes asAMethod)
+      function init(heightVal, otherOptions) {
+        if (asAMethod) {
+          calendarEl.fullCalendar(options)
+
+          if (otherOptions === undefined) {
+            calendarEl.fullCalendar('option', heightProp, heightVal)
+          } else {
+            otherOptions[heightProp] = heightVal // reuse same object. insert height option
+            calendarEl.fullCalendar('option', otherOptions)
+          }
+        } else {
+          options[heightProp] = heightVal
+          calendarEl.fullCalendar(options)
+        }
+
+        if (heightProp === 'height') {
+          heightElm = $('.fc')
+        } else {
+          heightElm = $('.fc-view')
+        }
+      }
 
 
-            describe('when setting height, contentHeight option with other options', function() {
-              beforeEach(function() {
-                options[heightProp] = 600; // initialize with another height
-                init(250, { minTime: '00:00' }); // then change height, providing other opts to set too
-              });
+      function expectHeight(heightVal) {
+        var diff = Math.abs(heightElm.outerHeight() - heightVal)
+        expect(diff).toBeLessThan(2) // off-by-one or exactly the same. for zoom, and firefox
+      }
 
 
-              it('height of the view container should change', function() {
-                expectHeight(250);
-              });
-            });
-          });
-        });
+      $.each({
+        'as an init option': false,
+        'as a method': true
+      }, function(desc, bool) {
+        describe(desc, function() {
 
 
-        describe('as "auto", when there are many tall rows of events', function() {
           beforeEach(function() {
           beforeEach(function() {
-            options.events = [].concat(
-              repeatClone({ title: 'event0', start: '2014-07-28' }, 9),
-              repeatClone({ title: 'event1', start: '2014-08-04' }, 9),
-              repeatClone({ title: 'event2', start: '2014-08-11' }, 9),
-              repeatClone({ title: 'event3', start: '2014-08-18' }, 9),
-              repeatClone({ title: 'event4', start: '2014-08-25' }, 9),
-              repeatClone({ title: 'event5', start: '2014-09-01' }, 9)
-            );
-          });
-          it('height is really tall and there are no scrollbars', function() {
-            init('auto');
-            expect(heightElm.outerHeight()).toBeGreaterThan(1000); // pretty tall
-            expect($('.fc-day-grid-container')).not.toHaveScrollbars();
-          });
-        });
-      });
-
-      [ 'basicWeek', 'basicDay' ].forEach(function(viewName) {
-        describe('in ' + viewName + ' view', function() {
-          beforeEach(function() {
-            options.defaultView = viewName;
-          });
-
-          heightPropDescriptions.forEach(function(testInfo) {
-            describe(testInfo.description, function() {
-              if (testInfo.heightWrapper) {
-                beforeEach(function() {
-                  calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />');
-                });
-              }
-
-              describe('when there are no events', function() {
-                it('should be the specified height, with no scrollbars', function() {
-                  init(testInfo.height);
-                  expectHeight(600);
-                  expect('.fc-day-grid-container').not.toHaveScrollbars();
-                });
-              });
-
-              describe('when there are many events', function() {
-                beforeEach(function() {
-                  options.events = repeatClone({ title: 'event', start: '2014-08-01' }, 100);
-                });
-                it('should have the correct height, with scrollbars', function() {
-                  init(testInfo.height);
-                  expectHeight(600);
-                  expect('.fc-day-grid-container').toHaveScrollbars();
-                });
-              });
-            });
-          });
+            asAMethod = bool
+          })
 
 
-          describe('as "auto", when there are many events', function() {
-            beforeEach(function() {
-              options.events = repeatClone({ title: 'event', start: '2014-08-01' }, 100);
-            });
-            it('should be really tall with no scrollbars', function() {
-              init('auto');
-              expect(heightElm.outerHeight()).toBeGreaterThan(1000); // pretty tall
-              expect('.fc-day-grid-container').not.toHaveScrollbars();
-            });
-          });
-        });
-      });
-
-      [ 'agendaWeek', 'agendaDay' ].forEach(function(viewName) {
-        describe('in ' + viewName + ' view', function() {
-          beforeEach(function() {
-            options.defaultView = viewName;
-          });
-
-          $.each({
-            'with no all-day section': { allDaySlot: false },
-            'with no all-day events': { },
-            'with some all-day events': { events: repeatClone({ title: 'event', start: '2014-08-01' }, 6) }
-          }, function(desc, moreOptions) {
-            describe(desc, function() {
+          describe('for ' + heightProp, function() {
+            describe('when in month view', function() {
               beforeEach(function() {
               beforeEach(function() {
-                $.extend(options, moreOptions);
-              });
+                options.defaultView = 'month'
+              })
 
 
               heightPropDescriptions.forEach(function(testInfo) {
               heightPropDescriptions.forEach(function(testInfo) {
                 describe(testInfo.description, function() {
                 describe(testInfo.description, function() {
                   if (testInfo.heightWrapper) {
                   if (testInfo.heightWrapper) {
                     beforeEach(function() {
                     beforeEach(function() {
-                      calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />');
-                    });
+                      calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />')
+                    })
                   }
                   }
 
 
-                  describe('with only a few slots', function() {
+                  describe('when there are no events', function() {
+                    it('should be the specified height, with no scrollbars', function() {
+                      var diff
+                      init(testInfo.height)
+                      diff = Math.abs(heightElm.outerHeight() - 600)
+                      expect(diff).toBeLessThan(2)
+                      expect('.fc-day-grid-container').not.toHaveScrollbars()
+                    })
+                  })
+
+                  describe('when there is one tall row of events', function() {
                     beforeEach(function() {
                     beforeEach(function() {
-                      options.minTime = '06:00:00';
-                      options.maxTime = '10:00:00';
-                    });
-                    it('should be the correct height, with a horizontal rule to occupy space', function() {
-                      init(testInfo.height);
-                      expectHeight(600);
-                      expect($('.fc-time-grid > hr')).toBeVisible();
-                    });
-                  });
-
-                  describe('with many slots', function() {
+                      options.events = repeatClone({ title: 'event', start: '2014-08-04' }, 9)
+                    })
+
+                    it('should take away height from other rows, but not do scrollbars', function() {
+                      init(testInfo.height)
+                      var rows = $('.fc-day-grid .fc-row')
+                      var tallRow = rows.eq(1)
+                      var shortRows = rows.not(tallRow) // 0, 2, 3, 4, 5
+                      var shortHeight = shortRows.eq(0).outerHeight()
+
+                      expectHeight(600)
+
+                      shortRows.each(function(i, node) {
+                        var rowHeight = $(node).outerHeight()
+                        var diff = Math.abs(rowHeight - shortHeight)
+                        expect(diff).toBeLessThan(10) // all roughly the same
+                      })
+
+                      expect(tallRow.outerHeight()).toBeGreaterThan(shortHeight * 2) // much taller
+                      expect('.fc-day-grid-container').not.toHaveScrollbars()
+                    })
+                  })
+
+                  describe('when there are many tall rows of events', function() {
                     beforeEach(function() {
                     beforeEach(function() {
-                      options.minTime = '00:00:00';
-                      options.maxTime = '24:00:00';
-                    });
-                    it('should be the correct height, with scrollbars and no filler hr', function() {
-                      init(testInfo.height);
-                      expectHeight(600);
-                      expect($('.fc-time-grid-container')).toHaveScrollbars();
-                      expect($('.fc-time-grid > hr')).not.toBeVisible();
-                    });
-                  });
-                });
-              });
-
-              describe('as "auto", with only a few slots', function() {
-                beforeEach(function() {
-                  options.minTime = '06:00:00';
-                  options.maxTime = '10:00:00';
-                });
-                it('should be really short with no scrollbars nor horizontal rule', function() {
-                  init('auto');
-                  expect(heightElm.outerHeight()).toBeLessThan(500); // pretty short
-                  expect($('.fc-time-grid-container')).not.toHaveScrollbars();
-                  expect($('.fc-time-grid > hr')).not.toBeVisible();
-                });
-              });
-
-              describe('as a "auto", with many slots', function() {
+                      options.events = [].concat(
+                        repeatClone({ title: 'event0', start: '2014-07-28' }, 9),
+                        repeatClone({ title: 'event1', start: '2014-08-04' }, 9),
+                        repeatClone({ title: 'event2', start: '2014-08-11' }, 9),
+                        repeatClone({ title: 'event3', start: '2014-08-18' }, 9),
+                        repeatClone({ title: 'event4', start: '2014-08-25' }, 9),
+                        repeatClone({ title: 'event5', start: '2014-09-01' }, 9)
+                      )
+                    })
+
+                    it('height is correct and scrollbars show up', function() {
+                      init(testInfo.height)
+                      expectHeight(600)
+                      expect($('.fc-day-grid-container')).toHaveScrollbars()
+                    })
+                  })
+
+                  describe('when setting height, contentHeight option with other options', function() {
+                    beforeEach(function() {
+                      options[heightProp] = 600 // initialize with another height
+                      init(250, { minTime: '00:00' }) // then change height, providing other opts to set too
+                    })
+
+                    it('height of the view container should change', function() {
+                      expectHeight(250)
+                    })
+                  })
+                })
+              })
+
+              describe('as "auto", when there are many tall rows of events', function() {
                 beforeEach(function() {
                 beforeEach(function() {
-                  options.minTime = '00:00:00';
-                  options.maxTime = '24:00:00';
-                });
-                it('should be really tall with no scrollbars nor horizontal rule', function() {
-                  init('auto');
-                  expect(heightElm.outerHeight()).toBeGreaterThan(900); // pretty tall
-                  expect($('.fc-time-grid-container')).not.toHaveScrollbars();
-                  expect($('.fc-time-grid > hr')).not.toBeVisible();
-                });
-              });
+                  options.events = [].concat(
+                    repeatClone({ title: 'event0', start: '2014-07-28' }, 9),
+                    repeatClone({ title: 'event1', start: '2014-08-04' }, 9),
+                    repeatClone({ title: 'event2', start: '2014-08-11' }, 9),
+                    repeatClone({ title: 'event3', start: '2014-08-18' }, 9),
+                    repeatClone({ title: 'event4', start: '2014-08-25' }, 9),
+                    repeatClone({ title: 'event5', start: '2014-09-01' }, 9)
+                  )
+                })
+                it('height is really tall and there are no scrollbars', function() {
+                  init('auto')
+                  expect(heightElm.outerHeight()).toBeGreaterThan(1000) // pretty tall
+                  expect($('.fc-day-grid-container')).not.toHaveScrollbars()
+                })
+              })
             });
             });
-          });
-        });
-      });
-    });
-  }); });
-}); });
 
 
+            [ 'basicWeek', 'basicDay' ].forEach(function(viewName) {
+              describe('in ' + viewName + ' view', function() {
+                beforeEach(function() {
+                  options.defaultView = viewName
+                })
+
+                heightPropDescriptions.forEach(function(testInfo) {
+                  describe(testInfo.description, function() {
+                    if (testInfo.heightWrapper) {
+                      beforeEach(function() {
+                        calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />')
+                      })
+                    }
+
+                    describe('when there are no events', function() {
+                      it('should be the specified height, with no scrollbars', function() {
+                        init(testInfo.height)
+                        expectHeight(600)
+                        expect('.fc-day-grid-container').not.toHaveScrollbars()
+                      })
+                    })
+
+                    describe('when there are many events', function() {
+                      beforeEach(function() {
+                        options.events = repeatClone({ title: 'event', start: '2014-08-01' }, 100)
+                      })
+                      it('should have the correct height, with scrollbars', function() {
+                        init(testInfo.height)
+                        expectHeight(600)
+                        expect('.fc-day-grid-container').toHaveScrollbars()
+                      })
+                    })
+                  })
+                })
+
+                describe('as "auto", when there are many events', function() {
+                  beforeEach(function() {
+                    options.events = repeatClone({ title: 'event', start: '2014-08-01' }, 100)
+                  })
+                  it('should be really tall with no scrollbars', function() {
+                    init('auto')
+                    expect(heightElm.outerHeight()).toBeGreaterThan(1000) // pretty tall
+                    expect('.fc-day-grid-container').not.toHaveScrollbars()
+                  })
+                })
+              })
+            });
 
 
-function repeatClone(srcObj, times) {
-  var a = [];
-  var i;
+            [ 'agendaWeek', 'agendaDay' ].forEach(function(viewName) {
+              describe('in ' + viewName + ' view', function() {
+                beforeEach(function() {
+                  options.defaultView = viewName
+                })
+
+                $.each({
+                  'with no all-day section': { allDaySlot: false },
+                  'with no all-day events': { },
+                  'with some all-day events': { events: repeatClone({ title: 'event', start: '2014-08-01' }, 6) }
+                }, function(desc, moreOptions) {
+                  describe(desc, function() {
+                    beforeEach(function() {
+                      $.extend(options, moreOptions)
+                    })
+
+                    heightPropDescriptions.forEach(function(testInfo) {
+                      describe(testInfo.description, function() {
+                        if (testInfo.heightWrapper) {
+                          beforeEach(function() {
+                            calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />')
+                          })
+                        }
+
+                        describe('with only a few slots', function() {
+                          beforeEach(function() {
+                            options.minTime = '06:00:00'
+                            options.maxTime = '10:00:00'
+                          })
+                          it('should be the correct height, with a horizontal rule to occupy space', function() {
+                            init(testInfo.height)
+                            expectHeight(600)
+                            expect($('.fc-time-grid > hr')).toBeVisible()
+                          })
+                        })
+
+                        describe('with many slots', function() {
+                          beforeEach(function() {
+                            options.minTime = '00:00:00'
+                            options.maxTime = '24:00:00'
+                          })
+                          it('should be the correct height, with scrollbars and no filler hr', function() {
+                            init(testInfo.height)
+                            expectHeight(600)
+                            expect($('.fc-time-grid-container')).toHaveScrollbars()
+                            expect($('.fc-time-grid > hr')).not.toBeVisible()
+                          })
+                        })
+                      })
+                    })
+
+                    describe('as "auto", with only a few slots', function() {
+                      beforeEach(function() {
+                        options.minTime = '06:00:00'
+                        options.maxTime = '10:00:00'
+                      })
+                      it('should be really short with no scrollbars nor horizontal rule', function() {
+                        init('auto')
+                        expect(heightElm.outerHeight()).toBeLessThan(500) // pretty short
+                        expect($('.fc-time-grid-container')).not.toHaveScrollbars()
+                        expect($('.fc-time-grid > hr')).not.toBeVisible()
+                      })
+                    })
+
+                    describe('as a "auto", with many slots', function() {
+                      beforeEach(function() {
+                        options.minTime = '00:00:00'
+                        options.maxTime = '24:00:00'
+                      })
+                      it('should be really tall with no scrollbars nor horizontal rule', function() {
+                        init('auto')
+                        expect(heightElm.outerHeight()).toBeGreaterThan(900) // pretty tall
+                        expect($('.fc-time-grid-container')).not.toHaveScrollbars()
+                        expect($('.fc-time-grid > hr')).not.toBeVisible()
+                      })
+                    })
+                  })
+                })
+              })
+            })
+          })
+        })
+      })
+    })
+  })
+
+
+  function repeatClone(srcObj, times) {
+    var a = []
+    var i
+
+    for (i = 0; i < times; i++) {
+      a.push($.extend({}, srcObj))
+    }
 
 
-  for (i = 0; i < times; i++) {
-    a.push($.extend({}, srcObj));
+    return a
   }
   }
 
 
-  return a;
-}
-
-})();
+})()

+ 52 - 52
tests/legacy/hiddenDays.js

@@ -2,87 +2,87 @@
 describe('hiddenDays', function() {
 describe('hiddenDays', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-  });
+    affix('#cal')
+  })
 
 
   describe('when using default', function() {
   describe('when using default', function() {
     beforeEach(function() {
     beforeEach(function() {
-      $('#cal').fullCalendar();
-    });
+      $('#cal').fullCalendar()
+    })
     it('should show 7 days of the week', function() {
     it('should show 7 days of the week', function() {
-      var daysCount = $('.fc-day-header').length;
-      expect(daysCount).toEqual(7);
-    });
-  });
+      var daysCount = $('.fc-day-header').length
+      expect(daysCount).toEqual(7)
+    })
+  })
 
 
   describe('when setting an empty hiddenDays', function() {
   describe('when setting an empty hiddenDays', function() {
     beforeEach(function() {
     beforeEach(function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         hiddenDays: []
         hiddenDays: []
-      });
-    });
+      })
+    })
     it('should return 7 days of the week', function() {
     it('should return 7 days of the week', function() {
-      var daysCount = $('.fc-day-header').length;
-      expect(daysCount).toEqual(7);
-    });
-  });
+      var daysCount = $('.fc-day-header').length
+      expect(daysCount).toEqual(7)
+    })
+  })
 
 
   describe('when setting hiddenDays with 1', function() {
   describe('when setting hiddenDays with 1', function() {
     beforeEach(function() {
     beforeEach(function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         hiddenDays: [ 1 ]
         hiddenDays: [ 1 ]
-      });
-    });
+      })
+    })
     it('should return 6 days', function() {
     it('should return 6 days', function() {
-      var daysCount = $('.fc-day-header').length;
-      expect(daysCount).toEqual(6);
-    });
+      var daysCount = $('.fc-day-header').length
+      expect(daysCount).toEqual(6)
+    })
     it('should return sun,tue,wed..sat days', function() {
     it('should return sun,tue,wed..sat days', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-sun');
-      expect(daysOfWeek[1]).toHaveClass('fc-tue');
-      expect(daysOfWeek[5]).toHaveClass('fc-sat');
-    });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-sun')
+      expect(daysOfWeek[1]).toHaveClass('fc-tue')
+      expect(daysOfWeek[5]).toHaveClass('fc-sat')
+    })
     it('should expect 7th day to be undefined', function() {
     it('should expect 7th day to be undefined', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[6]).toBeUndefined();
-    });
-  });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[6]).toBeUndefined()
+    })
+  })
 
 
   describe('when setting hiddenDays with 3,5', function() {
   describe('when setting hiddenDays with 3,5', function() {
     beforeEach(function() {
     beforeEach(function() {
       $('#cal').fullCalendar({
       $('#cal').fullCalendar({
         hiddenDays: [ 3, 5 ]
         hiddenDays: [ 3, 5 ]
-      });
-    });
+      })
+    })
     it('should return 6 days', function() {
     it('should return 6 days', function() {
-      var daysCount = $('.fc-day-header').length;
-      expect(daysCount).toEqual(5);
-    });
+      var daysCount = $('.fc-day-header').length
+      expect(daysCount).toEqual(5)
+    })
     it('should return s,m,t,t,s ', function() {
     it('should return s,m,t,t,s ', function() {
-      var daysOfWeek = $('.fc-day-header');
-      expect(daysOfWeek[0]).toHaveClass('fc-sun');
-      expect(daysOfWeek[1]).toHaveClass('fc-mon');
-      expect(daysOfWeek[2]).toHaveClass('fc-tue');
-      expect(daysOfWeek[3]).toHaveClass('fc-thu');
-      expect(daysOfWeek[4]).toHaveClass('fc-sat');
-    });
+      var daysOfWeek = $('.fc-day-header')
+      expect(daysOfWeek[0]).toHaveClass('fc-sun')
+      expect(daysOfWeek[1]).toHaveClass('fc-mon')
+      expect(daysOfWeek[2]).toHaveClass('fc-tue')
+      expect(daysOfWeek[3]).toHaveClass('fc-thu')
+      expect(daysOfWeek[4]).toHaveClass('fc-sat')
+    })
     it('should expect wed and fri be undefined', function() {
     it('should expect wed and fri be undefined', function() {
-      var fri = $('.fc-day-header.fc-fri')[0];
-      var wed = $('.fc-day-header.fc-wed')[0];
-      expect(fri).toBeUndefined();
-      expect(wed).toBeUndefined();
-    });
-  });
+      var fri = $('.fc-day-header.fc-fri')[0]
+      var wed = $('.fc-day-header.fc-wed')[0]
+      expect(fri).toBeUndefined()
+      expect(wed).toBeUndefined()
+    })
+  })
 
 
   describe('when setting all hiddenDays', function() {
   describe('when setting all hiddenDays', function() {
     it('should expect to throw an exception', function() {
     it('should expect to throw an exception', function() {
       var options = {
       var options = {
         hiddenDays: [ 0, 1, 2, 3, 4, 5, 6 ]
         hiddenDays: [ 0, 1, 2, 3, 4, 5, 6 ]
-      };
+      }
       expect(function() {
       expect(function() {
-        $('#cal').fullCalendar(options);
-      }).toThrow('invalid hiddenDays');
-    });
-  });
-});
+        $('#cal').fullCalendar(options)
+      }).toThrow('invalid hiddenDays')
+    })
+  })
+})

+ 12 - 12
tests/legacy/isRTL.js

@@ -3,9 +3,9 @@ describe('isRTL', function() {
   it('has it\'s default value computed differently based off of the locale', function() {
   it('has it\'s default value computed differently based off of the locale', function() {
     initCalendar({
     initCalendar({
       locale: 'ar' // Arabic is RTL
       locale: 'ar' // Arabic is RTL
-    });
-    expect(currentCalendar.option('isRTL')).toEqual(true);
-  });
+    })
+    expect(currentCalendar.option('isRTL')).toEqual(true)
+  })
 
 
   // NOTE: don't put tests related to other options in here!
   // NOTE: don't put tests related to other options in here!
   // Put them in the test file for the individual option!
   // Put them in the test file for the individual option!
@@ -13,16 +13,16 @@ describe('isRTL', function() {
   it('adapts to dynamic option change', function() {
   it('adapts to dynamic option change', function() {
     initCalendar({
     initCalendar({
       isRTL: false
       isRTL: false
-    });
-    var $el = $(currentCalendar.el);
+    })
+    var $el = $(currentCalendar.el)
 
 
-    expect($el).toHaveClass('fc-ltr');
-    expect($el).not.toHaveClass('fc-rtl');
+    expect($el).toHaveClass('fc-ltr')
+    expect($el).not.toHaveClass('fc-rtl')
 
 
-    currentCalendar.option('isRTL', true);
+    currentCalendar.option('isRTL', true)
 
 
-    expect($el).toHaveClass('fc-rtl');
-    expect($el).not.toHaveClass('fc-ltr');
-  });
+    expect($el).toHaveClass('fc-rtl')
+    expect($el).not.toHaveClass('fc-ltr')
+  })
 
 
-});
+})

+ 40 - 40
tests/legacy/locale.js

@@ -2,42 +2,42 @@
 describe('locale', function() {
 describe('locale', function() {
 
 
   afterEach(function() {
   afterEach(function() {
-    moment.locale('en');
-  });
+    moment.locale('en')
+  })
 
 
   it('is not affected by global moment locale when unset', function() {
   it('is not affected by global moment locale when unset', function() {
-    moment.locale('fr');
-    affix('#cal');
-    $('#cal').fullCalendar();
-    var calendar = $('#cal').fullCalendar('getCalendar');
-    var mom = calendar.moment('2014-05-01');
-    var s = mom.format('dddd MMMM Do YYYY');
-    expect(s).toEqual('Thursday May 1st 2014');
-  });
+    moment.locale('fr')
+    affix('#cal')
+    $('#cal').fullCalendar()
+    var calendar = $('#cal').fullCalendar('getCalendar')
+    var mom = calendar.moment('2014-05-01')
+    var s = mom.format('dddd MMMM Do YYYY')
+    expect(s).toEqual('Thursday May 1st 2014')
+  })
 
 
   it('is not affected by global moment locale when unset', function() {
   it('is not affected by global moment locale when unset', function() {
-    moment.locale('fr');
-    affix('#cal');
+    moment.locale('fr')
+    affix('#cal')
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
       locale: 'es'
       locale: 'es'
-    });
-    var calendar = $('#cal').fullCalendar('getCalendar');
-    var mom = calendar.moment('2014-05-01');
-    var s = mom.format('dddd MMMM Do YYYY');
-    expect(s).toEqual('jueves mayo 1º 2014');
-  });
+    })
+    var calendar = $('#cal').fullCalendar('getCalendar')
+    var mom = calendar.moment('2014-05-01')
+    var s = mom.format('dddd MMMM Do YYYY')
+    expect(s).toEqual('jueves mayo 1º 2014')
+  })
 
 
   it('doesn\'t side-effect the global moment locale when customized', function() {
   it('doesn\'t side-effect the global moment locale when customized', function() {
-    moment.locale('fr');
-    affix('#cal');
+    moment.locale('fr')
+    affix('#cal')
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
       locale: 'es'
       locale: 'es'
-    });
-    var mom = moment.utc('2014-05-01');
-    var s = mom.format('dddd MMMM Do YYYY');
-    expect(s).toEqual('jeudi mai 1er 2014');
-    expect(moment.locale()).toEqual('fr');
-  });
+    })
+    var mom = moment.utc('2014-05-01')
+    var s = mom.format('dddd MMMM Do YYYY')
+    expect(s).toEqual('jeudi mai 1er 2014')
+    expect(moment.locale()).toEqual('fr')
+  })
 
 
   // the most recent version of moment will actually throw a cryptic exception,
   // the most recent version of moment will actually throw a cryptic exception,
   // and instead of papering over this, just let it be thrown. will indicate that something
   // and instead of papering over this, just let it be thrown. will indicate that something
@@ -56,7 +56,7 @@ describe('locale', function() {
   */
   */
 
 
   it('works when certain locale has no FC settings defined', function() {
   it('works when certain locale has no FC settings defined', function() {
-    affix('#cal');
+    affix('#cal')
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
       locale: 'en-ca',
       locale: 'en-ca',
       defaultView: 'agendaWeek',
       defaultView: 'agendaWeek',
@@ -64,24 +64,24 @@ describe('locale', function() {
       events: [
       events: [
         { title: 'Christmas', start: '2014-12-25T10:00:00' }
         { title: 'Christmas', start: '2014-12-25T10:00:00' }
       ]
       ]
-    });
-    expect($('.fc-day-header:first')).toHaveText('Sun 12-21');
-    expect($('.fc-event .fc-time')).toHaveText('10:00');
-  });
+    })
+    expect($('.fc-day-header:first')).toHaveText('Sun 12-21')
+    expect($('.fc-event .fc-time')).toHaveText('10:00')
+  })
 
 
   it('allows dynamic setting', function() {
   it('allows dynamic setting', function() {
-    affix('#cal');
+    affix('#cal')
     $('#cal').fullCalendar({
     $('#cal').fullCalendar({
       locale: 'es',
       locale: 'es',
       defaultDate: '2016-07-10',
       defaultDate: '2016-07-10',
       defaultView: 'month'
       defaultView: 'month'
-    });
-    expect($('.fc h2')).toHaveText('julio 2016');
-    expect($('.fc')).not.toHaveClass('fc-rtl');
+    })
+    expect($('.fc h2')).toHaveText('julio 2016')
+    expect($('.fc')).not.toHaveClass('fc-rtl')
 
 
-    $('#cal').fullCalendar('option', 'locale', 'ar');
-    expect($('.fc h2')).toHaveText('تموز يوليو ٢٠١٦');
-    expect($('.fc')).toHaveClass('fc-rtl');
-  });
+    $('#cal').fullCalendar('option', 'locale', 'ar')
+    expect($('.fc h2')).toHaveText('تموز يوليو ٢٠١٦')
+    expect($('.fc')).toHaveClass('fc-rtl')
+  })
 
 
-});
+})

+ 65 - 65
tests/legacy/maxTime.js

@@ -1,17 +1,17 @@
 describe('maxTime', function() {
 describe('maxTime', function() {
 
 
   beforeEach(function() {
   beforeEach(function() {
-    affix('#cal');
-  });
+    affix('#cal')
+  })
 
 
   var numToStringConverter = function(timeIn) {
   var numToStringConverter = function(timeIn) {
-    var time = (timeIn % 12) || 12;
-    var amPm = 'am';
+    var time = (timeIn % 12) || 12
+    var amPm = 'am'
     if ((timeIn % 24) > 11) {
     if ((timeIn % 24) > 11) {
-      amPm = 'pm';
+      amPm = 'pm'
     }
     }
-    return time + amPm;
-  };
+    return time + amPm
+  }
 
 
   describe('when using the default settings', function() {
   describe('when using the default settings', function() {
 
 
@@ -19,106 +19,106 @@ describe('maxTime', function() {
       it('should start at 12am', function() {
       it('should start at 12am', function() {
         var options = {
         var options = {
           defaultView: 'agendaWeek'
           defaultView: 'agendaWeek'
-        };
-        $('#cal').fullCalendar(options);
-        var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text();
-        expect(lastSlotText).toEqual('11pm');
-      });
-    });
+        }
+        $('#cal').fullCalendar(options)
+        var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text()
+        expect(lastSlotText).toEqual('11pm')
+      })
+    })
 
 
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       it('should start at 12am', function() {
       it('should start at 12am', function() {
         var options = {
         var options = {
           defaultView: 'agendaDay'
           defaultView: 'agendaDay'
-        };
-        $('#cal').fullCalendar(options);
-        var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text();
-        expect(lastSlotText).toEqual('11pm');
-      });
-    });
-  });
+        }
+        $('#cal').fullCalendar(options)
+        var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text()
+        expect(lastSlotText).toEqual('11pm')
+      })
+    })
+  })
 
 
   describe('when using a whole number', function() {
   describe('when using a whole number', function() {
 
 
-    var hourNumbers = [ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ];
+    var hourNumbers = [ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ]
 
 
     describe('in agendaWeek', function() {
     describe('in agendaWeek', function() {
       beforeEach(function() {
       beforeEach(function() {
-        affix('#cal2');
-      });
+        affix('#cal2')
+      })
       hourNumbers.forEach(function(hourNumber) {
       hourNumbers.forEach(function(hourNumber) {
         it('should end at ' + hourNumber, function() {
         it('should end at ' + hourNumber, function() {
           var options = {
           var options = {
             defaultView: 'agendaWeek',
             defaultView: 'agendaWeek',
             maxTime: { hours: hourNumber }
             maxTime: { hours: hourNumber }
-          };
-          $('#cal2').fullCalendar(options);
-          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text();
-          var expected = numToStringConverter(hourNumber - 1);
-          expect(lastSlotText).toEqual(expected);
-        });
-      });
-    });
+          }
+          $('#cal2').fullCalendar(options)
+          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text()
+          var expected = numToStringConverter(hourNumber - 1)
+          expect(lastSlotText).toEqual(expected)
+        })
+      })
+    })
 
 
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       beforeEach(function() {
       beforeEach(function() {
-        affix('#cal2');
-      });
+        affix('#cal2')
+      })
       hourNumbers.forEach(function(hourNumber) {
       hourNumbers.forEach(function(hourNumber) {
         it('should end at ' + hourNumber, function() {
         it('should end at ' + hourNumber, function() {
           var options = {
           var options = {
             defaultView: 'agendaDay',
             defaultView: 'agendaDay',
             maxTime: hourNumber + ':00' // in addition, test string duration input
             maxTime: hourNumber + ':00' // in addition, test string duration input
-          };
-          $('#cal2').fullCalendar(options);
-          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text();
-          var expected = numToStringConverter(hourNumber - 1);
-          expect(lastSlotText).toEqual(expected);
-        });
-      });
-    });
-  });
+          }
+          $('#cal2').fullCalendar(options)
+          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text()
+          var expected = numToStringConverter(hourNumber - 1)
+          expect(lastSlotText).toEqual(expected)
+        })
+      })
+    })
+  })
 
 
   describe('when using default slotInterval and \'uneven\' maxTime', function() {
   describe('when using default slotInterval and \'uneven\' maxTime', function() {
 
 
-    var hourNumbers = [ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ];
+    var hourNumbers = [ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 ]
 
 
     describe('in agendaWeek', function() {
     describe('in agendaWeek', function() {
       beforeEach(function() {
       beforeEach(function() {
-        affix('#cal2');
-      });
+        affix('#cal2')
+      })
       hourNumbers.forEach(function(hourNumber) {
       hourNumbers.forEach(function(hourNumber) {
         it('should end at ' + hourNumber + ':20', function() {
         it('should end at ' + hourNumber + ':20', function() {
           var options = {
           var options = {
             defaultView: 'agendaWeek',
             defaultView: 'agendaWeek',
             maxTime: { hours: hourNumber, minutes: 20 }
             maxTime: { hours: hourNumber, minutes: 20 }
-          };
-          $('#cal2').fullCalendar(options);
-          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text();
+          }
+          $('#cal2').fullCalendar(options)
+          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text()
           // since exclusive end is :20, last slot will be on the current hour's 00:00
           // since exclusive end is :20, last slot will be on the current hour's 00:00
-          var expected = numToStringConverter(hourNumber);
-          expect(lastSlotText).toEqual(expected);
-        });
-      });
-    });
+          var expected = numToStringConverter(hourNumber)
+          expect(lastSlotText).toEqual(expected)
+        })
+      })
+    })
 
 
     describe('in agendaDay', function() {
     describe('in agendaDay', function() {
       beforeEach(function() {
       beforeEach(function() {
-        affix('#cal2');
-      });
+        affix('#cal2')
+      })
       hourNumbers.forEach(function(hourNumber) {
       hourNumbers.forEach(function(hourNumber) {
         it('should end at ' + hourNumber + ':20', function() {
         it('should end at ' + hourNumber + ':20', function() {
           var options = {
           var options = {
             defaultView: 'agendaDay',
             defaultView: 'agendaDay',
             maxTime: { hours: hourNumber, minutes: 20 }
             maxTime: { hours: hourNumber, minutes: 20 }
-          };
-          $('#cal2').fullCalendar(options);
-          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text();
+          }
+          $('#cal2').fullCalendar(options)
+          var lastSlotText = $('.fc-slats tr:not(.fc-minor):last .fc-time').text()
           // since exclusive end is :20, last slot will be on the current hour's 00:00
           // since exclusive end is :20, last slot will be on the current hour's 00:00
-          var expected = numToStringConverter(hourNumber);
-          expect(lastSlotText).toEqual(expected);
-        });
-      });
-    });
-  });
-});
+          var expected = numToStringConverter(hourNumber)
+          expect(lastSlotText).toEqual(expected)
+        })
+      })
+    })
+  })
+})

+ 142 - 142
tests/legacy/moment-ambig.js

@@ -2,193 +2,193 @@
 describe('ambiguously-zoned moment', function() {
 describe('ambiguously-zoned moment', function() {
 
 
   it('has a false hasZone', function() {
   it('has a false hasZone', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    expect(mom.hasZone()).toBe(false);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    expect(mom.hasZone()).toBe(false)
+  })
 
 
   it('has a true hasTime', function() {
   it('has a true hasTime', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    expect(mom.hasTime()).toBe(true);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    expect(mom.hasTime()).toBe(true)
+  })
 
 
   it('has a zero zone', function() {
   it('has a zero zone', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    expect(mom.utcOffset()).toBe(0);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    expect(mom.utcOffset()).toBe(0)
+  })
 
 
   it('formats without a zone part', function() {
   it('formats without a zone part', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    expect(mom.format()).toBe('2014-06-08T10:00:00');
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    expect(mom.format()).toBe('2014-06-08T10:00:00')
+  })
 
 
   it('formats via toISOString without a zone part', function() {
   it('formats via toISOString without a zone part', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    expect(mom.toISOString()).toBe('2014-06-08T10:00:00');
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    expect(mom.toISOString()).toBe('2014-06-08T10:00:00')
+  })
 
 
   it('formats via toISOString for locales with non-trivial formatting', function() {
   it('formats via toISOString for locales with non-trivial formatting', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar');
-    expect(mom.toISOString()).toBe('2014-06-08T10:00:00');
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar')
+    expect(mom.toISOString()).toBe('2014-06-08T10:00:00')
+  })
 
 
   it('formats ISO8601 via format() for locales with non-trivial formatting', function() {
   it('formats ISO8601 via format() for locales with non-trivial formatting', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar');
-    expect(mom.format()).toBe('2014-06-08T10:00:00');
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00').locale('ar')
+    expect(mom.format()).toBe('2014-06-08T10:00:00')
+  })
 
 
   it('is correctly cloned', function() {
   it('is correctly cloned', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    var clone = mom.clone();
-    expect(clone.hasZone()).toBe(false);
-    expect(clone.format()).toBe('2014-06-08T10:00:00');
-    expect(clone).not.toBe(mom);
-    clone.add(1, 'months');
-    expect(+clone).not.toBe(+mom);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    var clone = mom.clone()
+    expect(clone.hasZone()).toBe(false)
+    expect(clone.format()).toBe('2014-06-08T10:00:00')
+    expect(clone).not.toBe(mom)
+    clone.add(1, 'months')
+    expect(+clone).not.toBe(+mom)
+  })
 
 
   it('can be given a zone via utc', function() {
   it('can be given a zone via utc', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(false);
-    expect(mom.utcOffset()).toBe(0);
-    mom.utc();
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(true);
-    expect(mom.utcOffset()).toBe(0);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(false)
+    expect(mom.utcOffset()).toBe(0)
+    mom.utc()
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(true)
+    expect(mom.utcOffset()).toBe(0)
+  })
 
 
   it('can be given a zone via local', function() {
   it('can be given a zone via local', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    var equivDate = new Date(Date.UTC(2014, 5, 8, 10, 0, 0));
-    expect(mom.toArray()).toEqual([ 2014, 5, 8, 10, 0, 0, 0 ]);
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(false);
-    expect(mom.utcOffset()).toBe(0);
-    mom.local();
-    expect(mom.toArray()).toEqual([ 2014, 5, 8, 10, 0, 0, 0 ]);
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(true);
-    expect(mom.utcOffset()).toBe(-equivDate.getTimezoneOffset());
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    var equivDate = new Date(Date.UTC(2014, 5, 8, 10, 0, 0))
+    expect(mom.toArray()).toEqual([ 2014, 5, 8, 10, 0, 0, 0 ])
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(false)
+    expect(mom.utcOffset()).toBe(0)
+    mom.local()
+    expect(mom.toArray()).toEqual([ 2014, 5, 8, 10, 0, 0, 0 ])
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(true)
+    expect(mom.utcOffset()).toBe(-equivDate.getTimezoneOffset())
+  })
 
 
   it('can be given a zone via zone', function() {
   it('can be given a zone via zone', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00');
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(false);
-    expect(mom.utcOffset()).toBe(0);
-    mom.utcOffset(-420);
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(true);
-    expect(mom.utcOffset()).toBe(-420);
-  });
-
-});
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08T10:00:00')
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(false)
+    expect(mom.utcOffset()).toBe(0)
+    mom.utcOffset(-420)
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(true)
+    expect(mom.utcOffset()).toBe(-420)
+  })
+
+})
 
 
 describe('ambiguously-timed moment', function() {
 describe('ambiguously-timed moment', function() {
 
 
   it('has a false hasTime', function() {
   it('has a false hasTime', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    expect(mom.hasTime()).toBe(false);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    expect(mom.hasTime()).toBe(false)
+  })
 
 
   it('has a false hasZone', function() {
   it('has a false hasZone', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    expect(mom.hasZone()).toBe(false);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    expect(mom.hasZone()).toBe(false)
+  })
 
 
   it('has a zero time', function() {
   it('has a zero time', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    var time = mom.time();
-    expect(+time).toBe(0);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    var time = mom.time()
+    expect(+time).toBe(0)
+  })
 
 
   it('formats without a zone part', function() {
   it('formats without a zone part', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    expect(mom.format()).toBe('2014-06-08');
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    expect(mom.format()).toBe('2014-06-08')
+  })
 
 
   it('formats via toISOString without a time part', function() {
   it('formats via toISOString without a time part', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    expect(mom.toISOString()).toBe('2014-06-08');
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    expect(mom.toISOString()).toBe('2014-06-08')
+  })
 
 
   it('is correctly cloned', function() {
   it('is correctly cloned', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    var clone = mom.clone();
-    expect(clone.hasTime()).toBe(false);
-    expect(clone.format()).toBe('2014-06-08');
-    expect(clone).not.toBe(mom);
-    clone.add(1, 'months');
-    expect(+clone).not.toBe(+mom);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    var clone = mom.clone()
+    expect(clone.hasTime()).toBe(false)
+    expect(clone.format()).toBe('2014-06-08')
+    expect(clone).not.toBe(mom)
+    clone.add(1, 'months')
+    expect(+clone).not.toBe(+mom)
+  })
 
 
   it('can be given a time', function() {
   it('can be given a time', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    expect(mom.hasTime()).toBe(false);
-    var time = moment.duration({ hours: 1, minutes: 25 });
-    mom.time(time);
-    expect(mom.hasTime()).toBe(true);
-    expect(+mom.time()).toBe(+time);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    expect(mom.hasTime()).toBe(false)
+    var time = moment.duration({ hours: 1, minutes: 25 })
+    mom.time(time)
+    expect(mom.hasTime()).toBe(true)
+    expect(+mom.time()).toBe(+time)
+  })
 
 
   it('can be given a time and zone via utc', function() {
   it('can be given a time and zone via utc', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    expect(mom.hasTime()).toBe(false);
-    expect(mom.hasZone()).toBe(false);
-    expect(mom.utcOffset()).toBe(0);
-    mom.utc();
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(true);
-    expect(mom.utcOffset()).toBe(0);
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    expect(mom.hasTime()).toBe(false)
+    expect(mom.hasZone()).toBe(false)
+    expect(mom.utcOffset()).toBe(0)
+    mom.utc()
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(true)
+    expect(mom.utcOffset()).toBe(0)
+  })
 
 
   it('can be given a time and zone via local', function() {
   it('can be given a time and zone via local', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    var equivDate = new Date(2014, 5, 8, 10, 0, 0);
-    expect(mom.toArray()).toEqual([ 2014, 5, 8, 0, 0, 0, 0 ]);
-    expect(mom.hasTime()).toBe(false);
-    expect(mom.hasZone()).toBe(false);
-    expect(mom.utcOffset()).toBe(0);
-    mom.local();
-    expect(mom.toArray()).toEqual([ 2014, 5, 8, 0, 0, 0, 0 ]);
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(true);
-    expect(mom.utcOffset()).toBe(-equivDate.getTimezoneOffset());
-  });
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    var equivDate = new Date(2014, 5, 8, 10, 0, 0)
+    expect(mom.toArray()).toEqual([ 2014, 5, 8, 0, 0, 0, 0 ])
+    expect(mom.hasTime()).toBe(false)
+    expect(mom.hasZone()).toBe(false)
+    expect(mom.utcOffset()).toBe(0)
+    mom.local()
+    expect(mom.toArray()).toEqual([ 2014, 5, 8, 0, 0, 0, 0 ])
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(true)
+    expect(mom.utcOffset()).toBe(-equivDate.getTimezoneOffset())
+  })
 
 
   it('can be given a time and zone via zone', function() {
   it('can be given a time and zone via zone', function() {
-    var mom = $.fullCalendar.moment.parseZone('2014-06-08');
-    expect(mom.hasTime()).toBe(false);
-    expect(mom.hasZone()).toBe(false);
-    expect(mom.utcOffset()).toBe(0);
-    mom.utcOffset(-420);
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(true);
-    expect(mom.utcOffset()).toBe(-420);
-  });
-
-});
+    var mom = $.fullCalendar.moment.parseZone('2014-06-08')
+    expect(mom.hasTime()).toBe(false)
+    expect(mom.hasZone()).toBe(false)
+    expect(mom.utcOffset()).toBe(0)
+    mom.utcOffset(-420)
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(true)
+    expect(mom.utcOffset()).toBe(-420)
+  })
+
+})
 
 
 describe('unambiguous moment', function() {
 describe('unambiguous moment', function() {
 
 
   it('can be made ambiguously-zoned via stripZone', function() {
   it('can be made ambiguously-zoned via stripZone', function() {
-    var mom = $.fullCalendar.moment.utc('2014-06-08T10:00:00-0000');
-    expect(mom.hasZone()).toBe(true);
-    expect(mom.hasTime()).toBe(true);
-    mom.stripZone();
-    expect(mom.format()).toBe('2014-06-08T10:00:00');
-    expect(mom.hasZone()).toBe(false);
-    expect(mom.hasTime()).toBe(true);
-  });
+    var mom = $.fullCalendar.moment.utc('2014-06-08T10:00:00-0000')
+    expect(mom.hasZone()).toBe(true)
+    expect(mom.hasTime()).toBe(true)
+    mom.stripZone()
+    expect(mom.format()).toBe('2014-06-08T10:00:00')
+    expect(mom.hasZone()).toBe(false)
+    expect(mom.hasTime()).toBe(true)
+  })
 
 
   it('can be made ambigously-timed via stripTime', function() {
   it('can be made ambigously-timed via stripTime', function() {
-    var mom = $.fullCalendar.moment.utc('2014-06-08T10:00:00-0000');
-    expect(mom.hasTime()).toBe(true);
-    expect(mom.hasZone()).toBe(true);
-    mom.stripTime();
-    expect(mom.format()).toBe('2014-06-08');
-    expect(mom.hasTime()).toBe(false);
-    expect(mom.hasZone()).toBe(false);
-  });
-
-});
+    var mom = $.fullCalendar.moment.utc('2014-06-08T10:00:00-0000')
+    expect(mom.hasTime()).toBe(true)
+    expect(mom.hasZone()).toBe(true)
+    mom.stripTime()
+    expect(mom.format()).toBe('2014-06-08')
+    expect(mom.hasTime()).toBe(false)
+    expect(mom.hasZone()).toBe(false)
+  })
+
+})

Некоторые файлы не были показаны из-за большого количества измененных файлов