From b7f96ba79a4db010317fb00e4407c99f69bc7acc Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Sat, 31 Aug 2013 21:05:25 -0700 Subject: [PATCH] make slot_event_overlap test even better --- tests/slot_event_overlap.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/slot_event_overlap.html b/tests/slot_event_overlap.html index 15c7186..0e586c6 100644 --- a/tests/slot_event_overlap.html +++ b/tests/slot_event_overlap.html @@ -98,8 +98,18 @@ } function _testOverlap(el, allowOverlap, isRTL) { + var events = el.find('.fc-event'); + var cell = el.find('.fc-slot0 td'); + var cellLeft = Math.round(cell.offset().left); + var cellWidth = Math.round(cell.outerWidth()); + + if (!events.length) { // json events probably couldn't load + console.log('need to run this from a real web server'); + return false; + } + for (var i=0; i cellLeft + cellWidth) { + console.log('event is out of bounds', event[0]); + return false; + } + + if (width < 10 || height < 10) { + console.log('event is suprisingly small', event[0]); + return false; + } + if (allowOverlap) { width /= 2; // make sure nothing overlaps the first half of the event if (isRTL) { @@ -160,6 +180,8 @@ return true; } + // TODO: add tests for viewing events in week-mode also +