浏览代码

a lot of noncontroversial test updates

Adam Shaw 7 年之前
父节点
当前提交
0682f22a68
共有 28 个文件被更改,包括 269 次插入431 次删除
  1. 1 1
      tests/automated/legacy/addEventSource.js
  2. 14 14
      tests/automated/legacy/allDayDefault.js
  3. 12 12
      tests/automated/legacy/background-events.js
  4. 11 19
      tests/automated/legacy/businessHours.js
  5. 1 7
      tests/automated/legacy/constructor.js
  6. 6 1
      tests/automated/legacy/custom-view-duration.js
  7. 17 39
      tests/automated/legacy/dayClick.js
  8. 2 2
      tests/automated/legacy/defaultAllDayEventDuration.js
  9. 2 2
      tests/automated/legacy/defaultTimedEventDuration.js
  10. 33 23
      tests/automated/legacy/event-dnd.js
  11. 10 17
      tests/automated/legacy/event-obj.js
  12. 20 22
      tests/automated/legacy/event-resize.js
  13. 3 3
      tests/automated/legacy/eventDestroy.js
  14. 7 7
      tests/automated/legacy/eventLimit-popover.js
  15. 1 1
      tests/automated/legacy/eventRender.js
  16. 10 10
      tests/automated/legacy/eventRenderWait.js
  17. 17 17
      tests/automated/legacy/events-gcal.js
  18. 1 1
      tests/automated/legacy/events-json-feed.js
  19. 41 90
      tests/automated/legacy/external-dnd-advanced.js
  20. 5 0
      tests/automated/legacy/external-dnd.js
  21. 2 2
      tests/automated/legacy/forceEventDuration.js
  22. 1 1
      tests/automated/legacy/getEventSources.js
  23. 13 3
      tests/automated/legacy/height-and-contentHeight.js
  24. 7 44
      tests/automated/legacy/refetchEventSources.js
  25. 2 47
      tests/automated/legacy/removeEventSource.js
  26. 6 3
      tests/automated/legacy/removeEventSources.js
  27. 15 30
      tests/automated/legacy/removeEvents.js
  28. 9 13
      tests/automated/legacy/timezone.js

+ 1 - 1
tests/automated/legacy/addEventSource.js

@@ -102,7 +102,7 @@ describe('addEventSource', function() {
   // Checks to make sure all events have been rendered and that the calendar
   // has internal info on all the events.
   function checkAllEvents() {
-    expect(currentCalendar.clientEvents().length).toEqual(3)
+    expect(currentCalendar.getEvents().length).toEqual(3)
     expect($('.fc-event').length).toEqual(3)
   }
 

+ 14 - 14
tests/automated/legacy/allDayDefault.js

@@ -11,7 +11,7 @@ describe('allDayDefault', function() {
           }
         ]
       })
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(false)
     })
 
@@ -25,7 +25,7 @@ describe('allDayDefault', function() {
           }
         ]
       })
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(false)
     })
 
@@ -38,7 +38,7 @@ describe('allDayDefault', function() {
           }
         ]
       })
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(true)
     })
 
@@ -52,7 +52,7 @@ describe('allDayDefault', function() {
           }
         ]
       })
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(true)
     })
 
@@ -67,7 +67,7 @@ describe('allDayDefault', function() {
         ]
       })
 
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(false)
     })
 
@@ -81,7 +81,7 @@ describe('allDayDefault', function() {
           }
         ]
       })
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(false)
     })
 
@@ -99,7 +99,7 @@ describe('allDayDefault', function() {
           }
         ]
       })
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(false)
     })
 
@@ -110,11 +110,11 @@ describe('allDayDefault', function() {
           {
             id: '1',
             start: '2014-05-01T00:00:00',
-            allDay: true
+            isAllDay: true
           }
         ]
       })
-      var eventObj = currentCalendar.clientEvents('1')[0]
+      var eventObj = currentCalendar.getEventById('1')
       expect(eventObj.isAllDay).toEqual(true)
     })
 
@@ -138,7 +138,7 @@ describe('source.allDayDefault', function() {
         }
       ]
     })
-    var eventObj = currentCalendar.clientEvents('1')[0]
+    var eventObj = currentCalendar.getEventById('1')
     expect(eventObj.isAllDay).toEqual(false)
   })
 
@@ -157,7 +157,7 @@ describe('source.allDayDefault', function() {
         }
       ]
     })
-    var eventObj = currentCalendar.clientEvents('1')[0]
+    var eventObj = currentCalendar.getEventById('1')
     expect(eventObj.isAllDay).toEqual(true)
   })
 
@@ -176,7 +176,7 @@ describe('source.allDayDefault', function() {
         }
       ]
     })
-    var eventObj = currentCalendar.clientEvents('1')[0]
+    var eventObj = currentCalendar.getEventById('1')
     expect(eventObj.isAllDay).toEqual(false)
   })
 
@@ -189,13 +189,13 @@ describe('source.allDayDefault', function() {
             {
               id: '1',
               start: '2014-05-01',
-              allDay: false
+              isAllDay: false
             }
           ]
         }
       ]
     })
-    var eventObj = currentCalendar.clientEvents('1')[0]
+    var eventObj = currentCalendar.getEventById('1')
     expect(eventObj.isAllDay).toEqual(false)
   })
 

+ 12 - 12
tests/automated/legacy/background-events.js

@@ -270,12 +270,12 @@ describe('background events', function() {
           var options = {}
           options.events = [
             {
-              id: 'hi',
+              groupId: 'hi',
               start: '2014-11-06',
               rendering: 'inverse-background'
             },
             {
-              id: 'hi',
+              groupId: 'hi',
               start: '2014-11-04',
               rendering: 'inverse-background'
             }
@@ -446,9 +446,9 @@ describe('background events', function() {
         it('renders correctly if custom', function() {
           var options = {}
           options.businessHours = {
-            start: '02:00',
-            end: '06:00',
-            dow: [ 1, 2, 3, 4 ] // Mon-Thu
+            startTime: '02:00',
+            endTime: '06:00',
+            daysOfWeek: [ 1, 2, 3, 4 ] // Mon-Thu
           }
           initCalendar(options)
 
@@ -504,9 +504,9 @@ describe('background events', function() {
         it('renders correctly if custom', function() {
           var options = {}
           options.businessHours = {
-            start: '02:00',
-            end: '06:00',
-            dow: [ 1, 2, 3, 4 ] // Mon-Thu
+            startTime: '02:00',
+            endTime: '06:00',
+            daysOfWeek: [ 1, 2, 3, 4 ] // Mon-Thu
           }
           initCalendar(options)
 
@@ -618,13 +618,13 @@ describe('background events', function() {
           var options = {}
           options.events = [
             {
-              id: 'hello',
+              groupId: 'hello',
               start: '2014-11-05T01:00:00',
               end: '2014-11-05T05:00:00',
               rendering: 'inverse-background'
             },
             {
-              id: 'hello',
+              groupId: 'hello',
               start: '2014-11-03T01:00:00',
               end: '2014-11-03T05:00:00',
               rendering: 'inverse-background'
@@ -649,13 +649,13 @@ describe('background events', function() {
           var options = {}
           options.events = [
             {
-              id: 'hello',
+              groupId: 'hello',
               start: '2014-11-05T01:00:00',
               end: '2014-11-05T05:00:00',
               rendering: 'inverse-background'
             },
             {
-              id: 'hello',
+              groupId: 'hello',
               start: '2014-11-05T02:00:00',
               end: '2014-11-05T04:00:00',
               rendering: 'inverse-background'

+ 11 - 19
tests/automated/legacy/businessHours.js

@@ -56,14 +56,10 @@ describe('businessHours', function() {
           defaultView: viewName,
           businessHours: false
         })
-        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($('.fc-view > *:first')[0]).toBe(rootEl[0]) // same element. didn't completely rerender
       })
 
       it('allows dynamic turning off', function() {
@@ -71,14 +67,10 @@ describe('businessHours', function() {
           defaultView: viewName,
           businessHours: true
         })
-        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($('.fc-view > *:first')[0]).toBe(rootEl[0]) // same element. didn't completely rerender
       })
     })
   })
@@ -92,14 +84,14 @@ describe('businessHours', function() {
         defaultView: 'agendaWeek',
         businessHours: [
           {
-            dow: [ 1, 2, 3 ], // mon, tue, wed
-            start: '08:00',
-            end: '18:00'
+            daysOfWeek: [ 1, 2, 3 ], // mon, tue, wed
+            startTime: '08:00',
+            endTime: '18:00'
           },
           {
-            dow: [ 4, 5 ], // thu, fri
-            start: '10:00',
-            end: '16:00'
+            daysOfWeek: [ 4, 5 ], // thu, fri
+            startTime: '10:00',
+            endTime: '16:00'
           }
         ]
       })
@@ -135,13 +127,13 @@ describe('businessHours', function() {
         businessHours: [
           {
             // invalid
-            start: '08:00',
-            end: '18:00'
+            startTime: '08:00',
+            endTime: '18:00'
           },
           {
-            dow: [ 4, 5 ], // thu, fri
-            start: '10:00',
-            end: '16:00'
+            daysOfWeek: [ 4, 5 ], // thu, fri
+            startTime: '10:00',
+            endTime: '16:00'
           }
         ]
       })

+ 1 - 7
tests/automated/legacy/constructor.js

@@ -1,12 +1,5 @@
 
 describe('constructor', function() {
-  beforeEach(function() {
-    initCalendar()
-  })
-  it('should return a jQuery object for chaining', function() {
-    var res = $(currentCalendar.el)
-    expect(res instanceof jQuery).toBe(true)
-  })
 
   it('should not modify the options object', function() {
     var options = {
@@ -57,6 +50,7 @@ describe('constructor', function() {
     beforeEach(function() {
       initCalendar()
     })
+
     it('should contain a table fc-toolbar', function() {
       var header = $(currentCalendar.el).find('.fc-toolbar')
       expect(header[0]).not.toBeUndefined()

+ 6 - 1
tests/automated/legacy/custom-view-duration.js

@@ -349,7 +349,12 @@ describe('custom view', function() {
     })
 
     it('falls back to view name when view lacks metadata', function() {
-      FullCalendar.views.crazy = FullCalendar.View.extend()
+
+      class CrazyView extends FullCalendar.View {
+      }
+
+      FullCalendar.views.crazy = CrazyView
+
       var options = {
         views: {}
       }

+ 17 - 39
tests/automated/legacy/dayClick.js

@@ -24,19 +24,15 @@ describe('dayClick', function() {
                 expect(typeof arg.view).toEqual('object') // "
                 expect(arg.isAllDay).toEqual(true)
                 expect(arg.date).toEqualDate('2014-05-07')
+                done()
               }
-              spyOn(options, 'dayClick').and.callThrough()
+
               initCalendar(options)
 
               var dayCell = $('.fc-day:eq(10)') // 2014-05-07 (regardless of isRTL)
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
-              dayCell.simulate('drag', {
-                callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled()
-                  done()
-                }
-              })
+              dayCell.simulate('drag')
             })
           })
 
@@ -51,20 +47,16 @@ describe('dayClick', function() {
                 expect(typeof arg.view).toEqual('object') // "
                 expect(arg.isAllDay).toEqual(true)
                 expect(arg.date).toEqualDate('2014-05-28')
+                done()
               }
-              spyOn(options, 'dayClick').and.callThrough()
+
               initCalendar(options)
 
               // 2014-05-28 (regardless of isRTL)
               var dayContent = $('.fc-agenda-view .fc-day-grid .fc-day:eq(3)')
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
-              dayContent.simulate('drag', {
-                callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled()
-                  done()
-                }
-              })
+              dayContent.simulate('drag')
             })
 
             it('fires correctly when clicking on a timed slot', function(done) {
@@ -79,20 +71,16 @@ describe('dayClick', function() {
                 expect(typeof arg.view).toEqual('object') // "
                 expect(arg.isAllDay).toEqual(false)
                 expect(arg.date).toEqualDate('2014-05-28T09:00:00Z')
+                done()
               }
-              spyOn(options, 'dayClick').and.callThrough()
+
               initCalendar(options)
 
               // the middle is 2014-05-28T09:00:00 (regardless of isRTL)
               var slotRow = $('.fc-slats tr:eq(18) td:not(.fc-time)')
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
-              slotRow.simulate('drag', {
-                callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled()
-                  done()
-                }
-              })
+              slotRow.simulate('drag')
             })
 
             // issue 2217
@@ -109,20 +97,16 @@ describe('dayClick', function() {
                 expect(typeof arg.view).toEqual('object') // "
                 expect(arg.isAllDay).toEqual(false)
                 expect(arg.date).toEqualDate('2014-05-28T11:00:00Z')
+                done()
               }
-              spyOn(options, 'dayClick').and.callThrough()
+
               initCalendar(options)
 
               // the middle is 2014-05-28T11:00:00 (regardless of isRTL)
               var slotRow = $('.fc-slats tr:eq(18) td:not(.fc-time)')
 
               // for simulating the mousedown/mouseup/click (relevant for selectable)
-              slotRow.simulate('drag', {
-                callback: function() {
-                  expect(options.dayClick).toHaveBeenCalled()
-                  done()
-                }
-              })
+              slotRow.simulate('drag')
             })
           })
         })
@@ -140,19 +124,16 @@ describe('dayClick', function() {
         expect(typeof arg.view).toEqual('object') // "
         expect(arg.isAllDay).toEqual(true)
         expect(arg.date).toEqualDate('2014-05-07')
+        done()
       }
-      spyOn(options, 'dayClick').and.callThrough()
+
       initCalendar(options)
 
       var dayCell = $('.fc-day:eq(10)') // 2014-05-07 (regardless of isRTL)
 
       // for simulating the mousedown/mouseup/click (relevant for selectable)
       dayCell.simulate('drag', {
-        isTouch: true,
-        callback: function() {
-          expect(options.dayClick).toHaveBeenCalled()
-          done()
-        }
+        isTouch: true
       })
     })
 
@@ -186,16 +167,13 @@ describe('dayClick', function() {
         expect(typeof arg.view).toEqual('object') // "
         expect(arg.isAllDay).toEqual(true)
         expect(arg.date).toEqualDate('2014-05-07')
+        done()
       }
-      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()
     })
   })
 })

+ 2 - 2
tests/automated/legacy/defaultAllDayEventDuration.js

@@ -24,7 +24,7 @@ describe('defaultAllDayEventDuration', function() {
         ]
       })
 
-      var event = currentCalendar.clientEvents()[0]
+      var event = currentCalendar.getEvents()[0]
       expect(event.end).toEqualDate('2014-05-07')
     })
 
@@ -40,7 +40,7 @@ describe('defaultAllDayEventDuration', function() {
         ]
       })
 
-      var event = currentCalendar.clientEvents()[0]
+      var event = currentCalendar.getEvents()[0]
       expect(event.end).toEqualDate('2014-05-08')
     })
   })

+ 2 - 2
tests/automated/legacy/defaultTimedEventDuration.js

@@ -22,7 +22,7 @@ describe('defaultTimedEventDuration', function() {
           }
         ]
       })
-      var event = currentCalendar.clientEvents()[0]
+      var event = currentCalendar.getEvents()[0]
       expect(event.end).toEqualDate('2014-05-05T06:30:00Z')
     })
 
@@ -36,7 +36,7 @@ describe('defaultTimedEventDuration', function() {
           }
         ]
       })
-      var event = currentCalendar.clientEvents()[0]
+      var event = currentCalendar.getEvents()[0]
       expect(event.end).toEqualDate('2014-05-05T07:15:00Z')
     })
   })

+ 33 - 23
tests/automated/legacy/event-dnd.js

@@ -44,13 +44,15 @@ describe('eventDrop', function() {
                 })
               },
               function(arg) {
-                expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 9 }))
+                var delta = FullCalendar.createDuration({ day: 9 })
+                expect(arg.mutation.startDelta).toEqual(delta)
+                expect(arg.mutation.endDelta).toEqual(delta)
 
                 expect(arg.event.start).toEqualDate('2014-06-20')
                 expect(arg.event.end).toBeNull()
 
-                arg.revertFunc()
-                var event = currentCalendar.clientEvents()[0]
+                arg.revert()
+                var event = currentCalendar.getEvents()[0]
 
                 expect(event.start).toEqualDate('2014-06-11')
                 expect(event.end).toBeNull()
@@ -79,13 +81,15 @@ describe('eventDrop', function() {
             })
           },
           function(arg) {
-            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 5 }))
+            var delta = FullCalendar.createDuration({ day: 5 })
+            expect(arg.mutation.startDelta).toEqual(delta)
+            expect(arg.mutation.endDelta).toEqual(delta)
 
             expect(arg.event.start).toEqualDate('2014-06-16T06:00:00Z')
             expect(arg.event.end).toBeNull()
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11T06:00:00Z')
             expect(event.end).toBeNull()
@@ -171,13 +175,15 @@ describe('eventDrop', function() {
                 }, 0)
               },
               function(arg) {
-                expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 1, hour: 1, minute: 30 }))
+                var delta = FullCalendar.createDuration({ day: 1, hour: 1, minute: 30 })
+                expect(arg.mutation.startDelta).toEqual(delta)
+                expect(arg.mutation.endDelta).toEqual(delta)
 
                 expect(arg.event.start).toEqualDate('2014-06-12T07:30:00Z')
                 expect(arg.event.end).toBeNull()
 
-                arg.revertFunc()
-                var event = currentCalendar.clientEvents()[0]
+                arg.revert()
+                var event = currentCalendar.getEvents()[0]
 
                 expect(event.start).toEqualDate('2014-06-11T06:00:00Z')
                 expect(event.end).toBeNull()
@@ -205,13 +211,15 @@ describe('eventDrop', function() {
             })
           },
           function(arg) {
-            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 2 }))
+            var delta = FullCalendar.createDuration({ day: 2 })
+            expect(arg.mutation.startDelta).toEqual(delta)
+            expect(arg.mutation.endDelta).toEqual(delta)
 
             expect(arg.event.start).toEqualDate('2014-06-13')
             expect(arg.event.end).toBeNull()
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
@@ -242,14 +250,16 @@ describe('eventDrop', function() {
             })
           },
           function(arg) {
-            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: -1, hour: 1 }))
+            let delta = FullCalendar.createDuration({ day: -1, hour: 1 })
+            expect(arg.mutation.startDelta).toEqual(delta)
+            expect(arg.mutation.endDelta).toEqual(delta)
 
             expect(arg.event.start).toEqualDate('2014-06-10T01:00:00Z')
             expect(arg.event.end).toBeNull()
             expect(arg.event.isAllDay).toBe(false)
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
@@ -294,14 +304,16 @@ describe('eventDrop', function() {
             })
           },
           function(arg) {
-            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: -1 }))
+            var delta = FullCalendar.createDuration({ day: -1 })
+            expect(arg.mutation.startDelta).toEqual(delta)
+            expect(arg.mutation.endDelta).toEqual(delta)
 
             expect(arg.event.start).toEqualDate('2014-06-10')
             expect(arg.event.end).toBeNull()
             expect(arg.event.isAllDay).toBe(true)
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11T01:00:00Z')
             expect(event.end).toBeNull()
@@ -402,13 +414,11 @@ describe('eventDrop', function() {
       expect(typeof arg.jsEvent).toBe('object')
       expect(typeof arg.view).toBe('object')
     }
-    options.eventDrop = function(arg) {
+    options.eventMutation = function(arg) {
       expect(options.eventDragStop).toHaveBeenCalled()
 
-      expect(arg.el instanceof Element).toBe(true)
-      expect(arg.el).toHaveClass('fc-event')
-      expect(typeof arg.delta).toBe('object')
-      expect(typeof arg.revertFunc).toBe('function')
+      expect(typeof arg.mutation).toBe('object')
+      expect(typeof arg.revert).toBe('function')
       expect(typeof arg.jsEvent).toBe('object')
       expect(typeof arg.view).toBe('object')
 

+ 10 - 17
tests/automated/legacy/event-obj.js

@@ -15,7 +15,7 @@ describe('event object creation', function() {
     initCalendar({
       events: [ singleEventData ]
     })
-    return currentCalendar.clientEvents()[0]
+    return currentCalendar.getEvents()[0]
   }
 
   it('accepts `date` property as alias for `start`', function() {
@@ -98,7 +98,7 @@ describe('event object creation', function() {
     var event = init({
       start: '2014-05-01T01:00:00-12:00',
       end: '2014-05-02T01:00:00-12:00',
-      allDay: true
+      isAllDay: true
     })
     expect(event.isAllDay).toEqual(true)
     expect(event.start).toEqualDate('2014-05-01')
@@ -109,27 +109,20 @@ describe('event object creation', function() {
     var event = init({
       start: '2014-05-01',
       end: '2014-05-03',
-      allDay: false
+      isAllDay: false
     })
     expect(event.isAllDay).toEqual(false)
     expect(event.start).toEqualDate('2014-05-01T00:00:00Z')
     expect(event.end).toEqualDate('2014-05-03T00:00:00Z')
   })
 
-  it('sets the source', function() {
-    var event = init({
-      start: '2014-05-01'
-    })
-    expect(typeof event.source).toEqual('object')
-  })
-
   it('accepts an array `className`', function() {
     var event = init({
       start: '2014-05-01',
       className: [ 'class1', 'class2' ]
     })
-    expect($.isArray(event.className)).toEqual(true)
-    expect(event.className).toEqual([ 'class1', 'class2' ])
+    expect($.isArray(event.classNames)).toEqual(true)
+    expect(event.classNames).toEqual([ 'class1', 'class2' ])
   })
 
   it('accepts a string `className`', function() {
@@ -137,18 +130,18 @@ describe('event object creation', function() {
       start: '2014-05-01',
       className: 'class1 class2'
     })
-    expect($.isArray(event.className)).toEqual(true)
-    expect(event.className).toEqual([ 'class1', 'class2' ])
+    expect($.isArray(event.classNames)).toEqual(true)
+    expect(event.classNames).toEqual([ 'class1', 'class2' ])
   })
 
-  it('copies over custom properties', function() {
+  it('accepts extended properties', function() {
     var event = init({
       start: '2014-05-01',
       prop1: 'prop1val',
       prop2: [ 'a', 'b' ]
     })
-    expect(event.prop1).toEqual('prop1val')
-    expect(event.prop2).toEqual([ 'a', 'b' ])
+    expect(event.extendedProps.prop1).toEqual('prop1val')
+    expect(event.extendedProps.prop2).toEqual([ 'a', 'b' ])
   })
 
 })

+ 20 - 22
tests/automated/legacy/event-resize.js

@@ -32,8 +32,8 @@ describe('eventResize', function() {
             expect(arg.event.start).toEqualDate('2014-06-11')
             expect(arg.event.end).toEqualDate('2014-06-17')
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
@@ -57,7 +57,7 @@ describe('eventResize', function() {
             options.events = [ {
               title: 'all-day event',
               start: '2014-06-11',
-              allDay: true
+              isAllDay: true
             } ]
 
             init(
@@ -81,8 +81,8 @@ describe('eventResize', function() {
                 expect(arg.event.start).toEqualDate('2014-06-11')
                 expect(arg.event.end).toEqualDate('2014-06-17')
 
-                arg.revertFunc()
-                var event = currentCalendar.clientEvents()[0]
+                arg.revert()
+                var event = currentCalendar.getEvents()[0]
 
                 expect(event.start).toEqualDate('2014-06-11')
                 expect(event.end).toBeNull()
@@ -138,8 +138,8 @@ describe('eventResize', function() {
             expect(arg.event.start).toEqualDate('2014-06-11')
             expect(arg.event.end).toEqualDate('2014-06-14')
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
@@ -176,8 +176,8 @@ describe('eventResize', function() {
             expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z')
             expect(arg.event.end).toEqualDate('2014-06-11T09:30:00Z')
 
-            arg.revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11T05:00:00Z')
             expect(event.end).toEqualDate('2014-06-11T07:00:00Z')
@@ -212,8 +212,8 @@ describe('eventResize', function() {
             expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z')
             expect(arg.event.end).toEqualDate('2014-06-11T09:30:00Z')
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11T05:00:00Z')
             expect(event.end).toEqualDate('2014-06-11T07:00:00Z')
@@ -241,8 +241,8 @@ describe('eventResize', function() {
             expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z')
             expect(arg.event.end).toEqualDate('2014-06-12T09:30:00Z')
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11T05:00:00Z')
             expect(event.end).toEqualDate('2014-06-11T07:00:00Z')
@@ -269,8 +269,8 @@ describe('eventResize', function() {
             expect(arg.event.start).toEqualDate('2014-06-11T05:00:00') // local
             expect(arg.event.end).toEqualDate('2014-06-11T09:30:00') // local
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11T05:00:00') // local
             expect(event.end).toEqualDate('2014-06-11T07:00:00') // local
@@ -297,8 +297,8 @@ describe('eventResize', function() {
             expect(arg.event.start).toEqualDate('2014-06-11T05:00:00+00:00')
             expect(arg.event.end).toEqualDate('2014-06-11T09:30:00+00:00')
 
-            arg.revertFunc()
-            var event = currentCalendar.clientEvents()[0]
+            arg.revert()
+            var event = currentCalendar.getEvents()[0]
 
             expect(event.start).toEqualDate('2014-06-11T05:00:00+00:00')
             expect(event.end).toEqualDate('2014-06-11T07:00:00+00:00')
@@ -474,14 +474,12 @@ describe('eventResize', function() {
       expect(typeof arg.jsEvent).toBe('object')
       expect(typeof arg.view).toBe('object')
     }
-    options.eventResize = function(arg) {
+    options.eventMutation = function(arg) {
       expect(options.eventResizeStop).toHaveBeenCalled()
 
-      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.mutation).toBe('object')
+      expect(typeof arg.revert).toBe('function')
       expect(typeof arg.jsEvent).toBe('object')
       expect(typeof arg.view).toBe('object')
 

+ 3 - 3
tests/automated/legacy/eventDestroy.js

@@ -19,7 +19,7 @@ describe('eventDestroy', function() {
       }
     })
 
-    currentCalendar.removeEvents(singleEventData.id)
+    currentCalendar.getEventById(singleEventData.id).remove()
   }
 
   describe('when in month view', function() { // for issue 2017
@@ -30,7 +30,7 @@ describe('eventDestroy', function() {
 
     it('gets called with removeEvents method', function(done) {
       testSingleEvent({
-        id: 1,
+        id: '1',
         title: 'event1',
         date: '2014-08-02'
       }, done)
@@ -46,7 +46,7 @@ describe('eventDestroy', function() {
 
     it('gets called with removeEvents method', function(done) {
       testSingleEvent({
-        id: 1,
+        id: '1',
         title: 'event1',
         date: '2014-08-02T02:00:00'
       }, done)

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

@@ -104,49 +104,49 @@ describe('eventLimit popover', function() {
             title: 'event01',
             start: '2012-03-22T11:00:00',
             end: '2012-03-22T11:30:00',
-            allDay: false
+            isAllDay: false
           },
           {
             id: '40607',
             title: 'event02',
             start: '2012-03-22T16:15:00',
             end: '2012-03-22T16:30:00',
-            allDay: false
+            isAllDay: false
           },
           {
             id: '40760',
             title: 'event03',
             start: '2012-03-22T16:00:00',
             end: '2012-03-22T16:15:00',
-            allDay: false
+            isAllDay: false
           },
           {
             id: '41284',
             title: 'event04',
             start: '2012-03-22T19:00:00',
             end: '2012-03-22T19:15:00',
-            allDay: false
+            isAllDay: false
           },
           {
             id: '41645',
             title: 'event05',
             start: '2012-03-22T11:30:00',
             end: '2012-03-22T12:00:00',
-            allDay: false
+            isAllDay: false
           },
           {
             id: '41679',
             title: 'event07',
             start: '2012-03-22T12:00:00',
             end: '2012-03-22T12:15:00',
-            allDay: false
+            isAllDay: false
           },
           {
             id: '42246',
             title: 'event08',
             start: '2012-03-22T16:45:00',
             end: '2012-03-22T17:00:00',
-            allDay: false
+            isAllDay: false
           }
         ]
       })

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

@@ -24,7 +24,7 @@ describe('eventRender', function() {
           var options = {
             eventRender: function(arg) {
               expect(typeof arg.event).toBe('object')
-              expect(arg.event.rendering).toBeUndefined()
+              expect(arg.event.rendering).toBe('')
               expect(arg.event.start).toBeDefined()
               expect(arg.el instanceof HTMLElement).toBe(true)
               expect(typeof arg.view).toBe('object')

+ 10 - 10
tests/automated/legacy/eventRenderWait.js

@@ -20,7 +20,7 @@ describe('eventRenderWait', function() {
       eventRenderWait: 0, // will still debounce despite being zero
       eventAfterAllRender: function() {
         eventRenderCnt++
-        if (eventRenderCnt === 1) {
+        if (eventRenderCnt === 2) {
 
           expect($('.event1').length).toBe(1)
           expect($('.event2').length).toBe(1)
@@ -31,25 +31,25 @@ describe('eventRenderWait', function() {
 
           // make sure doesn't fire again
           setTimeout(function() {
-            expect(eventRenderCnt).toBe(1)
+            expect(eventRenderCnt).toBe(2)
             done()
           }, 1000)
         }
       }
     })
 
-    expect($('.fc-event').length).toBe(0)
+    expect($('.fc-event').length).toBe(2)
 
     currentCalendar.addEventSource(eventSource2)
-    expect($('.fc-event').length).toBe(0)
+    expect($('.fc-event').length).toBe(2)
 
-    currentCalendar.renderEvent(extraEvent1)
-    expect($('.fc-event').length).toBe(0)
+    currentCalendar.addEvent(extraEvent1)
+    expect($('.fc-event').length).toBe(2)
 
-    currentCalendar.renderEvent(extraEvent2)
-    expect($('.fc-event').length).toBe(0)
+    var refined2 = currentCalendar.addEvent(extraEvent2)
+    expect($('.fc-event').length).toBe(2)
 
-    currentCalendar.removeEvents(extraEvent2.id) // only works with id!?
-    expect($('.fc-event').length).toBe(0)
+    refined2.remove()
+    expect($('.fc-event').length).toBe(2)
   })
 })

+ 17 - 17
tests/automated/legacy/events-gcal.js

@@ -47,7 +47,7 @@ describe('Google Calendar plugin', function() {
     options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID }
     options.timezone = 'local'
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       var i
 
       expect(events.length).toBe(NUM_EVENTS)
@@ -65,7 +65,7 @@ describe('Google Calendar plugin', function() {
     options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID }
     options.timezone = 'UTC'
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       var i
 
       expect(events.length).toBe(NUM_EVENTS)
@@ -83,7 +83,7 @@ describe('Google Calendar plugin', function() {
     options.events = { googleCalendarId: HOLIDAY_CALENDAR_ID }
     options.timezone = 'America/New York'
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       var eventEls = $('.fc-event')
       var i
 
@@ -121,7 +121,7 @@ describe('Google Calendar plugin', function() {
       googleCalendarApiKey: API_KEY
     }
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct)
       done()
     }
@@ -140,7 +140,7 @@ describe('Google Calendar plugin', function() {
         googleCalendarId: HOLIDAY_CALENDAR_ID
       }
       options.eventAfterAllRender = function() {
-        var events = currentCalendar.clientEvents()
+        var events = currentCalendar.getEvents()
 
         expect(events.length).toBe(0)
         expect(currentWarnArgs.length).toBeGreaterThan(0)
@@ -168,7 +168,7 @@ describe('Google Calendar plugin', function() {
         googleCalendarId: HOLIDAY_CALENDAR_ID
       }
       options.eventAfterAllRender = function() {
-        var events = currentCalendar.clientEvents()
+        var events = currentCalendar.getEvents()
 
         expect(events.length).toBe(0)
         expect(currentWarnArgs.length).toBeGreaterThan(0)
@@ -187,7 +187,7 @@ describe('Google Calendar plugin', function() {
     options.googleCalendarApiKey = API_KEY
     options.events = HOLIDAY_CALENDAR_ID
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct)
       done()
     }
@@ -242,7 +242,7 @@ describe('Google Calendar plugin', function() {
     options.googleCalendarApiKey = API_KEY
     options.events = 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct)
       done()
     }
@@ -253,7 +253,7 @@ describe('Google Calendar plugin', function() {
     options.googleCalendarApiKey = API_KEY
     options.events = 'https://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct)
       done()
     }
@@ -265,7 +265,7 @@ describe('Google Calendar plugin', function() {
     options.events =
       'https://www.googleapis.com/calendar/v3/calendars/usa__en%40holiday.calendar.google.com/events'
     options.eventAfterAllRender = function() {
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct)
       done()
     }
@@ -292,7 +292,7 @@ describe('Google Calendar plugin', function() {
     initCalendar(options)
   })
 
-  describe('removeEventSource', function() {
+  describe('EventSource::remove', function() {
 
     it('works when specifying only the Google Calendar ID', function(done) {
       var called = false
@@ -305,12 +305,12 @@ describe('Google Calendar plugin', function() {
         if (called) { return } // only the first time
         called = true
 
-        events = currentCalendar.clientEvents()
+        events = currentCalendar.getEvents()
         expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct)
 
         setTimeout(function() {
-          currentCalendar.removeEventSource(HOLIDAY_CALENDAR_ID)
-          events = currentCalendar.clientEvents()
+          currentCalendar.getEventSources()[0].remove()
+          events = currentCalendar.getEvents()
           expect(events.length).toBe(0)
           done()
         }, 0)
@@ -331,12 +331,12 @@ describe('Google Calendar plugin', function() {
         if (called) { return } // only the first time
         called = true
 
-        events = currentCalendar.clientEvents()
+        events = currentCalendar.getEvents()
         expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct)
 
         setTimeout(function() {
-          currentCalendar.removeEventSource(googleSource)
-          events = currentCalendar.clientEvents()
+          currentCalendar.getEventSources()[0].remove()
+          events = currentCalendar.getEvents()
           expect(events.length).toBe(0)
           done()
         }, 0)

+ 1 - 1
tests/automated/legacy/events-json-feed.js

@@ -52,7 +52,7 @@ describe('events as a json feed', function() {
     })
   })
 
-  it('requests correctly when custom timezone', function(done) {
+  it('requests correctly when named timezone', function(done) {
 
     XHRMock.get(/^my-feed\.php/, function(req, res) {
       expect(req.url().query).toEqual({

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

@@ -12,9 +12,14 @@ describe('advanced external dnd', function() {
       })
       .appendTo('body')
       .draggable()
+
+    FullCalendar.GenericDragging.enable({
+      itemSelector: '.drag'
+    })
   })
 
   afterEach(function() {
+    FullCalendar.GenericDragging.disable()
     dragEl.remove()
     dragEl = null
   })
@@ -112,91 +117,57 @@ describe('advanced external dnd', function() {
       it('fires correctly', function(done) {
         var options = {}
 
-        dragEl.data('event', { title: 'hey' })
+        dragEl.attr('data-event', JSON.stringify({
+          title: 'hey'
+        }))
         testExternalEventDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', 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)
-              .data('start', '05:00')
-          })
-          defineTests()
-        })
-        describe('through the `time` data attribute', function() {
-          beforeEach(function() {
-            dragEl.data('event', true)
-              .data('time', '05:00')
+            dragEl.attr('data-event', JSON.stringify({
+              time: '05:00' // TODO: rename to startTime
+            }))
           })
-          defineTests()
-        })
-        function defineTests() {
+
           it('voids the given time when dropped on a timed slot', function(done) {
             var options = {}
-
             testExternalEventDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, done)
             // will test the resulting event object's start
           })
-        }
+        })
       })
 
       describe('when given a duration', function() {
         describe('through the event object\'s duration property', function() {
           beforeEach(function() {
-            dragEl.data('event', { duration: '05:00' })
+            dragEl.attr('data-event', JSON.stringify({
+              duration: '05:00'
+            }))
           })
-          defineTests()
-        })
-        describe('through the `duration` data attribute', function() {
-          beforeEach(function() {
-            dragEl.data('event', true)
-              .data('duration', '05:00')
-          })
-          defineTests()
-        })
-        function defineTests() {
+
           it('accepts the given duration when dropped on a timed slot', function(done) {
             var options = {}
 
             testExternalEventDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, function() {
-              var event = currentCalendar.clientEvents()[0]
+              var event = currentCalendar.getEvents()[0]
               expect(event.start).toEqualDate('2014-11-13T02:00:00Z')
               expect(event.end).toEqualDate('2014-11-13T07:00:00Z')
               done()
             })
           })
-        }
+        })
       })
 
       describe('when given stick:true', function() {
         describe('through the event object', function() {
           beforeEach(function() {
-            dragEl.data('event', { stick: true })
+            dragEl.attr('data-event', JSON.stringify({
+              stick: true
+            }))
           })
-          defineTests()
-        })
-        describe('through the data attribute', function() {
-          beforeEach(function() {
-            dragEl.data('event', true)
-              .data('stick', true)
-          })
-          defineTests()
-        })
-        function defineTests() {
+
           it('keeps the event when navigating away and back', function(done) {
             var options = {}
 
@@ -224,7 +195,7 @@ describe('advanced external dnd', function() {
             } ]
           })
           beforeEach(function() {
-            dragEl.data('event', true)
+            dragEl.attr('data-event', '{}')
           })
           defineTests()
         })
@@ -236,9 +207,9 @@ describe('advanced external dnd', function() {
             }]
           })
           beforeEach(function() {
-            dragEl.data('event', {
+            dragEl.attr('data-event', JSON.stringify({
               overlap: false
-            })
+            }))
           })
           defineTests()
         })
@@ -251,7 +222,7 @@ describe('advanced external dnd', function() {
             }]
           })
           beforeEach(function() {
-            dragEl.data('event', true)
+            dragEl.attr('data-event', '{}')
           })
           defineTests()
         })
@@ -276,19 +247,21 @@ describe('advanced external dnd', function() {
             }
           })
           beforeEach(function() {
-            dragEl.data('event', { duration: '02:00' })
+            dragEl.attr('data-event', JSON.stringify({
+              duration: '02:00'
+            }))
           })
           defineTests()
         })
         describe('via the event object\'s constraint property', function() {
           beforeEach(function() {
-            dragEl.data('event', {
+            dragEl.attr('data-event', JSON.stringify({
               duration: '02:00',
               constraint: {
                 start: '04:00',
                 end: '08:00'
               }
-            })
+            }))
           })
           defineTests()
         })
@@ -318,60 +291,38 @@ describe('advanced external dnd', function() {
       it('fires correctly', function(done) {
         var options = {}
 
-        dragEl.data('event', { title: 'hey' })
+        dragEl.attr('data-event', JSON.stringify({
+          title: 'hey'
+        }))
         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' })
+            dragEl.attr('data-event', JSON.stringify({
+              time: '05:00' // TODO: rename to startTime
+            }))
           })
-          defineTests()
-        })
-
-        describe('through the `start` data attribute', function() {
-          beforeEach(function() {
-            dragEl.data('event', true)
-              .data('start', '05:00')
-          })
-          defineTests()
-        })
 
-        describe('through the `time` data attribute', function() {
-          beforeEach(function() {
-            dragEl.data('event', true)
-              .data('time', '05:00')
-          })
-          defineTests()
-        })
-
-        function defineTests() {
           it('accepts the given start time for the dropped day', function(done) {
             var options = {}
 
             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]
+              var event = currentCalendar.getEvents()[0]
               expect(event.start).toEqualDate('2014-11-13T05:00:00Z')
               done()
             })
           })
-        }
+        })
       })
     })
   })
 
 
-  function testExternalElDrag(options, dragToDate, expectedDate, expectSuccess, callback) {
+  function testExternalElDrag(options, dragToDate, expectedDate, expectSuccess, callback) { // with NO event creation
     options.droppable = true
     options.drop = function(arg) {
       expect(arg.date instanceof Date).toBe(true)

+ 5 - 0
tests/automated/legacy/external-dnd.js

@@ -22,6 +22,10 @@ describe('external drag and drop', function() {
       '<div id="cal" style="width:600px;position:absolute;top:10px;left:220px">' +
       '</div>'
     )
+
+    FullCalendar.GenericDragging.enable({
+      itemSelector: '#sidebar .fc-event'
+    })
   })
 
   afterEach(function() {
@@ -29,6 +33,7 @@ describe('external drag and drop', function() {
     currentCalendar.destroy()
     $(el).remove()
     $('#sidebar').remove()
+    FullCalendar.GenericDragging.disable()
   })
 
   function init() {

+ 2 - 2
tests/automated/legacy/forceEventDuration.js

@@ -22,7 +22,7 @@ describe('forceEventDuration', function() {
           }
         ]
       })
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       expect(events[0].end).toBeNull()
       expect(events[1].end).toBeNull()
     })
@@ -45,7 +45,7 @@ describe('forceEventDuration', function() {
           }
         ]
       })
-      var events = currentCalendar.clientEvents()
+      var events = currentCalendar.getEvents()
       expect(events[0].id).toEqual('1')
       expect(events[0].end instanceof Date).toEqual(true)
       expect(events[1].id).toEqual('2')

+ 1 - 1
tests/automated/legacy/getEventSources.js

@@ -28,7 +28,7 @@ describe('getEventSources', function() {
     expect(eventSources.length).toBe(3)
 
     // prove that eventSources is a copy, and wasn't mutated
-    currentCalendar.removeEventSource(eventSources[0])
+    eventSources[0].remove()
     expect(eventSources.length).toBe(3)
 
     done()

+ 13 - 3
tests/automated/legacy/height-and-contentHeight.js

@@ -76,9 +76,13 @@
 
               heightPropDescriptions.forEach(function(testInfo) {
                 describe(testInfo.description, function() {
+
                   if (testInfo.heightWrapper) {
                     beforeEach(function() {
-                      calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />')
+                      calendarEl.wrap('<div id="calendar-container" style="height: 600px;" />')
+                    })
+                    afterEach(function() {
+                      $('#calendar-container').remove()
                     })
                   }
 
@@ -180,7 +184,10 @@
                   describe(testInfo.description, function() {
                     if (testInfo.heightWrapper) {
                       beforeEach(function() {
-                        calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />')
+                        calendarEl.wrap('<div id="calendar-container" style="height: 600px;" />')
+                      })
+                      afterEach(function() {
+                        $('#calendar-container').remove()
                       })
                     }
 
@@ -234,7 +241,10 @@
                     describe(testInfo.description, function() {
                       if (testInfo.heightWrapper) {
                         beforeEach(function() {
-                          calendarEl.wrap('<div class="calendar-container" style="height: 600px;" />')
+                          calendarEl.wrap('<div id="calendar-container" style="height: 600px;" />')
+                        })
+                        afterEach(function() {
+                          $('#calendar-container').remove()
                         })
                       }
 

+ 7 - 44
tests/automated/legacy/refetchEventSources.js

@@ -77,7 +77,7 @@ describe('refetchEventSources', function() {
       eventCount = 2
       fetchId = 8
 
-      currentCalendar.refetchEventSources(2)
+      currentCalendar.getEventSourceById('blue').refetch()
 
       // events from unaffected sources remain
       expect($('.source1-7').length).toEqual(1)
@@ -93,42 +93,8 @@ describe('refetchEventSources', function() {
     })
   })
 
-  describe('with an array of multiple event sources passed in', function() {
-    it('only refetches events for the specified event sources', function(done) {
-      initCalendar()
-
-      expect($('.source1-7').length).toEqual(1)
-      expect($('.source2-7').length).toEqual(1)
-      expect($('.source3-7').length).toEqual(1)
-
-      var allEventSources = currentCalendar.getEventSources()
-      var greenEventSources = $.grep(allEventSources, function(eventSource) {
-        return eventSource.color === 'green'
-      })
-
-      // increase the number of events for the refetched sources
-      eventCount = 2
-      fetchId = 8
-
-      currentCalendar.refetchEventSources(greenEventSources)
-
-      // events from unaffected sources remain
-      expect($('.source2-7').length).toEqual(1)
-
-      // events from old fetch were cleared
-      expect($('.source1-7').length).toEqual(0)
-      expect($('.source3-7').length).toEqual(0)
-
-      // events from new fetch were rendered
-      expect($('.source1-8').length).toEqual(2)
-      expect($('.source3-8').length).toEqual(2)
-
-      done()
-    })
-  })
-
-  describe('with an array of multiple event source IDs passed in', function() {
-    it('only refetches events for the specified event sources', function(done) {
+  describe('multiple event sources', function() {
+    it('will be refetched', function(done) {
       initCalendar()
 
       expect($('.source1-7').length).toEqual(1)
@@ -139,7 +105,8 @@ describe('refetchEventSources', function() {
       eventCount = 2
       fetchId = 8
 
-      currentCalendar.refetchEventSources([ 1, 3 ])
+      currentCalendar.getEventSourceById('green0').refetch()
+      currentCalendar.getEventSourceById('green1').refetch()
 
       // events from unaffected sources remain
       expect($('.source2-7').length).toEqual(1)
@@ -178,16 +145,12 @@ describe('refetchEventSources', function() {
         }
       })
 
-      var allEventSources = currentCalendar.getEventSources()
-      var greenEventSources = $.grep(allEventSources, function(eventSource) { // source 1 and 3
-        return eventSource.color === 'green'
-      })
-
       // increase the number of events for the refetched sources
       eventCount = 2
       fetchId = 8
 
-      currentCalendar.refetchEventSources(greenEventSources)
+      currentCalendar.getEventSourceById('green0').refetch()
+      currentCalendar.getEventSourceById('green1').refetch()
     })
   })
 

+ 2 - 47
tests/automated/legacy/removeEventSource.js

@@ -85,55 +85,10 @@ describe('removeEventSource', function() {
       }
     })
 
-    currentCalendar.removeEventSource(source1)
+    currentCalendar.getEventSources()[0].remove()
     currentCalendar.addEventSource(source2)
   })
 
-  describe('when multiple sources share the same fetching function', function() {
-    var fetchFunc = function(arg, callback) {
-      callback([ {
-        title: 'event',
-        start: '2014-08-01T02:00:00'
-      } ])
-    }
-
-    pushOptions({
-      eventSources: [
-        { events: fetchFunc, className: 'event1', id: 'source1' },
-        { events: fetchFunc, className: 'event2', id: 'source2' }
-      ]
-    })
-
-    describe('when called with the raw function', function() {
-      it('removes events from all matching sources', function() {
-
-        initCalendar()
-        expect($('.fc-event').length).toBe(2)
-        expect($('.event1').length).toBe(1)
-        expect($('.event2').length).toBe(1)
-
-        currentCalendar.removeEventSource(fetchFunc)
-        expect($('.fc-event').length).toBe(0)
-      })
-    })
-
-    describe('when called with proper source object', function() {
-      it('removes events only from the specific source', function() {
-
-        initCalendar()
-        expect($('.fc-event').length).toBe(2)
-        expect($('.event1').length).toBe(1)
-        expect($('.event2').length).toBe(1)
-
-        var source = currentCalendar.getEventSourceById('source2')
-        currentCalendar.removeEventSource(source)
-        expect($('.fc-event').length).toBe(1)
-        expect($('.event1').length).toBe(1)
-        expect($('.event2').length).toBe(0)
-      })
-    })
-  })
-
   function testInput(eventInput) {
 
     it('correctly removes events provided via `events` at initialization', function(done) {
@@ -201,6 +156,6 @@ describe('removeEventSource', function() {
 
   function expectEventCnt(cnt) {
     expect($('.fc-event').length).toBe(cnt)
-    expect(currentCalendar.clientEvents().length).toBe(cnt)
+    expect(currentCalendar.getEvents().length).toBe(cnt)
   }
 })

+ 6 - 3
tests/automated/legacy/removeEventSources.js

@@ -10,13 +10,14 @@ describe('removeEventSources', function() {
     ]
   })
 
-  describe('when called with no arguments', function() {
+  describe('when called with no arguments', function() { //
     it('removes all sources', function() {
 
       initCalendar()
       expect($('.fc-event').length).toBe(3)
 
-      currentCalendar.removeEventSources()
+      currentCalendar.removeAllEventSources()
+
       expect($('.fc-event').length).toBe(0)
     })
   })
@@ -27,7 +28,9 @@ describe('removeEventSources', function() {
       initCalendar()
       expect($('.fc-event').length).toBe(3)
 
-      currentCalendar.removeEventSources([ 1, 3 ])
+      currentCalendar.getEventSourceById(1).remove()
+      currentCalendar.getEventSourceById(3).remove()
+
       expect($('.fc-event').length).toBe(1)
       expect($('.event2').length).toBe(1)
     })

+ 15 - 30
tests/automated/legacy/removeEvents.js

@@ -34,26 +34,28 @@ describe('removeEvents', function() {
         go(
           eventGenerator(),
           function() {
-            currentCalendar.removeEvents()
+            currentCalendar.removeAllEvents()
           },
           function() {
-            expect(currentCalendar.clientEvents().length).toEqual(0)
+            expect(currentCalendar.getEvents().length).toEqual(0)
             expect($('.fc-event').length).toEqual(0)
           },
           done
         )
       })
 
-      it('can remove events with a filter function', function(done) {
+      it('can remove events individually', function(done) {
         go(
           eventGenerator(),
           function() {
-            currentCalendar.removeEvents(function(event) {
-              return $.inArray('event-one', event.className) !== -1
+            currentCalendar.getEvents().forEach(function(event) {
+              if ($.inArray('event-one', event.classNames) !== -1) {
+                event.remove()
+              }
             })
           },
           function() {
-            expect(currentCalendar.clientEvents().length).toEqual(2)
+            expect(currentCalendar.getEvents().length).toEqual(2)
             expect($('.fc-event').length).toEqual(2)
             expect($('.event-zero').length).toEqual(1)
             expect($('.event-two').length).toEqual(1)
@@ -69,10 +71,10 @@ describe('removeEvents', function() {
     go(
       buildEventsWithIds(),
       function() {
-        currentCalendar.removeEvents(1)
+        currentCalendar.getEvent(1).remove()
       },
       function() {
-        expect(currentCalendar.clientEvents().length).toEqual(2)
+        expect(currentCalendar.getEvents().length).toEqual(2)
         expect($('.fc-event').length).toEqual(2)
         expect($('.event-zero').length).toEqual(1)
         expect($('.event-two').length).toEqual(1)
@@ -85,10 +87,10 @@ describe('removeEvents', function() {
     go(
       buildEventsWithIds(),
       function() {
-        currentCalendar.removeEvents('1')
+        currentCalendar.getEvent('1').remove()
       },
       function() {
-        expect(currentCalendar.clientEvents().length).toEqual(2)
+        expect(currentCalendar.getEvents().length).toEqual(2)
         expect($('.fc-event').length).toEqual(2)
         expect($('.event-zero').length).toEqual(1)
         expect($('.event-two').length).toEqual(1)
@@ -101,10 +103,10 @@ describe('removeEvents', function() {
     go(
       buildEventsWithIds(),
       function() {
-        currentCalendar.removeEvents(0)
+        currentCalendar.getEvent(0).remove()
       },
       function() {
-        expect(currentCalendar.clientEvents().length).toEqual(2)
+        expect(currentCalendar.getEvents().length).toEqual(2)
         expect($('.fc-event').length).toEqual(2)
         expect($('.event-zero').length).toEqual(0)
         expect($('.event-non-zero').length).toEqual(2)
@@ -113,23 +115,6 @@ describe('removeEvents', function() {
     )
   })
 
-  it('can remove an event with an internal _id', function() {
-    var event
-
-    initCalendar({
-      defaultDate: '2014-06-24',
-      events: [ { title: 'event0', start: '2014-06-24' } ]
-    })
-
-    event = currentCalendar.clientEvents()[0]
-    expect(typeof event).toBe('object')
-
-    currentCalendar.removeEvents(event._id)
-    expect(
-      currentCalendar.clientEvents().length
-    ).toBe(0)
-  })
-
   // Verifies the actions in removeFunc executed correctly by calling checkFunc.
   function go(events, removeFunc, checkFunc, doneFunc) {
     var called = false
@@ -169,7 +154,7 @@ describe('removeEvents', function() {
   // Checks to make sure all events have been rendered and that the calendar
   // has internal info on all the events.
   function checkAllEvents() {
-    expect(currentCalendar.clientEvents().length).toEqual(3)
+    expect(currentCalendar.getEvents().length).toEqual(3)
     expect($('.fc-event').length).toEqual(3)
   }
 

+ 9 - 13
tests/automated/legacy/timezone.js

@@ -37,9 +37,9 @@ describe('timezone', function() {
   })
 
   function expectLocalTimezone() {
-    var allDayEvent = currentCalendar.clientEvents('1')[0]
-    var timedEvent = currentCalendar.clientEvents('2')[0]
-    var zonedEvent = currentCalendar.clientEvents('3')[0]
+    var allDayEvent = currentCalendar.getEventById('1')
+    var timedEvent = currentCalendar.getEventById('2')
+    var zonedEvent = currentCalendar.getEventById('3')
     expect(allDayEvent.isAllDay).toEqual(true)
     expect(allDayEvent.start).toEqualDate('2014-05-02T00:00:00') // local
     expect(timedEvent.isAllDay).toEqual(false)
@@ -60,9 +60,9 @@ describe('timezone', function() {
   })
 
   function expectUtcTimezone() {
-    var allDayEvent = currentCalendar.clientEvents('1')[0]
-    var timedEvent = currentCalendar.clientEvents('2')[0]
-    var zonedEvent = currentCalendar.clientEvents('3')[0]
+    var allDayEvent = currentCalendar.getEventById('1')
+    var timedEvent = currentCalendar.getEventById('2')
+    var zonedEvent = currentCalendar.getEventById('3')
     expect(allDayEvent.isAllDay).toEqual(true)
     expect(allDayEvent.start).toEqualDate('2014-05-02')
     expect(timedEvent.isAllDay).toEqual(false)
@@ -83,9 +83,9 @@ describe('timezone', function() {
   })
 
   function expectCustomTimezone() {
-    var allDayEvent = currentCalendar.clientEvents('1')[0]
-    var timedEvent = currentCalendar.clientEvents('2')[0]
-    var zonedEvent = currentCalendar.clientEvents('3')[0]
+    var allDayEvent = currentCalendar.getEventById('1')
+    var timedEvent = currentCalendar.getEventById('2')
+    var zonedEvent = currentCalendar.getEventById('3')
     expect(allDayEvent.isAllDay).toEqual(true)
     expect(allDayEvent.start).toEqualDate('2014-05-02')
     expect(timedEvent.isAllDay).toEqual(false)
@@ -97,7 +97,6 @@ describe('timezone', function() {
 
   it('can be set dynamically', function(done) {
     var callCnt = 0
-    var rootEl
 
     initCalendar({
       timezone: 'local',
@@ -105,12 +104,9 @@ describe('timezone', function() {
         callCnt++
         if (callCnt === 1) {
           expectLocalTimezone()
-          rootEl = $('.fc-view > *:first')
-          expect(rootEl.length).toBe(1)
           currentCalendar.option('timezone', 'UTC') // will cause second call...
         } else if (callCnt === 2) {
           expectUtcTimezone()
-          expect($('.fc-view > *:first')[0]).toBe(rootEl[0]) // ensure didn't rerender whole calendar
           done()
         }
       }