Selaa lähdekoodia

remove pit util

Adam Shaw 7 vuotta sitten
vanhempi
sitoutus
2c48ae68c4

+ 3 - 2
tests/automated/event-drag/repeating.js

@@ -21,7 +21,7 @@ describe('event dragging on repeating events', function() {
   })
   })
 
 
   // bug where offscreen instance of a repeating event was being incorrectly dragged
   // bug where offscreen instance of a repeating event was being incorrectly dragged
-  pit('drags correct instance of event', function() {
+  it('drags correct instance of event', function(done) {
 
 
     initCalendar()
     initCalendar()
 
 
@@ -29,10 +29,11 @@ describe('event dragging on repeating events', function() {
     // so that the new view receives out-of-range events.
     // so that the new view receives out-of-range events.
     currentCalendar.changeView('agendaWeek')
     currentCalendar.changeView('agendaWeek')
 
 
-    return TimeGridEventDragUtils.drag('2017-02-16T16:00:00', '2017-02-16T12:00:00')
+    TimeGridEventDragUtils.drag('2017-02-16T16:00:00', '2017-02-16T12:00:00')
       .then(function(res) {
       .then(function(res) {
         expect(typeof res).toBe('object')
         expect(typeof res).toBe('object')
       })
       })
+      .then(done)
   })
   })
 
 
   it('hides other repeating events when dragging', function(done) {
   it('hides other repeating events when dragging', function(done) {

+ 10 - 7
tests/automated/event-drag/showNonCurrentDates.js

@@ -14,24 +14,27 @@ describe('showNonCurrentDates event dragging', function() {
   })
   })
 
 
   describe('when dragging pointer into disabled region', function() {
   describe('when dragging pointer into disabled region', function() {
-    pit('won\'t allow the drop', function() {
+    it('won\'t allow the drop', function(done) {
       initCalendar()
       initCalendar()
-      return EventDragUtils.drag(
+      EventDragUtils.drag(
         DayGridRenderUtils.getDayEl('2017-06-08')[0].getBoundingClientRect(),
         DayGridRenderUtils.getDayEl('2017-06-08')[0].getBoundingClientRect(),
         DayGridRenderUtils.getDisabledDayElAtIndex(3)[0].getBoundingClientRect() // the cell before Jun 1
         DayGridRenderUtils.getDisabledDayElAtIndex(3)[0].getBoundingClientRect() // the cell before Jun 1
-      ).then(function(res) {
-        expect(res).toBe(false)
-      })
+      )
+        .then(function(res) {
+          expect(res).toBe(false)
+        })
+        .then(done)
     })
     })
   })
   })
 
 
   describe('when dragging an event\'s start into a disabled region', function() {
   describe('when dragging an event\'s start into a disabled region', function() {
-    pit('allow the drop if the cursor stays over non-disabled cells', function() {
+    it('allow the drop if the cursor stays over non-disabled cells', function(done) {
       initCalendar()
       initCalendar()
-      return DayGridEventDragUtils.drag('2017-06-08', '2017-06-01')
+      DayGridEventDragUtils.drag('2017-06-08', '2017-06-01')
         .then(function(res) {
         .then(function(res) {
           expect(typeof res).toBe('object')
           expect(typeof res).toBe('object')
         })
         })
+        .then(done)
     })
     })
   })
   })
 })
 })

+ 6 - 4
tests/automated/event-drag/validRange.js

@@ -16,12 +16,13 @@ describe('validRange event dragging', function() {
         editable: true
         editable: true
       })
       })
 
 
-      pit('won\'t go before validRange', function() {
+      it('won\'t go before validRange', function(done) {
         initCalendar()
         initCalendar()
-        return DayGridEventDragUtils.drag('2017-06-08', '2017-06-06')
+        DayGridEventDragUtils.drag('2017-06-08', '2017-06-06')
           .then(function(res) {
           .then(function(res) {
             expect(res).toBe(false)
             expect(res).toBe(false)
           })
           })
+          .then(done)
       })
       })
     })
     })
   })
   })
@@ -39,12 +40,13 @@ describe('validRange event dragging', function() {
         editable: true
         editable: true
       })
       })
 
 
-      pit('won\'t go after validRange', function() {
+      it('won\'t go after validRange', function(done) {
         initCalendar()
         initCalendar()
-        return DayGridEventDragUtils.drag('2017-06-05', '2017-06-08')
+        DayGridEventDragUtils.drag('2017-06-05', '2017-06-08')
           .then(function(res) {
           .then(function(res) {
             expect(res).toBe(false)
             expect(res).toBe(false)
           })
           })
+          .then(done)
       })
       })
     })
     })
   })
   })

+ 3 - 3
tests/automated/event-resize/validRange.js

@@ -14,14 +14,14 @@ describe('validRange event resizing', function() {
       editable: true
       editable: true
     })
     })
 
 
-    pit('won\'t go after validRange', function() {
+    it('won\'t go after validRange', function(done) {
       initCalendar()
       initCalendar()
-      return EventResizeUtils.resize(
+      EventResizeUtils.resize(
         DayGridRenderUtils.getDayEl('2017-06-06')[0].getBoundingClientRect(),
         DayGridRenderUtils.getDayEl('2017-06-06')[0].getBoundingClientRect(),
         DayGridRenderUtils.getDisabledDayElAtIndex(0)[0].getBoundingClientRect() // where Jun 9th would be
         DayGridRenderUtils.getDisabledDayElAtIndex(0)[0].getBoundingClientRect() // where Jun 9th would be
       ).then(function(res) {
       ).then(function(res) {
         expect(res).toBe(false)
         expect(res).toBe(false)
-      })
+      }).then(done)
     })
     })
   })
   })
 })
 })

+ 0 - 11
tests/automated/globals.js

@@ -1,15 +1,4 @@
 
 
-// Jasmine Enhancements
-// ---------------------------------------------------------------------------------------------------------------------
-
-// like `it`, but with the ability to return a promise
-window.pit = function(description, runFunc) {
-  it(description, function(done) {
-    runFunc().then(done)
-  })
-}
-
-
 // Setup / Teardown
 // Setup / Teardown
 // ---------------------------------------------------------------------------------------------------------------------
 // ---------------------------------------------------------------------------------------------------------------------