Adam Shaw 7 лет назад
Родитель
Сommit
03d42fffd3

+ 31 - 36
tests/automated/legacy/event-obj.js

@@ -22,23 +22,39 @@ describe('event object creation', function() {
     var event = init({
       date: '2014-05-05'
     })
-    expect(moment.isMoment(event.start)).toEqual(true)
-    expect(event.start).toEqualMoment('2014-05-05')
+    expect(event.start instanceof Date).toEqual(true)
+    expect(event.start).toEqualDate('2014-05-05')
   })
 
-  it('doesn\'t produce an event when an invalid start', function() {
+  it('doesn\'t produce an event when an invalid start Date object', function() {
     var event = init({
-      start: new Date('asdf') // we use Date constructor to avoid annoying momentjs warning
+      start: new Date('asdf')
     })
     expect(event).toBeUndefined()
   })
 
-  it('produces null end when given an invalid date', function() {
+  it('doesn\'t produce an event when an invalid start string', function() {
+    var event = init({
+      start: 'asdfasdfasdf',
+    })
+    expect(event).toBeUndefined()
+  })
+
+  it('produces null end when given an invalid Date object', function() {
+    var event = init({
+      start: '2014-05-01',
+      end: new Date('asdf')
+    })
+    expect(event.start).toEqualDate('2014-05-01')
+    expect(event.end).toBe(null)
+  })
+
+  it('produces null end when given an invalid string', function() {
     var event = init({
       start: '2014-05-01',
-      end: new Date('asdf') // we use Date constructor to avoid annoying momentjs warning
+      end: 'asdfasdfasdf'
     })
-    expect(event.start).toEqualMoment('2014-05-01')
+    expect(event.start).toEqualDate('2014-05-01')
     expect(event.end).toBe(null)
   })
 
@@ -47,7 +63,7 @@ describe('event object creation', function() {
       start: '2014-05-02T00:00:00',
       end: '2014-05-01T23:00:00'
     })
-    expect(event.start).toEqualMoment('2014-05-02T00:00:00')
+    expect(event.start).toEqualDate('2014-05-02T00:00:00Z')
     expect(event.end).toBe(null)
   })
 
@@ -56,7 +72,7 @@ describe('event object creation', function() {
       start: '2014-05-02T00:00:00',
       end: '2014-05-01T00:00:00'
     })
-    expect(event.start).toEqualMoment('2014-05-02T00:00:00')
+    expect(event.start).toEqualDate('2014-05-02T00:00:00Z')
     expect(event.end).toBe(null)
   })
 
@@ -65,7 +81,7 @@ describe('event object creation', function() {
       start: '2014-05-02',
       end: '2014-05-02'
     })
-    expect(event.start).toEqualMoment('2014-05-02')
+    expect(event.start).toEqualDate('2014-05-02')
     expect(event.end).toBe(null)
   })
 
@@ -74,28 +90,7 @@ describe('event object creation', function() {
       start: '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)
-  })
-
-  it('allows ASP dates for start', function() {
-    var event = init({
-      start: '/Date(1239018869048)/',
-      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)
-  })
-
-  it('produces null end when given an invalid ASP date end', function() {
-    var event = init({
-      start: '/Date(1239018869048)/',
-      end: '/Date(1239018869048)/' // same as start
-    })
-    expect(moment.isMoment(event.start)).toBe(true)
-    expect(+event.start).toBe(1239018869048)
+    expect(event.start).toEqualDate('2014-05-02T00:00:00Z')
     expect(event.end).toBe(null)
   })
 
@@ -106,9 +101,9 @@ describe('event object creation', function() {
       allDay: true
     })
     expect(event.start.hasTime()).toEqual(false)
-    expect(event.start).toEqualMoment('2014-05-01')
+    expect(event.start).toEqualDate('2014-05-01')
     expect(event.end.hasTime()).toEqual(false)
-    expect(event.end).toEqualMoment('2014-05-02')
+    expect(event.end).toEqualDate('2014-05-02')
   })
 
   it('gives 00:00 times to ambiguously-timed dates when event is timed', function() {
@@ -118,9 +113,9 @@ describe('event object creation', function() {
       allDay: false
     })
     expect(event.start.hasTime()).toEqual(true)
-    expect(event.start).toEqualMoment('2014-05-01T00:00:00')
+    expect(event.start).toEqualDate('2014-05-01T00:00:00Z')
     expect(event.end.hasTime()).toEqual(true)
-    expect(event.end).toEqualMoment('2014-05-03T00:00:00')
+    expect(event.end).toEqualDate('2014-05-03T00:00:00Z')
   })
 
   it('sets the source', function() {

+ 82 - 117
tests/automated/legacy/event-resize.js

@@ -26,20 +26,16 @@ describe('eventResize', function() {
               dy: $('.fc-day').height()
             })
           },
-          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)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 5 }))
 
-            expect(event.start).toEqualMoment('2014-06-11')
-            expect(event.end).toEqualMoment('2014-06-17')
+            expect(arg.event.start).toEqualDate('2014-06-11')
+            expect(arg.event.end).toEqualDate('2014-06-17')
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var event = currentCalendar.clientEvents()[0]
 
-            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
 
             done()
@@ -79,20 +75,16 @@ describe('eventResize', function() {
                   }
                 })
               },
-              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)
+              function(arg) {
+                expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 5 }))
 
-                expect(event.start).toEqualMoment('2014-06-11')
-                expect(event.end).toEqualMoment('2014-06-17')
+                expect(arg.event.start).toEqualDate('2014-06-11')
+                expect(arg.event.end).toEqualDate('2014-06-17')
 
-                revertFunc()
-                event = currentCalendar.clientEvents()[0]
+                arg.revertFunc()
+                var event = currentCalendar.clientEvents()[0]
 
-                expect(event.start).toEqualMoment('2014-06-11')
+                expect(event.start).toEqualDate('2014-06-11')
                 expect(event.end).toBeNull()
 
                 done()
@@ -140,20 +132,16 @@ describe('eventResize', function() {
               dx: $('th.fc-wed').width() * 1.5 // two days
             })
           },
-          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)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 2 }))
 
-            expect(event.start).toEqualMoment('2014-06-11')
-            expect(event.end).toEqualMoment('2014-06-14')
+            expect(arg.event.start).toEqualDate('2014-06-11')
+            expect(arg.event.end).toEqualDate('2014-06-14')
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var event = currentCalendar.clientEvents()[0]
 
-            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
 
             done()
@@ -182,21 +170,17 @@ describe('eventResize', function() {
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
             })
           },
-          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)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ hour: 2, minute: 30 }))
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
-            expect(event.end).toEqualMoment('2014-06-11T09:30:00')
+            expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z')
+            expect(arg.event.end).toEqualDate('2014-06-11T09:30:00Z')
 
-            revertFunc()
+            arg.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).toEqualDate('2014-06-11T05:00:00Z')
+            expect(event.end).toEqualDate('2014-06-11T07:00:00Z')
 
             done()
           }
@@ -222,21 +206,17 @@ describe('eventResize', function() {
               })
             }, 0)
           },
-          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)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ hour: 2, minute: 30 }))
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
-            expect(event.end).toEqualMoment('2014-06-11T09:30:00')
+            expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z')
+            expect(arg.event.end).toEqualDate('2014-06-11T09:30:00Z')
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var 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).toEqualDate('2014-06-11T05:00:00Z')
+            expect(event.end).toEqualDate('2014-06-11T07:00:00Z')
 
             done()
           }
@@ -255,21 +235,17 @@ describe('eventResize', function() {
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
             })
           },
-          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)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 1, hour: 2, minute: 30 }))
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00')
-            expect(event.end).toEqualMoment('2014-06-12T09:30:00')
+            expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z')
+            expect(arg.event.end).toEqualDate('2014-06-12T09:30:00Z')
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var 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).toEqualDate('2014-06-11T05:00:00Z')
+            expect(event.end).toEqualDate('2014-06-11T07:00:00Z')
 
             done()
           }
@@ -287,21 +263,17 @@ describe('eventResize', function() {
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
             })
           },
-          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)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ hour: 2, minute: 30 }))
 
-            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(arg.event.start).toEqualDate('2014-06-11T05:00:00') // local
+            expect(arg.event.end).toEqualDate('2014-06-11T09:30:00') // local
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var 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).toEqualDate('2014-06-11T05:00:00') // local
+            expect(event.end).toEqualDate('2014-06-11T07:00:00') // local
 
             done()
           }
@@ -319,21 +291,17 @@ describe('eventResize', function() {
               dy: $('.fc-slats tr:eq(1)').height() * 4.5 // 5 slots, so 2.5 hours
             })
           },
-          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)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ hour: 2, minute: 30 }))
 
-            expect(event.start).toEqualMoment('2014-06-11T05:00:00+00:00')
-            expect(event.end).toEqualMoment('2014-06-11T09:30:00+00:00')
+            expect(arg.event.start).toEqualDate('2014-06-11T05:00:00+00:00')
+            expect(arg.event.end).toEqualDate('2014-06-11T09:30:00+00:00')
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var 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).toEqualDate('2014-06-11T05:00:00+00:00')
+            expect(event.end).toEqualDate('2014-06-11T07:00:00+00:00')
 
             done()
           }
@@ -371,8 +339,8 @@ describe('eventResize', function() {
 
       it('should run the temporarily rendered event through eventRender', function(done) {
         var options = {}
-        options.eventRender = function(event, element) {
-          $(element).addClass('didEventRender')
+        options.eventRender = function(arg) {
+          $(arg.el).addClass('didEventRender')
         }
 
         options.eventAfterAllRender = function() {
@@ -490,35 +458,32 @@ describe('eventResize', function() {
         eventsRendered = true
       }
     }
-    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')
+    options.eventResizeStart = function(arg) {
+      expect(arg.el instanceof Element).toBe(true)
+      expect(arg.el).toHaveClass('fc-event')
+      expect(typeof arg.event).toBe('object')
+      expect(typeof arg.jsEvent).toBe('object')
+      expect(typeof arg.view).toBe('object')
     }
-    options.eventResizeStop = function(event, jsEvent, uiEvent, view) {
+    options.eventResizeStop = function(arg) {
       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(arg.el instanceof Element).toBe(true)
+      expect(arg.el).toHaveClass('fc-event')
+      expect(typeof arg.event).toBe('object')
+      expect(typeof arg.jsEvent).toBe('object')
+      expect(typeof arg.view).toBe('object')
     }
-    options.eventResize = function(event, delta, revertFunc, jsEvent, uiEvent, view) {
+    options.eventResize = function(arg) {
       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(arg.el instanceof Element).toBe(true)
+      expect(arg.el).toHaveClass('fc-event')
+      expect(typeof arg.event).toBe('object')
+      expect(typeof arg.delta).toBe('object')
+      expect(typeof arg.revertFunc).toBe('function')
+      expect(typeof arg.jsEvent).toBe('object')
+      expect(typeof arg.view).toBe('object')
 
       resizeDoneFunc.apply(this, arguments)
     }

+ 4 - 4
tests/automated/legacy/eventAllow.js

@@ -19,8 +19,8 @@ describe('eventAllow', function() {
     var 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(dropInfo.start instanceof Date).toBe(true)
+        expect(dropInfo.end instanceof Date).toBe(true)
         expect(typeof event).toBe('object')
         expect(event.title).toBe('event 1')
         return false
@@ -48,9 +48,9 @@ describe('eventAllow', function() {
 
     initCalendar(options)
 
-    dragTimeGridEvent($('.fc-event'), '2016-09-04T03:00:00')
+    dragTimeGridEvent($('.fc-event'), '2016-09-04T03:00:00Z')
       .then(function(modifiedEvent) {
-        expect(modifiedEvent.start.format()).toBe('2016-09-04T03:00:00')
+        expect(modifiedEvent.start).toEqualDate('2016-09-04T03:00:00Z')
         expect(options.eventAllow).toHaveBeenCalled()
         done()
       })

+ 9 - 9
tests/automated/legacy/eventLimit-popover.js

@@ -276,9 +276,9 @@ describe('eventLimit popover', function() {
       it('should have the new day and remain all-day', function(done) {
 
         initCalendar({
-          eventDrop: function(event) {
-            expect(event.start).toEqualMoment('2014-07-28')
-            expect(event.allDay).toBe(true)
+          eventDrop: function(arg) {
+            expect(arg.event.start).toEqualDate('2014-07-28')
+            expect(arg.event.allDay).toBe(true)
             done()
           }
         })
@@ -305,9 +305,9 @@ describe('eventLimit popover', function() {
 
         initCalendar({
           events: testEvents,
-          eventDrop: function(event) {
-            expect(event.start).toEqualMoment('2014-07-28T13:00:00')
-            expect(event.allDay).toBe(false)
+          eventDrop: function(arg) {
+            expect(arg.event.start).toEqualDate('2014-07-28T13:00:00Z')
+            expect(arg.event.allDay).toBe(false)
             done()
           }
         })
@@ -329,9 +329,9 @@ describe('eventLimit popover', function() {
         initCalendar({
           defaultView: 'agendaWeek',
           scrollTime: '00:00:00',
-          eventDrop: function(event) {
-            expect(event.start).toEqualMoment('2014-07-30T03:00:00')
-            expect(event.allDay).toBe(false)
+          eventDrop: function(arg) {
+            expect(arg.event.start).toEqualDate('2014-07-30T03:00:00Z')
+            expect(arg.event.allDay).toBe(false)
             done()
           }
         })

+ 8 - 8
tests/automated/legacy/eventLimitClick.js

@@ -111,14 +111,14 @@ describe('eventLimitClick', function() { // simulate a click
 
   it('works with custom function and all the arguments are correct', function() {
     initCalendar({
-      eventLimitClick: function(cellInfo, jsEvent) {
-        expect(typeof cellInfo).toBe('object')
-        expect(typeof jsEvent).toBe('object')
-        expect(cellInfo.date).toEqualMoment('2014-07-29')
-        expect(cellInfo.dayEl.getAttribute('data-date')).toBe('2014-07-29')
-        expect(cellInfo.hiddenSegs.length).toBe(2)
-        expect(cellInfo.segs.length).toBe(4)
-        expect(cellInfo.moreEl).toHaveClass('fc-more')
+      eventLimitClick: function(arg) {
+        expect(typeof arg).toBe('object')
+        expect(arg.date).toEqualDate('2014-07-29')
+        expect(arg.dayEl.getAttribute('data-date')).toBe('2014-07-29')
+        expect(arg.hiddenSegs.length).toBe(2)
+        expect(arg.segs.length).toBe(4)
+        expect(arg.moreEl).toHaveClass('fc-more')
+        expect(typeof arg.jsEvent).toBe('object')
       }
     })
     $('.fc-more').simulate('click')

+ 8 - 8
tests/automated/legacy/eventMouseover.js

@@ -14,9 +14,9 @@ describe('eventMouseover', function() {
 
       it('will trigger a eventMouseout with updateEvent', function(done) {
 
-        spyOnCalendarCallback('eventMouseout', function(event, ev) {
-          expect(typeof event).toBe('object')
-          expect(typeof ev).toBe('object')
+        spyOnCalendarCallback('eventMouseout', function(arg) {
+          expect(typeof arg.event).toBe('object')
+          expect(typeof arg.jsEvent).toBe('object')
           done()
         })
 
@@ -26,11 +26,11 @@ describe('eventMouseover', function() {
             start: '2014-08-02T01:00:00',
             className: 'event'
           } ],
-          eventMouseover: function(event, ev) {
-            expect(typeof event).toBe('object')
-            expect(typeof ev).toBe('object')
-            event.title = 'YO'
-            currentCalendar.updateEvent(event)
+          eventMouseover: function(arg) {
+            expect(typeof arg.event).toBe('object')
+            expect(typeof arg.jsEvent).toBe('object')
+            arg.event.title = 'YO'
+            currentCalendar.updateEvent(arg.event)
           }
         })
 

+ 33 - 33
tests/automated/legacy/eventRender.js

@@ -22,13 +22,13 @@ describe('eventRender', function() {
       describe('with foreground event', function() {
         it('receives correct args AND can modify the element', function(done) {
           var options = {
-            eventRender: function(event, element, view) {
-              expect(typeof event).toBe('object')
-              expect(event.rendering).toBeUndefined()
-              expect(event.start).toBeDefined()
-              expect(element instanceof HTMLElement).toBe(true)
-              expect(typeof view).toBe('object')
-              $(element).css('font-size', '20px')
+            eventRender: function(arg) {
+              expect(typeof arg.event).toBe('object')
+              expect(arg.event.rendering).toBeUndefined()
+              expect(arg.event.start).toBeDefined()
+              expect(arg.el instanceof HTMLElement).toBe(true)
+              expect(typeof arg.view).toBe('object')
+              $(arg.el).css('font-size', '20px')
             },
             eventAfterAllRender: function() {
               expect($(gridSelector).find('.fc-event').css('font-size')).toBe('20px')
@@ -56,7 +56,7 @@ describe('eventRender', function() {
     describe('with a foreground event', function() {
       it('can return a new element', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function(arg) {
             return $('<div class="fc-event sup" style="background-color:green">sup g</div>')[0]
           },
           eventAfterAllRender: function() {
@@ -70,7 +70,7 @@ describe('eventRender', function() {
       })
       it('can return false and cancel rendering', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function(arg) {
             return false
           },
           eventAfterAllRender: function() {
@@ -96,13 +96,13 @@ describe('eventRender', function() {
 
       it('receives correct args AND can modify the element', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
-            expect(typeof event).toBe('object')
-            expect(event.rendering).toBe('background')
-            expect(event.start).toBeDefined()
-            expect(element instanceof HTMLElement).toBe(true)
-            expect(typeof view).toBe('object')
-            $(element).css('font-size', '20px')
+          eventRender: function(arg) {
+            expect(typeof arg.event).toBe('object')
+            expect(arg.event.rendering).toBe('background')
+            expect(arg.event.start).toBeDefined()
+            expect(arg.el instanceof HTMLElement).toBe(true)
+            expect(typeof arg.view).toBe('object')
+            $(arg.el).css('font-size', '20px')
           },
           eventAfterAllRender: function() {
             expect($('.fc-day-grid .fc-bgevent').css('font-size')).toBe('20px')
@@ -116,7 +116,7 @@ describe('eventRender', function() {
 
       it('can return a new element', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function(arg) {
             return $('<td class="sup" style="background-color:green">sup g</td>')[0]
           },
           eventAfterAllRender: function() {
@@ -131,7 +131,7 @@ describe('eventRender', function() {
 
       it('won\'t rendering when returning a new element of the wrong type', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function(arg) {
             return $('<div class="sup" style="background-color:green">sup g</div>')[0]
           },
           eventAfterAllRender: function() {
@@ -146,7 +146,7 @@ describe('eventRender', function() {
 
       it('can return false and cancel rendering', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function(arg) {
             return false
           },
           eventAfterAllRender: function() {
@@ -172,7 +172,7 @@ describe('eventRender', function() {
 
       it('won\'t render or call eventRender', function(done) {
         var options = {
-          eventRender: function(event, element, view) {},
+          eventRender: function(arg) {},
           eventAfterAllRender: function() {
             expect($('.fc-day-grid .fc-bgevent').length).toBe(0)
             expect(options.eventRender).not.toHaveBeenCalled()
@@ -202,7 +202,7 @@ describe('eventRender', function() {
 
       it('can return a new element', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function(arg) {
             return $('<div class="fc-event sup" style="background-color:green">sup g</div>')[0]
           },
           eventAfterAllRender: function() {
@@ -217,7 +217,7 @@ describe('eventRender', function() {
 
       it('can return false and cancel rendering', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function(arg) {
             return false
           },
           eventAfterAllRender: function() {
@@ -243,13 +243,13 @@ describe('eventRender', function() {
 
       it('receives correct args AND can modify the element', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
-            expect(typeof event).toBe('object')
-            expect(event.rendering).toBe('background')
-            expect(event.start).toBeDefined()
-            expect(element instanceof HTMLElement).toBe(true)
-            expect(typeof view).toBe('object')
-            $(element).css('font-size', '20px')
+          eventRender: function(arg) {
+            expect(typeof arg.event).toBe('object')
+            expect(arg.event.rendering).toBe('background')
+            expect(arg.event.start).toBeDefined()
+            expect(arg.el instanceof HTMLElement).toBe(true)
+            expect(typeof arg.view).toBe('object')
+            $(arg.el).css('font-size', '20px')
           },
           eventAfterAllRender: function() {
             expect($('.fc-time-grid .fc-bgevent').css('font-size')).toBe('20px')
@@ -263,7 +263,7 @@ describe('eventRender', function() {
 
       it('can return a new element', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function() {
             return $('<div class="fc-bgevent sup" style="background-color:green">sup g</div>')[0]
           },
           eventAfterAllRender: function() {
@@ -278,7 +278,7 @@ describe('eventRender', function() {
 
       it('won\'t rendering when returning a new element of the wrong type', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function() {
             return $('<p class="fc-bgevent sup" style="background-color:green">sup g</p>')[0]
           },
           eventAfterAllRender: function() {
@@ -292,7 +292,7 @@ describe('eventRender', function() {
       })
       it('can return false and cancel rendering', function(done) {
         var options = {
-          eventRender: function(event, element, view) {
+          eventRender: function() {
             return false
           },
           eventAfterAllRender: function() {
@@ -318,7 +318,7 @@ describe('eventRender', function() {
 
       it('will render in the all-day slot', function(done) {
         var options = {
-          eventRender: function(event, element, view) {},
+          eventRender: function() {},
           eventAfterAllRender: function() {
             expect($('.fc-day-grid .fc-bgevent').length).toBe(1)
             expect($('.fc-time-grid .fc-bgevent').length).toBe(0)

+ 6 - 6
tests/automated/legacy/events-array.js

@@ -17,8 +17,8 @@ describe('events as an array', function() {
   it('accepts an event using basic form', function(done) {
     initCalendar({
       events: getEventArray(),
-      eventRender: function(eventObj, eventElm) {
-        expect(eventObj.title).toEqual('my event')
+      eventRender: function(arg) {
+        expect(arg.event.title).toEqual('my event')
         done()
       }
     })
@@ -32,9 +32,9 @@ describe('events as an array', function() {
           events: getEventArray()
         }
       ],
-      eventRender: function(eventObj, eventElm) {
-        expect(eventObj.title).toEqual('my event')
-        expect(eventElm).toHaveClass('customeventclass')
+      eventRender: function(arg) {
+        expect(arg.event.title).toEqual('my event')
+        expect(arg.el).toHaveClass('customeventclass')
         done()
       }
     })
@@ -46,7 +46,7 @@ describe('events as an array', function() {
     var origEvent = eventArray[0]
     initCalendar({
       events: eventArray,
-      eventRender: function(eventObj, eventElm) {
+      eventRender: function(arg) {
         expect(origArray).toEqual(eventArray)
         expect(origEvent).toEqual(eventArray[0])
         done()

+ 34 - 38
tests/automated/legacy/events-function.js

@@ -5,35 +5,20 @@ describe('events as a function', function() {
     defaultDate: '2014-05-01'
   })
 
-  function testEventFunctionParams(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')
+  function testEventFunctionParams(arg, callback) {
+    expect(arg.start instanceof Date).toEqual(true)
+    expect(arg.end instanceof Date).toEqual(true)
     expect(typeof callback).toEqual('function')
   }
 
-  it('requests correctly when no timezone', function(done) {
-    initCalendar({
-      events: function(start, end, timezone, callback) {
-        testEventFunctionParams(start, end, timezone, callback)
-        expect(timezone).toEqual(false)
-        callback([])
-        done()
-      }
-    })
-  })
-
   it('requests correctly when local timezone', function(done) {
     initCalendar({
       timezone: 'local',
-      events: function(start, end, timezone, callback) {
-        testEventFunctionParams(start, end, timezone, callback)
-        expect(timezone).toEqual('local')
+      events: function(arg, callback) {
+        testEventFunctionParams(arg, callback)
+        expect(arg.timeZone).toEqual('local')
+        expect(arg.start).toEqualDate('2014-04-27T00:00:00') // local
+        expect(arg.end).toEqualDate('2014-06-08T00:00:00') // local
         callback([])
         done()
       }
@@ -43,9 +28,11 @@ describe('events as a function', function() {
   it('requests correctly when UTC timezone', function(done) {
     initCalendar({
       timezone: 'UTC',
-      events: function(start, end, timezone, callback) {
-        testEventFunctionParams(start, end, timezone, callback)
-        expect(timezone).toEqual('UTC')
+      events: function(arg, callback) {
+        testEventFunctionParams(arg, callback)
+        expect(arg.timeZone).toEqual('UTC')
+        expect(arg.start).toEqualDate('2014-04-27')
+        expect(arg.end).toEqualDate('2014-06-08')
         callback([])
         done()
       }
@@ -55,9 +42,11 @@ describe('events as a function', function() {
   it('requests correctly when custom timezone', function(done) {
     initCalendar({
       timezone: 'America/Chicago',
-      events: function(start, end, timezone, callback) {
-        testEventFunctionParams(start, end, timezone, callback)
-        expect(timezone).toEqual('America/Chicago')
+      events: function(arg, callback) {
+        testEventFunctionParams(arg, callback)
+        expect(arg.timeZone).toEqual('America/Chicago')
+        expect(arg.start).toEqualDate('2014-04-27')
+        expect(arg.end).toEqualDate('2014-06-08')
         callback([])
         done()
       }
@@ -68,16 +57,20 @@ describe('events as a function', function() {
     var callCnt = 0
     var options = {
       timezone: 'America/Chicago',
-      events: function(start, end, timezone, callback) {
-        testEventFunctionParams(start, end, timezone, callback)
+      events: function(arg, callback) {
+        testEventFunctionParams(arg, callback)
         callCnt++
         if (callCnt === 1) {
-          expect(timezone).toEqual('America/Chicago')
+          expect(arg.timeZone).toEqual('America/Chicago')
+          expect(arg.start).toEqualDate('2014-04-27')
+          expect(arg.end).toEqualDate('2014-06-08')
           setTimeout(function() {
             currentCalendar.option('timezone', 'UTC')
           }, 0)
         } else if (callCnt === 2) {
-          expect(timezone).toEqual('UTC')
+          expect(arg.timeZone).toEqual('UTC')
+          expect(arg.start).toEqualDate('2014-04-27')
+          expect(arg.end).toEqualDate('2014-06-08')
           done()
         }
       }
@@ -89,9 +82,11 @@ describe('events as a function', function() {
   it('requests correctly with event source extended form', function(done) {
     var eventSource = {
       className: 'customeventclass',
-      events: function(start, end, timezone, callback) {
-        testEventFunctionParams(start, end, timezone, callback)
-        expect(timezone).toEqual(false)
+      events: function(arg, callback) {
+        testEventFunctionParams(arg, callback)
+        expect(arg.timeZone).toEqual('UTC')
+        expect(arg.start).toEqualDate('2014-04-27')
+        expect(arg.end).toEqualDate('2014-06-08')
         callback([
           {
             title: 'event1',
@@ -103,10 +98,11 @@ describe('events as a function', function() {
     spyOn(eventSource, 'events').and.callThrough()
 
     initCalendar({
+      timezone: 'UTC',
       eventSources: [ eventSource ],
-      eventRender: function(eventObj, eventElm) {
+      eventRender: function(arg) {
         expect(eventSource.events.calls.count()).toEqual(1)
-        expect(eventElm).toHaveClass('customeventclass')
+        expect(arg.el).toHaveClass('customeventclass')
         done()
       }
     })

+ 44 - 41
tests/automated/legacy/external-dnd-advanced.js

@@ -29,7 +29,9 @@ describe('advanced external dnd', function() {
     pushOptions({defaultView: 'agendaWeek'})
     describe('when no element event data', function() {
       describe('when given duration through defaultTimedEventDuration', function() {
-        pushOptions({defaultTimedEventDuration: '2:30'})
+        pushOptions({
+          defaultTimedEventDuration: '2:30'
+        })
         defineTests()
       })
       describe('when given duration through data-duration', function() {
@@ -42,7 +44,7 @@ describe('advanced external dnd', function() {
       function defineTests() {
         it('fires correctly', function(done) {
           var options = {}
-          testExternalElDrag(options, '2014-11-13T03:00:00', true, done)
+          testExternalElDrag(options, '2014-11-13T03:00:00Z', '2014-11-13T03:00:00Z', true, done)
         })
         it('is not affected by eventOverlap:false', function(done) {
           var options = {}
@@ -51,7 +53,7 @@ describe('advanced external dnd', function() {
             start: '2014-11-13T01:00:00',
             end: '2014-11-13T05:00:00'
           } ]
-          testExternalElDrag(options, '2014-11-13T03:00:00', true, done)
+          testExternalElDrag(options, '2014-11-13T03:00:00Z', '2014-11-13T03:00:00Z', true, done)
         })
         it('is not affected by an event object\'s overlap:false', function(done) {
           var options = {}
@@ -60,7 +62,7 @@ describe('advanced external dnd', function() {
             end: '2014-11-13T05:00:00',
             overlap: false
           } ]
-          testExternalElDrag(options, '2014-11-13T03:00:00', true, done)
+          testExternalElDrag(options, '2014-11-13T03:00:00Z', '2014-11-13T03:00:00Z', true, done)
         })
         it('is not affected by eventConstraint', function(done) {
           var options = {}
@@ -69,7 +71,7 @@ describe('advanced external dnd', function() {
             start: '03:00',
             end: '10:00'
           }
-          testExternalElDrag(options, '2014-11-13T02:00:00', true, done)
+          testExternalElDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, done)
         })
         describe('with selectOverlap:false', function() {
           pushOptions({
@@ -81,7 +83,7 @@ describe('advanced external dnd', function() {
           })
           it('is not allowed to overlap an event', function(done) {
             var options = {}
-            testExternalElDrag(options, '2014-11-13T02:00:00', false, done)
+            testExternalElDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', false, done)
           })
         })
         describe('with a selectConstraint', function() {
@@ -94,12 +96,12 @@ describe('advanced external dnd', function() {
           it('can be dropped within', function(done) {
             var options = {}
 
-            testExternalElDrag(options, '2014-11-13T05:30:00', true, done)
+            testExternalElDrag(options, '2014-11-13T05:30:00Z', '2014-11-13T05:30:00Z', true, done)
           })
           it('cannot be dropped when not fully contained', function(done) {
             var options = {}
 
-            testExternalElDrag(options, '2014-11-13T06:00:00', false, done)
+            testExternalElDrag(options, '2014-11-13T06:00:00Z', '2014-11-13T06:00:00Z', false, done)
           })
         })
       }
@@ -111,7 +113,7 @@ describe('advanced external dnd', function() {
         var options = {}
 
         dragEl.data('event', { title: 'hey' })
-        testExternalEventDrag(options, '2014-11-13T02:00:00', true, done)
+        testExternalEventDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, done)
       })
 
       describe('when given a start time', function() {
@@ -146,7 +148,7 @@ describe('advanced external dnd', function() {
           it('voids the given time when dropped on a timed slot', function(done) {
             var options = {}
 
-            testExternalEventDrag(options, '2014-11-13T02:00:00', true, done)
+            testExternalEventDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, done)
             // will test the resulting event object's start
           })
         }
@@ -170,10 +172,10 @@ describe('advanced external dnd', function() {
           it('accepts the given duration when dropped on a timed slot', function(done) {
             var options = {}
 
-            testExternalEventDrag(options, '2014-11-13T02:00:00', true, function() {
+            testExternalEventDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', 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')
+              expect(event.start).toEqualDate('2014-11-13T02:00:00Z')
+              expect(event.end).toEqualDate('2014-11-13T07:00:00Z')
               done()
             })
           })
@@ -198,7 +200,7 @@ describe('advanced external dnd', function() {
           it('keeps the event when navigating away and back', function(done) {
             var options = {}
 
-            testExternalEventDrag(options, '2014-11-13T02:00:00', true, function() {
+            testExternalEventDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, function() {
               setTimeout(function() { // make sure to escape handlers
                 expect($('.fc-event').length).toBe(1)
                 currentCalendar.next()
@@ -256,11 +258,11 @@ describe('advanced external dnd', function() {
         function defineTests() {
           it('allows a drop when not colliding with the other event', function(done) {
             var options = {}
-            testExternalEventDrag(options, '2014-11-13T08:00:00', true, done)
+            testExternalEventDrag(options, '2014-11-13T08:00:00Z', '2014-11-13T08:00:00Z', true, done)
           })
           it('prevents a drop when colliding with the other event', function(done) {
             var options = {}
-            testExternalEventDrag(options, '2014-11-13T06:00:00', false, done)
+            testExternalEventDrag(options, '2014-11-13T06:00:00Z', '2014-11-13T06:00:00Z', false, done)
           })
         }
       })
@@ -293,11 +295,11 @@ describe('advanced external dnd', function() {
         function defineTests() {
           it('allows a drop when inside the constraint', function(done) {
             var options = {}
-            testExternalEventDrag(options, '2014-11-13T05:00:00', true, done)
+            testExternalEventDrag(options, '2014-11-13T05:00:00Z', '2014-11-13T05:00:00Z', true, done)
           })
           it('disallows a drop when partially outside of the constraint', function(done) {
             var options = {}
-            testExternalEventDrag(options, '2014-11-13T07:00:00', false, done)
+            testExternalEventDrag(options, '2014-11-13T07:00:00Z', '2014-11-13T07:00:00Z', false, done)
           })
         }
       })
@@ -317,22 +319,25 @@ describe('advanced external dnd', function() {
         var options = {}
 
         dragEl.data('event', { title: 'hey' })
-        testExternalEventDrag(options, '2014-11-13', true, done)
+        testExternalEventDrag(options, '2014-11-13', '2014-11-13', true, done)
       })
 
       describe('when given a start time', function() {
+
         describe('through the event object\'s start property', function() {
           beforeEach(function() {
             dragEl.data('event', { start: '05:00' })
           })
           defineTests()
         })
+
         describe('through the event object\'s time property', function() {
           beforeEach(function() {
             dragEl.data('event', { time: '05:00' })
           })
           defineTests()
         })
+
         describe('through the `start` data attribute', function() {
           beforeEach(function() {
             dragEl.data('event', true)
@@ -340,6 +345,7 @@ describe('advanced external dnd', function() {
           })
           defineTests()
         })
+
         describe('through the `time` data attribute', function() {
           beforeEach(function() {
             dragEl.data('event', true)
@@ -347,14 +353,15 @@ describe('advanced external dnd', function() {
           })
           defineTests()
         })
+
         function defineTests() {
           it('accepts the given start time for the dropped day', function(done) {
             var options = {}
 
-            testExternalEventDrag(options, '2014-11-13', true, function() {
+            testExternalEventDrag(options, '2014-11-13', '2014-11-13T05:00:00Z', true, function() {
               // 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')
+              expect(event.start).toEqualDate('2014-11-13T05:00:00Z')
               done()
             })
           })
@@ -364,18 +371,18 @@ describe('advanced external dnd', function() {
   })
 
 
-  function testExternalElDrag(options, date, expectSuccess, callback) {
+  function testExternalElDrag(options, dragToDate, expectedDate, expectSuccess, callback) {
     options.droppable = true
-    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.drop = function(arg) {
+      expect(arg.date instanceof Date).toBe(true)
+      expect(arg.date).toEqualDate(expectedDate)
+      expect(typeof arg.jsEvent).toBe('object')
     }
     options.eventReceive = function() { }
     spyOn(options, 'drop').and.callThrough()
     spyOn(options, 'eventReceive').and.callThrough()
-    testEventDrag(options, date, expectSuccess, function() {
+
+    testEventDrag(options, dragToDate, expectSuccess, function() {
       if (expectSuccess) {
         expect(options.drop).toHaveBeenCalled()
       } else {
@@ -387,24 +394,20 @@ describe('advanced external dnd', function() {
   }
 
 
-  function testExternalEventDrag(options, date, expectSuccess, callback) {
+  function testExternalEventDrag(options, dragToDate, expectedDate, expectSuccess, callback) {
     options.droppable = true
-    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.drop = function(arg) {
+      expect(arg.date instanceof Date).toBe(true)
+      expect(arg.date).toEqualDate(expectedDate)
+      expect(typeof arg.jsEvent).toBe('object')
     }
-    options.eventReceive = function(event) {
-      if (FullCalendar.moment.parseZone(date).hasTime()) { // dropped on an all-day slot
-        expect(event.start).toEqualMoment(date)
-      } else { // event might have a time, which it is allowed to keep
-        expect(event.start.clone().stripTime()).toEqualMoment(date)
-      }
+    options.eventReceive = function(arg) {
+      expect(arg.event.start).toEqualDate(expectedDate)
     }
     spyOn(options, 'drop').and.callThrough()
     spyOn(options, 'eventReceive').and.callThrough()
-    testEventDrag(options, date, expectSuccess, function() {
+
+    testEventDrag(options, dragToDate, expectSuccess, function() {
       if (expectSuccess) {
         expect(options.drop).toHaveBeenCalled()
         expect(options.eventReceive).toHaveBeenCalled()

+ 10 - 10
tests/automated/legacy/external-dnd.js

@@ -59,9 +59,9 @@ describe('external drag and drop', function() {
         it('works after the view is changed', function(done) { // issue 2240
           var callCnt = 0
 
-          options.drop = function(date, jsEvent, ui) {
+          options.drop = function(arg) {
             if (callCnt === 0) {
-              expect(date).toEqualMoment('2014-08-06')
+              expect(arg.date).toEqualDate('2014-08-06')
 
               currentCalendar.next()
               currentCalendar.prev()
@@ -74,7 +74,7 @@ describe('external drag and drop', function() {
                 })
               }, 0)
             } else if (callCnt === 1) {
-              expect(date).toEqualMoment('2014-08-06')
+              expect(arg.date).toEqualDate('2014-08-06')
               done()
             }
             callCnt++
@@ -182,9 +182,9 @@ describe('external drag and drop', function() {
         it('works after the view is changed', function(done) {
           var callCnt = 0
 
-          options.drop = function(date, jsEvent, ui) {
+          options.drop = function(arg) {
             if (callCnt === 0) {
-              expect(date).toEqualMoment('2014-08-20T01:00:00')
+              expect(arg.date).toEqualDate('2014-08-20T01:00:00Z')
 
               currentCalendar.next()
               currentCalendar.prev()
@@ -197,7 +197,7 @@ describe('external drag and drop', function() {
                 })
               }, 0)
             } else if (callCnt === 1) {
-              expect(date).toEqualMoment('2014-08-20T01:00:00')
+              expect(arg.date).toEqualDate('2014-08-20T01:00:00Z')
               done()
             }
             callCnt++
@@ -214,8 +214,8 @@ describe('external drag and drop', function() {
 
         it('works with timezone as "local"', function(done) { // for issue 2225
           options.timezone = 'local'
-          options.drop = function(date, jsEvent) {
-            expect(date).toEqualMoment(moment('2014-08-20T01:00:00')) // compate it to a local moment
+          options.drop = function(arg) {
+            expect(arg.date).toEqualDate('2014-08-20T01:00:00') // local
             done()
           }
 
@@ -230,8 +230,8 @@ describe('external drag and drop', function() {
 
         it('works with timezone as "UTC"', function(done) { // for issue 2225
           options.timezone = 'UTC'
-          options.drop = function(date, jsEvent) {
-            expect(date).toEqualMoment('2014-08-20T01:00:00+00:00')
+          options.drop = function(arg) {
+            expect(arg.date).toEqualDate('2014-08-20T01:00:00Z')
             done()
           }
 

+ 5 - 5
tests/automated/legacy/footer-navigation.js

@@ -14,7 +14,7 @@ describe('footer navigation', function() {
       initCalendar()
       $('.fc-footer-toolbar .fc-next-button').simulate('click')
       var newDate = currentCalendar.getDate()
-      expect(newDate).toEqualMoment('2010-03-01')
+      expect(newDate).toEqualDate('2010-03-01')
     })
   })
 
@@ -23,7 +23,7 @@ describe('footer navigation', function() {
       initCalendar()
       $('.fc-footer-toolbar .fc-prev-button').simulate('click')
       var newDate = currentCalendar.getDate()
-      expect(newDate).toEqualMoment('2010-01-01')
+      expect(newDate).toEqualDate('2010-01-01')
     })
   })
 
@@ -32,7 +32,7 @@ describe('footer navigation', function() {
       initCalendar()
       $('.fc-footer-toolbar .fc-prevYear-button').simulate('click')
       var newDate = currentCalendar.getDate()
-      expect(newDate).toEqualMoment('2009-02-01')
+      expect(newDate).toEqualDate('2009-02-01')
     })
   })
 
@@ -41,7 +41,7 @@ describe('footer navigation', function() {
       initCalendar()
       $('.fc-footer-toolbar .fc-nextYear-button').simulate('click')
       var newDate = currentCalendar.getDate()
-      expect(newDate).toEqualMoment('2011-02-01')
+      expect(newDate).toEqualDate('2011-02-01')
     })
   })
 
@@ -52,7 +52,7 @@ describe('footer navigation', function() {
       })
       $('.fc-footer-toolbar .fc-today-button').simulate('click')
       var newDate = currentCalendar.getDate() // will be ambig zone
-      expect(newDate).toEqualMoment('2010-02-01')
+      expect(newDate).toEqualDate('2010-02-01')
     })
   })
 })

+ 2 - 2
tests/automated/lib/moment.js

@@ -13,12 +13,12 @@ beforeEach(function() {
           if (!(actual instanceof Date)) {
             result = {
               pass: false,
-              message: 'Actual value ' + actual + 'needs to be an instance of a Date'
+              message: 'Actual value ' + actual + ' needs to be an instance of a Date'
             }
           } else if (!(expected instanceof Date)) {
             result = {
               pass: false,
-              message: 'Expected value ' + expected + 'needs to be an instance of a Date'
+              message: 'Expected value ' + expected + ' needs to be an instance of a Date'
             }
           } else if (actual.valueOf() !== expected.valueOf()) {
             result = {

+ 2 - 2
tests/automated/lib/time-grid.js

@@ -11,8 +11,8 @@ export function dragTimeGridEvent(eventEl, dropDate) {
         resolve(modifiedEvent)
       })
     })
-    currentCalendar.on('eventDrop', function(event) {
-      modifiedEvent = event
+    currentCalendar.on('eventDrop', function(arg) {
+      modifiedEvent = arg.event
     })
 
     eventEl.simulate('drag', {