Procházet zdrojové kódy

tests were using wrong scrollgrid classname

Adam Shaw před 6 roky
rodič
revize
333b668e59

+ 1 - 1
packages-premium

@@ -1 +1 @@
-Subproject commit 694e4682279cb7d9e2a1d7992d4f6f9dd89ec333
+Subproject commit 06645d6f2b4567f2c2eaf67e3c69981d48c27f8c

+ 1 - 1
packages/__tests__/src/event-drag/between-calendars.js

@@ -131,7 +131,7 @@ describe('dragging events between calendars', function() {
 
     let eventEl = getSingleEl()[0]
     let point0 = getRectCenter(eventEl.getBoundingClientRect())
-    let point1 = getRectCenter(el1.querySelector('.fc-scrollgrid .fc-body:last-child .fc-scroller').getBoundingClientRect())
+    let point1 = getRectCenter(el1.querySelector('.scrollgrid .fc-body:last-child .fc-scroller').getBoundingClientRect())
 
     $(eventEl).simulate('drag', {
       point: point0,

+ 10 - 10
packages/__tests__/src/legacy/height-and-contentHeight.js

@@ -95,7 +95,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                       init(testInfo.height)
                       diff = Math.abs(heightElm.outerHeight() - 600)
                       expect(diff).toBeLessThan(2)
-                      expect('.fc-scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
+                      expect('.scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
                     })
                   })
 
@@ -120,7 +120,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                       })
 
                       expect(tallRow.outerHeight()).toBeGreaterThan(shortHeight * 2) // much taller
-                      expect('.fc-scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
+                      expect('.scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
                     })
                   })
 
@@ -139,7 +139,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                     it('height is correct and scrollbars show up', function() {
                       init(testInfo.height)
                       expectHeight(600)
-                      expect($('.fc-scrollgrid .fc-body:last-child .fc-scroller')).toHaveScrollbars()
+                      expect($('.scrollgrid .fc-body:last-child .fc-scroller')).toHaveScrollbars()
                     })
                   })
                 })
@@ -159,7 +159,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                 it('height is really tall and there are no scrollbars', function() {
                   init('auto')
                   expect(heightElm.outerHeight()).toBeGreaterThan(1000) // pretty tall
-                  expect($('.fc-scrollgrid .fc-body:last-child .fc-scroller')).not.toHaveScrollbars()
+                  expect($('.scrollgrid .fc-body:last-child .fc-scroller')).not.toHaveScrollbars()
                 })
               })
             });
@@ -185,7 +185,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                       it('should be the specified height, with no scrollbars', function() {
                         init(testInfo.height)
                         expectHeight(600)
-                        expect('.fc-scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
+                        expect('.scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
                       })
                     })
 
@@ -196,7 +196,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                       it('should have the correct height, with scrollbars', function() {
                         init(testInfo.height)
                         expectHeight(600)
-                        expect('.fc-scrollgrid .fc-body:last-child .fc-scroller').toHaveScrollbars()
+                        expect('.scrollgrid .fc-body:last-child .fc-scroller').toHaveScrollbars()
                       })
                     })
                   })
@@ -209,7 +209,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                   it('should be really tall with no scrollbars', function() {
                     init('auto')
                     expect(heightElm.outerHeight()).toBeGreaterThan(1000) // pretty tall
-                    expect('.fc-scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
+                    expect('.scrollgrid .fc-body:last-child .fc-scroller').not.toHaveScrollbars()
                   })
                 })
               })
@@ -258,7 +258,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                         it('should be the correct height, with scrollbars and no filler hr', function() {
                           init(testInfo.height)
                           expectHeight(600)
-                          expect($('.fc-scrollgrid .fc-body:last-child .fc-scroller')).toHaveScrollbars()
+                          expect($('.scrollgrid .fc-body:last-child .fc-scroller')).toHaveScrollbars()
                           expect($('.fc-time-grid > hr')).not.toBeVisible()
                         })
                       })
@@ -273,7 +273,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                     it('should be really short with no scrollbars nor horizontal rule', function() {
                       init('auto')
                       expect(heightElm.outerHeight()).toBeLessThan(500) // pretty short
-                      expect($('.fc-scrollgrid .fc-body:last-child .fc-scroller')).not.toHaveScrollbars()
+                      expect($('.scrollgrid .fc-body:last-child .fc-scroller')).not.toHaveScrollbars()
                       expect($('.fc-time-grid > hr')).not.toBeVisible()
                     })
                   })
@@ -286,7 +286,7 @@ import { getFirstDateEl } from '../lib/ViewUtils'
                     it('should be really tall with no scrollbars nor horizontal rule', function() {
                       init('auto')
                       expect(heightElm.outerHeight()).toBeGreaterThan(900) // pretty tall
-                      expect($('.fc-scrollgrid .fc-body:last-child .fc-scroller')).not.toHaveScrollbars()
+                      expect($('.scrollgrid .fc-body:last-child .fc-scroller')).not.toHaveScrollbars()
                       expect($('.fc-time-grid > hr')).not.toBeVisible()
                     })
                   })

+ 1 - 1
packages/__tests__/src/legacy/refetchEvents.js

@@ -23,7 +23,7 @@ describe('refetchEvents', function() {
           }, 100)
         },
         _eventsPositioned: function() {
-          var scrollEl = $('.fc-scrollgrid .fc-body:last-child .fc-scroller')
+          var scrollEl = $('.scrollgrid .fc-body:last-child .fc-scroller')
           renderCalls++
           if (renderCalls === 1) {
             setTimeout(function() {

+ 2 - 2
packages/__tests__/src/legacy/scrollTime.js

@@ -11,7 +11,7 @@ describe('scrollTime', function() {
     })
     var slotCell = $('.fc-slats tr:eq(4)') // 2am slot
     var slotTop = slotCell.position().top
-    var scrollContainer = $('.fc-scrollgrid .fc-body:last-child .fc-scroller')
+    var scrollContainer = $('.scrollgrid .fc-body:last-child .fc-scroller')
     var scrollTop = scrollContainer.scrollTop()
     var diff = Math.abs(slotTop - scrollTop)
     expect(slotTop).toBeGreaterThan(0)
@@ -26,7 +26,7 @@ describe('scrollTime', function() {
     })
     var slotCell = $('.fc-slats tr:eq(4)') // 2am slot
     var slotTop = slotCell.position().top
-    var scrollContainer = $('.fc-scrollgrid .fc-body:last-child .fc-scroller')
+    var scrollContainer = $('.scrollgrid .fc-body:last-child .fc-scroller')
     var scrollTop = scrollContainer.scrollTop()
     var diff = Math.abs(slotTop - scrollTop)
     expect(slotTop).toBeGreaterThan(0)

+ 2 - 2
packages/__tests__/src/legacy/select-method.js

@@ -107,7 +107,7 @@ describe('select method', function() {
               initCalendar(options)
               currentCalendar.select('2014-05-26T06:00:00', '2014-05-26T08:00:00')
               expect($('.fc-highlight')).toBeVisible()
-              var slotAreaTop = $('.fc-scrollgrid .fc-body:last-child .fc-scroller').offset().top
+              var slotAreaTop = $('.scrollgrid .fc-body:last-child .fc-scroller').offset().top
               var overlayTop = $('.fc-highlight').offset().top
               expect(overlayTop).toBeGreaterThan(slotAreaTop)
             })
@@ -142,7 +142,7 @@ describe('select method', function() {
               initCalendar(options)
               currentCalendar.select('2014-05-26', '2014-05-28')
               expect($('.fc-highlight')).toBeVisible()
-              var slotAreaTop = $('.fc-scrollgrid .fc-body:last-child .fc-scroller').offset().top
+              var slotAreaTop = $('.scrollgrid .fc-body:last-child .fc-scroller').offset().top
               var overlayTop = $('.fc-highlight').offset().top
               expect(overlayTop).toBeLessThan(slotAreaTop)
             })

+ 1 - 1
packages/__tests__/src/lib/TimeGridViewUtils.js

@@ -1,6 +1,6 @@
 
 export function getTimeGridScroller() { // returns DOM node
-  return document.querySelector('.fc-scrollgrid .fc-body:last-child .fc-scroller')
+  return document.querySelector('.scrollgrid .fc-body:last-child .fc-scroller')
 }
 
 export function allDaySlotDisplayed() {

+ 1 - 1
packages/__tests__/src/view-render/DayGridRenderUtils.js

@@ -116,7 +116,7 @@ export function getDayGridRowDayElAtIndex(index) {
 }
 
 export function getHeaderTopEls() {
-  return $('.fc-scrollgrid .fc-head th')
+  return $('.scrollgrid .fc-head th')
 }
 
 export function getBackgroundEventElsResizerEls() {

+ 1 - 1
packages/__tests__/src/view-render/scrollToTime.js

@@ -11,7 +11,7 @@ describe('scrollToTime method', function() {
     // NOTE: c&p'd from scrollTime tests
     var slotCell = $('.fc-slats tr:eq(4)') // 2am slot
     var slotTop = slotCell.position().top
-    var scrollContainer = $('.fc-scrollgrid .fc-body:last-child .fc-scroller')
+    var scrollContainer = $('.scrollgrid .fc-body:last-child .fc-scroller')
     var scrollTop = scrollContainer.scrollTop()
     var diff = Math.abs(slotTop - scrollTop)
     expect(slotTop).toBeGreaterThan(0)

+ 1 - 1
packages/core/src/common/TableDateCell.tsx

@@ -67,7 +67,7 @@ export default class TableDateCell extends BaseComponent<TableDateCellProps> {
       __assign(attrs, props.otherAttrs)
     }
 
-    return (
+    return ( // TODO: add a key somehow (date+resource) ???
       <th class={classNames.join(' ')} {...attrs}>
         {isDateValid &&
           <GotoAnchor

+ 1 - 1
packages/core/src/styles/_scrollgrid.scss

@@ -81,7 +81,7 @@
 }
 
 // for FF, which doesn't expand a 100% div within a table cell. use absolute positioning
-.fc-scrollgrid-vgrow-cell-hack {
+.scrollgrid-vgrow-cell-hack {
   td, th {
     position: relative;
 

+ 6 - 1
packages/daygrid/src/TableEvents.ts

@@ -7,7 +7,8 @@ import {
   ComponentContext,
   sortEventSegs,
   subrenderer,
-  renderVNodes
+  renderVNodes,
+  isArraysEqual
 } from '@fullcalendar/core'
 import CellEvents from './CellEvents'
 
@@ -60,6 +61,10 @@ export default class TableEvents extends CellEvents<TableEventsProps> {
 
 }
 
+TableEvents.addPropsEquality({
+  rowEls: isArraysEqual
+})
+
 
 // Renders the given foreground event segments onto the grid
 function attachSegs({ segs, rowEls, colCnt, renderIntro }: TableEventsProps, context: ComponentContext) {

+ 6 - 1
packages/daygrid/src/TableFills.tsx

@@ -9,7 +9,8 @@ import {
   BaseFillRendererProps,
   subrenderer,
   renderVNodes,
-  h
+  h,
+  isArraysEqual
 } from '@fullcalendar/core'
 
 
@@ -58,6 +59,10 @@ export default class TableFills extends FillRenderer<TableFillsProps> {
 
 }
 
+TableFills.addPropsEquality({
+  rowEls: isArraysEqual
+})
+
 
 function attachSegs(props: TableFillsProps, context: ComponentContext) {
   let { segs, rowEls } = props