Преглед изворни кода

background-events and updates from comments

kyle roux пре 7 година
родитељ
комит
974f3473e9

+ 2 - 16
tests/automated/event-render/EventRenderUtils.js

@@ -1,5 +1,3 @@
-import { getDayGridRowElAtIndex } from '../view-render/DayGridRenderUtils'
-
 const TIME_CLASS = 'fc-time'
 const EVENT_CLASS = 'fc-event'
 const TITLE_CLASS = 'fc-title'
@@ -54,26 +52,14 @@ export function getEventEls() {
   return $(`.${EVENT_CLASS}`)
 }
 
-export function getBackgroundEventEls() {
-  return $(`.${BACKGROUND_EVENT_CLASS}`)
-}
-
-export function getDayGridRowElAtIndexBackgroundEventEls(index) {
-  return getDayGridRowElAtIndex(index).find(`.${BACKGROUND_EVENT_CLASS}`)
-}
-
-export function getDayGridRowElAtIndexBackgroundEventElAtIndex(rowIndex, eventIndex) {
-  return getDayGridRowElAtIndexBackgroundEventEls(rowIndex).eq(eventIndex)
+export function getBackgroundEventEls(containerEl) {
+  return $(`.${BACKGROUND_EVENT_CLASS}`, containerEl)
 }
 
 export function getEventElAtIndex(index) {
   return getEventEls().eq(index)
 }
 
-export function getBackgroundEventElAtIndex(index) {
-  return getBackgroundEventEls().eq(index)
-}
-
 export function getFirstEventEl() {
   return getEventEls().first()
 }

+ 4 - 4
tests/automated/legacy/ListView.js

@@ -5,8 +5,8 @@ import {
   getListHeadingEls,
   getListEventEls,
   getListEventElsCount,
-  getListEventElTimeElText,
-  getListEventElTitleElText
+  getListEventElTimeText,
+  getListEventElTitle
 } from '../lib/ListViewUtils'
 import { getScrollerEl } from '../lib/MonthViewUtils'
 import { replaceEventElDotElWithEl } from '../event-render/EventRenderUtils'
@@ -465,8 +465,8 @@ describe('ListView rendering', function() {
     return getListEventEls().map(function(i, el) {
       el = $(el)
       return {
-        title: getListEventElTitleElText(el) || '', // text!
-        timeText: getListEventElTimeElText(el) || '' // text!
+        title: getListEventElTitle(el) || '', // text!
+        timeText: getListEventElTimeText(el) || '' // text!
       }
     }).get()
   }

+ 21 - 21
tests/automated/legacy/aspectRatio.js

@@ -1,4 +1,4 @@
-import { getViewContainerElHeight, getViewContainerElWidth } from '../lib/ViewUtils'
+import { getViewContainerEl } from '../lib/ViewUtils'
 
 describe('aspectRatio', function() {
 
@@ -12,13 +12,13 @@ describe('aspectRatio', function() {
 
     it('fc-content should use the ratio 1:35 to set height', function() {
       initCalendar({}, getCalendarElement(elementWidth))
-      var height = getViewContainerElHeight()
+      var height = getViewContainerEl().height()
       expect(Math.round(height)).toEqual(500)
     })
 
     it('fc-content should have width of div', function() {
       initCalendar({}, getCalendarElement(elementWidth))
-      var width = getViewContainerElWidth()
+      var width = getViewContainerEl().width()
       expect(Math.round(width)).toEqual(elementWidth)
     })
 
@@ -36,14 +36,14 @@ describe('aspectRatio', function() {
 
       it('should not change the width', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
+        var width = getViewContainerEl().width()
         expect(Math.round(width)).toEqual(elementWidth)
       })
 
       it('should set the height to width sizes very close to ratio of 2', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
-        var height = getViewContainerElHeight()
+        var width = getViewContainerEl().width()
+        var height = getViewContainerEl().height()
         var ratio = Math.round(width / height * 100)
         expect(Math.round(ratio)).toEqual(200)
       })
@@ -58,14 +58,14 @@ describe('aspectRatio', function() {
 
       it('should not change the width', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
+        var width = getViewContainerEl().width()
         expect(Math.round(width)).toEqual(elementWidth)
       })
 
       it('should set the height to width sizes very close to ratio of 2', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
-        var height = getViewContainerElHeight()
+        var width = getViewContainerEl().width()
+        var height = getViewContainerEl().height()
         var ratio = Math.round(width / height * 100)
         expect(Math.round(ratio)).toEqual(100)
       })
@@ -80,14 +80,14 @@ describe('aspectRatio', function() {
 
       it('should not change the width', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
+        var width = getViewContainerEl().width()
         expect(Math.round(width)).toEqual(elementWidth)
       })
 
       it('should set the height to width ratio to 0.5', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
-        var height = getViewContainerElHeight()
+        var width = getViewContainerEl().width()
+        var height = getViewContainerEl().height()
         var ratio = Math.round(width / height * 100)
         expect(Math.round(ratio)).toEqual(50)
       })
@@ -102,14 +102,14 @@ describe('aspectRatio', function() {
 
       it('should not change the width', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
+        var width = getViewContainerEl().width()
         expect(Math.round(width)).toEqual(elementWidth)
       })
 
       it('should set the height to width ratio to 0.5', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
-        var height = getViewContainerElHeight()
+        var width = getViewContainerEl().width()
+        var height = getViewContainerEl().height()
         var ratio = Math.round(width / height * 100)
         expect(Math.round(ratio)).toEqual(50)
       })
@@ -124,14 +124,14 @@ describe('aspectRatio', function() {
 
       it('should not change the width', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
+        var width = getViewContainerEl().width()
         expect(Math.round(width)).toEqual(elementWidth)
       })
 
       it('should set the height to width ratio to 0.5', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
-        var height = getViewContainerElHeight()
+        var width = getViewContainerEl().width()
+        var height = getViewContainerEl().height()
         var ratio = Math.round(width / height * 100)
         expect(Math.round(ratio)).toEqual(50)
       })
@@ -146,15 +146,15 @@ describe('aspectRatio', function() {
 
       it('should not change the width', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var width = getViewContainerElWidth()
+        var width = getViewContainerEl().width()
         expect(Math.round(width)).toEqual(elementWidth)
       })
 
       it('should cause rows to be natural height', function() {
         initCalendar({}, getCalendarElement(elementWidth))
-        var actualHeight = getViewContainerElHeight()
+        var actualHeight = getViewContainerEl().height()
         $('tr.fc-week td:first-child > div').css('min-height', '').css('background', 'red')
-        var naturalHeight = getViewContainerElHeight()
+        var naturalHeight = getViewContainerEl().height()
         expect(Math.round(actualHeight)).toEqual(Math.round(naturalHeight))
       })
 

+ 65 - 67
tests/automated/legacy/background-events.js

@@ -1,16 +1,14 @@
 import { RED_REGEX } from '../lib/dom-misc'
 import {
   getBackgroundEventEls,
-  getBackgroundEventElAtIndex,
-  getDayGridRowElAtIndexBackgroundEventEls,
   getEventEls,
   getSingleBackgroundEventEl,
-  getDayGridRowElAtIndexBackgroundEventElAtIndex
 } from '../event-render/EventRenderUtils'
 import {
   getBackgroundEventElsResizerEls,
   getDayGridNonBusinessDayEls,
-  getNonBusinessDayEls
+  getNonBusinessDayEls,
+  getDayGridRowEls,
 
 } from '../view-render/DayGridRenderUtils'
 import {
@@ -40,7 +38,7 @@ describe('background events', function() {
         } ]
         options.eventAfterAllRender = function() {
           expect(getBackgroundEventEls().length).toBe(1)
-          expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
+          expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
           expect(getSingleBackgroundEventEl()).toBeLeftOf('.fc-day[data-date="2014-11-05"]')
           expect(getEventEls().length).toBe(0)
           expect(getBackgroundEventElsResizerEls().length).toBe(0) // can't resize
@@ -58,10 +56,10 @@ describe('background events', function() {
         } ]
         options.eventAfterAllRender = function() {
           expect(getBackgroundEventEls().length).toBe(2)
-          expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
-          expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-          expect(getBackgroundEventElAtIndex(0)).toBeRightOf('.fc-day[data-date="2014-11-03"]')
-          expect(getBackgroundEventElAtIndex(1)).toBeLeftOf('.fc-day[data-date="2014-11-12"]')
+          expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
+          expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+          expect(getBackgroundEventEls().eq(0)).toBeRightOf('.fc-day[data-date="2014-11-03"]')
+          expect(getBackgroundEventEls().eq(1)).toBeLeftOf('.fc-day[data-date="2014-11-12"]')
           expect(getEventEls().length).toBe(0)
           done()
         }
@@ -83,9 +81,9 @@ describe('background events', function() {
         ]
         options.eventAfterAllRender = function() {
           expect(getBackgroundEventEls().length).toBe(2)
-          expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(2)
-          expect(getBackgroundEventElAtIndex(0)).toBeRightOf('.fc-day[data-date="2014-11-02"]')
-          expect(getBackgroundEventElAtIndex(1)).toBeLeftOf('.fc-day[data-date="2014-11-08"]')
+          expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(2)
+          expect(getBackgroundEventEls().eq(0)).toBeRightOf('.fc-day[data-date="2014-11-02"]')
+          expect(getBackgroundEventEls().eq(1)).toBeLeftOf('.fc-day[data-date="2014-11-08"]')
           expect(getEventEls().length).toBe(0)
           done()
         }
@@ -102,7 +100,7 @@ describe('background events', function() {
           } ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
             expect(getBackgroundEventEls()).toBeRightOf('.fc-day-grid .fc-row:eq(1) .fc-week-number')
             expect(getEventEls().length).toBe(0)
             done()
@@ -135,7 +133,7 @@ describe('background events', function() {
         } ]
         options.eventAfterAllRender = function() {
           expect(getBackgroundEventEls().length).toBe(1)
-          expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
+          expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
           expect(getBackgroundEventEls()).toBeRightOf('.fc-day[data-date="2014-11-06"]')
           expect(getEventEls().length).toBe(0)
           done()
@@ -152,10 +150,10 @@ describe('background events', function() {
         } ]
         options.eventAfterAllRender = function() {
           expect(getBackgroundEventEls().length).toBe(2)
-          expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
-          expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-          expect(getBackgroundEventElAtIndex(0)).toBeLeftOf('.fc-day[data-date="2014-11-02"]')
-          expect(getBackgroundEventElAtIndex(1)).toBeRightOf('.fc-day[data-date="2014-11-12"]')
+          expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
+          expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+          expect(getBackgroundEventEls().eq(0)).toBeLeftOf('.fc-day[data-date="2014-11-02"]')
+          expect(getBackgroundEventEls().eq(1)).toBeRightOf('.fc-day[data-date="2014-11-12"]')
           expect(getEventEls().length).toBe(0)
           done()
         }
@@ -172,7 +170,7 @@ describe('background events', function() {
           } ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
             expect(getBackgroundEventEls()).toBeLeftOf('.fc-day-grid .fc-row:eq(1) .fc-week-number span')
             expect(getEventEls().length).toBe(0)
             done()
@@ -194,16 +192,16 @@ describe('background events', function() {
           } ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(7)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(0).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(2)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(3).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(4).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(5).length).toBe(1)
-
-            expect(getDayGridRowElAtIndexBackgroundEventElAtIndex(1, 0))
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(0)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(2)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(3)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(4)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(5)).length).toBe(1)
+
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).eq(0))
               .toBeLeftOf('.fc-day[data-date="2014-11-05"]')
-            expect(getDayGridRowElAtIndexBackgroundEventElAtIndex(1, 1))
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).eq(1))
               .toBeRightOf('.fc-day[data-date="2014-11-03"]')
 
             expect(getEventEls().length).toBe(0)
@@ -221,17 +219,17 @@ describe('background events', function() {
           } ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(6)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(0).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(3).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(4).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(5).length).toBe(1)
-
-            expect(getDayGridRowElAtIndexBackgroundEventElAtIndex(1, 0))
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(0)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(3)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(4)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(5)).length).toBe(1)
+
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).eq(0))
               .toBeLeftOf('.fc-day[data-date="2014-11-05"]')
 
-            expect(getDayGridRowElAtIndexBackgroundEventElAtIndex(2, 0))
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).eq(0))
               .toBeRightOf('.fc-day[data-date="2014-11-09"]')
 
             expect(getEventEls().length).toBe(0)
@@ -248,14 +246,14 @@ describe('background events', function() {
           } ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(5)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(0).length).toBe(0)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(3).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(4).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(5).length).toBe(1)
-
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1))
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(0)).length).toBe(0)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(3)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(4)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(5)).length).toBe(1)
+
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)))
               .toBeRightOf('.fc-day[data-date="2014-11-04"]')
 
             done()
@@ -271,14 +269,14 @@ describe('background events', function() {
           } ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(5)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(0).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(3).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(4).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(5).length).toBe(0)
-
-            expect(getDayGridRowElAtIndexBackgroundEventEls(4))
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(0)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(3)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(4)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(5)).length).toBe(0)
+
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(4)))
               .toBeLeftOf('.fc-day[data-date="2014-11-28"]')
 
             done()
@@ -301,12 +299,12 @@ describe('background events', function() {
           ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(8)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(0).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(3)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(3).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(4).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(5).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(0)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(3)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(3)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(4)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(5)).length).toBe(1)
 
             /* order in DOM is reversed
             expect($('.fc-day-grid .fc-row:eq(1) .fc-bgevent:eq(0)'))
@@ -333,12 +331,12 @@ describe('background events', function() {
           } ]
           options.eventAfterAllRender = function() {
             expect(getBackgroundEventEls().length).toBe(7)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(0).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(1).length).toBe(2)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(2).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(3).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(4).length).toBe(1)
-            expect(getDayGridRowElAtIndexBackgroundEventEls(5).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(0)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(1)).length).toBe(2)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(2)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(3)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(4)).length).toBe(1)
+            expect(getBackgroundEventEls(getDayGridRowEls().eq(5)).length).toBe(1)
 
             /* order in DOM is reversed
             expect($('.fc-day-grid .fc-row:eq(1) .fc-bgevent:eq(0)'))
@@ -690,8 +688,8 @@ describe('background events', function() {
             expect(queryBgEventsInCol(5).length).toBe(1)
             expect(queryBgEventsInCol(6).length).toBe(1)
 
-            expect(getBackgroundEventElAtIndex(3)).toBeAbove('.fc-slats tr:eq(2)') // first part before 1am
-            expect(getBackgroundEventElAtIndex(4)).toBeBelow('.fc-slats tr:eq(9)') // second part after 5am
+            expect(getBackgroundEventEls().eq(3)).toBeAbove('.fc-slats tr:eq(2)') // first part before 1am
+            expect(getBackgroundEventEls().eq(4)).toBeBelow('.fc-slats tr:eq(9)') // second part after 5am
 
             done()
           }

+ 8 - 3
tests/automated/legacy/businessHours.js

@@ -2,8 +2,13 @@
 
 import { getBoundingRect } from '../lib/dom-geom'
 import { doElsMatchSegs } from '../lib/segs'
-import { getTimeGridTop, getTimeGridDayEls } from '../lib/time-grid'
+import {
+  getTimeGridTop,
+  getTimeGridDayEls,
+  getTimeGridNonBusinessDayEls
+} from '../lib/time-grid'
 import { ensureDate } from '../datelib/utils'
+import { getDayGridNonBusinessDayEls } from '../view-render/DayGridRenderUtils'
 
 
 describe('businessHours', function() {
@@ -21,7 +26,7 @@ describe('businessHours', function() {
     currentCalendar.next() // ... out. should render correctly.
 
     // whole days
-    expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2) // each multi-day stretch is one element
+    expect(getDayGridNonBusinessDayEls().length).toBe(2) // each multi-day stretch is one element
 
     // timed area
     expect(isTimeGridNonBusinessSegsRendered([
@@ -191,7 +196,7 @@ describe('businessHours', function() {
   ------------------------------------------------------------------------------------------------------------------ */
 
   function isTimeGridNonBusinessSegsRendered(segs) {
-    return doElsMatchSegs($('.fc-time-grid .fc-nonbusiness'), segs, getTimeGridRect)
+    return doElsMatchSegs(getTimeGridNonBusinessDayEls(), segs, getTimeGridRect)
   }
 
   function getTimeGridRect(start, end) {

+ 4 - 4
tests/automated/legacy/dayPopoverFormat.js

@@ -1,4 +1,4 @@
-import { getMoreEl, getMorePopoverElTitleEl } from '../view-render/DayGridRenderUtils'
+import { getMoreEl, getMorePopoverTitle } from '../view-render/DayGridRenderUtils'
 
 describe('dayPopoverFormat', function() {
 
@@ -18,7 +18,7 @@ describe('dayPopoverFormat', function() {
       dayPopoverFormat: { month: 'long', day: 'numeric' }
     })
     getMoreEl().simulate('click')
-    expect(getMorePopoverElTitleEl()).toHaveText('July 29')
+    expect(getMorePopoverTitle()).toHaveText('July 29')
   })
 
   it('is affected by the current locale when the value is default', function() {
@@ -26,7 +26,7 @@ describe('dayPopoverFormat', function() {
       locale: 'fr'
     })
     getMoreEl().simulate('click')
-    expect(getMorePopoverElTitleEl()).toHaveText('29 juillet 2014')
+    expect(getMorePopoverTitle()).toHaveText('29 juillet 2014')
   })
 
   it('still maintains the same format when explicitly set, and there is a locale', function() {
@@ -35,7 +35,7 @@ describe('dayPopoverFormat', function() {
       dayPopoverFormat: { year: 'numeric' }
     })
     getMoreEl().simulate('click')
-    expect(getMorePopoverElTitleEl()).toHaveText('2014')
+    expect(getMorePopoverTitle()).toHaveText('2014')
   })
 
 })

+ 2 - 2
tests/automated/lib/ListViewUtils.js

@@ -23,11 +23,11 @@ export function getListEventElTimeEl(el) {
   return el.find(`.${LIST_ITEM_TIME_CLASS}`)
 }
 
-export function getListEventElTitleElText(el) {
+export function getListEventElTitle(el) {
   return getListEventElTitleEl(el).text()
 }
 
-export function getListEventElTimeElText(el) {
+export function getListEventElTimeText(el) {
   return getListEventElTimeEl(el).text()
 }
 

+ 0 - 9
tests/automated/lib/MonthViewUtils.js

@@ -1,15 +1,6 @@
 const SCROLLER_CLASS = 'fc-scroller'
-const ROW_CLASS = 'fc-row'
-const DAY_GRID_CLASS = 'fc-day-grid'
 
 export function getScrollerEl() {
   return $(currentCalendar.el).find(`.${SCROLLER_CLASS}`)
 }
 
-export function getDayGridRowEls() {
-  return $(`.${DAY_GRID_CLASS} .${ROW_CLASS}`)
-}
-
-export function getDayGridRowElAtIndex(index) {
-  return getDayGridRowEls().eq(index)
-}

+ 0 - 8
tests/automated/lib/ViewUtils.js

@@ -4,11 +4,3 @@ const VIEW_CONTAINER_CLASS = 'fc-view-container'
 export function getViewContainerEl() {
   return $(`.${VIEW_CONTAINER_CLASS}`)
 }
-
-export function getViewContainerElHeight() {
-  return getViewContainerEl().height()
-}
-
-export function getViewContainerElWidth() {
-  return getViewContainerEl().width()
-}

+ 1 - 1
tests/automated/view-render/DayGridRenderUtils.js

@@ -102,7 +102,7 @@ export function getMorePopoverEl() {
   return $(`.${MORE_POPOVER_CLASS}`)
 }
 
-export function getMorePopoverElTitleEl() {
+export function getMorePopoverTitle() {
   return getMorePopoverEl().find(`.${HEADER_CLASS} .${TITLE_CLASS}`)
 }