ソースを参照

other test fixes

Adam Shaw 6 年 前
コミット
04d313ecd9

+ 3 - 3
packages/__tests__/src/legacy/destroy.js

@@ -8,7 +8,7 @@ describe('destroy', function() {
         dir: 'ltr'
       })
       currentCalendar.destroy()
-      expect($('#calendar')[0].className).toBe('')
+      expect(currentCalendar.el.className).toBe('')
     })
   })
 
@@ -18,7 +18,7 @@ describe('destroy', function() {
         dir: 'rtl'
       })
       currentCalendar.destroy()
-      expect($('#calendar')[0].className).toBe('')
+      expect(currentCalendar.el.className).toBe('')
     })
   })
 
@@ -28,7 +28,7 @@ describe('destroy', function() {
     it('cleans up all classNames on the root element', function() {
       initCalendar()
       currentCalendar.destroy()
-      expect($('#calendar')[0].className).toBe('')
+      expect(currentCalendar.el.className).toBe('')
     })
   })
 

+ 3 - 5
packages/__tests__/src/view-dates/ViewDateUtils.js

@@ -1,7 +1,6 @@
 
 export function expectRenderRange(start, end) {
-  var currentView = currentCalendar.view
-  var dateProfile = currentView.props.dateProfile
+  var dateProfile = currentCalendar.component.props // not a great way to get this info
 
   expect(dateProfile.renderRange.start).toEqualDate(start)
   expect(dateProfile.renderRange.end).toEqualDate(end)
@@ -10,8 +9,7 @@ export function expectRenderRange(start, end) {
 
 export function expectActiveRange(start, end) {
   var currentView = currentCalendar.view
-  var dateProfile = currentView.props.dateProfile
 
-  expect(dateProfile.activeRange.start).toEqualDate(start)
-  expect(dateProfile.activeRange.end).toEqualDate(end)
+  expect(currentView.activeStart).toEqualDate(start)
+  expect(currentView.activeEnd).toEqualDate(end)
 }