Explorar o código

test tweaks, friendlier with destroy

Adam Shaw %!s(int64=8) %!d(string=hai) anos
pai
achega
e96f754de4

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

@@ -25,6 +25,7 @@ describe('external drag and drop', function() {
   })
   })
 
 
   afterEach(function() {
   afterEach(function() {
+    $('#cal').fullCalendar('destroy')
     $('#cal').remove()
     $('#cal').remove()
     $('#sidebar').remove()
     $('#sidebar').remove()
   })
   })
@@ -333,9 +334,8 @@ describe('external drag and drop', function() {
       it('should not have drag handlers cleared when other calendar navigates', function() {
       it('should not have drag handlers cleared when other calendar navigates', function() {
         init()
         init()
         var el1 = $('#cal')
         var el1 = $('#cal')
-
-        $('#cal').after('<div id="cal2"/>')
-        var el2 = $('#cal2').fullCalendar(options)
+        var el2 = $('<div id="cal2"/>').insertAfter(el1)
+        el2.fullCalendar(options)
 
 
         var docListenerCounter = new ListenerCounter(document)
         var docListenerCounter = new ListenerCounter(document)
         docListenerCounter.startWatching()
         docListenerCounter.startWatching()
@@ -343,7 +343,7 @@ describe('external drag and drop', function() {
         el1.fullCalendar('next')
         el1.fullCalendar('next')
         expect(docListenerCounter.stopWatching()).toBe(0)
         expect(docListenerCounter.stopWatching()).toBe(0)
 
 
-        el1.remove()
+        el2.fullCalendar('destroy')
         el2.remove()
         el2.remove()
       })
       })
     })
     })

+ 1 - 0
tests/automated/legacy/height-and-contentHeight.js

@@ -23,6 +23,7 @@
       })
       })
 
 
       afterEach(function() {
       afterEach(function() {
+        calendarEl.fullCalendar('destroy') // best to destroy before removing element
         calendarEl.remove()
         calendarEl.remove()
       })
       })
 
 

+ 8 - 2
tests/automated/legacy/unselectAuto.js

@@ -9,8 +9,14 @@ describe('unselectAuto', function() {
       defaultDate: '2014-12-25',
       defaultDate: '2014-12-25',
       defaultView: 'month'
       defaultView: 'month'
     }
     }
-    affix('#cal')
-    affix('#otherthing')
+    $('<div id="cal" />').appendTo('body')
+    $('<div id="otherthing" />').appendTo('body')
+  })
+
+  afterEach(function() {
+    $('#cal').fullCalendar('destroy')
+    $('#cal').remove()
+    $('#otherthing').remove()
   })
   })
 
 
   describe('when enabled', function() {
   describe('when enabled', function() {