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

test tweaks, friendlier with destroy

Adam Shaw 8 лет назад
Родитель
Сommit
e96f754de4

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

@@ -25,6 +25,7 @@ describe('external drag and drop', function() {
   })
 
   afterEach(function() {
+    $('#cal').fullCalendar('destroy')
     $('#cal').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() {
         init()
         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)
         docListenerCounter.startWatching()
@@ -343,7 +343,7 @@ describe('external drag and drop', function() {
         el1.fullCalendar('next')
         expect(docListenerCounter.stopWatching()).toBe(0)
 
-        el1.remove()
+        el2.fullCalendar('destroy')
         el2.remove()
       })
     })

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

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

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

@@ -9,8 +9,14 @@ describe('unselectAuto', function() {
       defaultDate: '2014-12-25',
       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() {