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

updated tests/legacy/{addEventSource,allDaySlot,AllDayText,BusinessHours,columnFormat,DayGrid-events}.js

kyle roux 8 лет назад
Родитель
Сommit
6ff19d26f0

+ 62 - 37
tests/legacy/DayGrid-events.js

@@ -1,12 +1,7 @@
 describe('DayGrid event rendering', function() {
-	var options;
-
-	beforeEach(function() {
-		affix('#cal');
-		options = {
-			defaultDate: '2014-08-01', // 2014-07-27 - 2014-10-07 (excl)
-			defaultView: 'month'
-		};
+	pushOptions({
+		defaultDate: '2014-08-01', // 2014-07-27 - 2014-10-07 (excl)
+		defaultView: 'month'
 	});
 
 	describe('when LTR', function() {
@@ -17,155 +12,183 @@ describe('DayGrid event rendering', function() {
 	});
 
 	function initMonthTesting(isRTL) {
-
 		it('correctly renders an event starting before view\'s start', function() {
+			var options = {};
 			options.events = [
 				{ start: '2014-07-26', end: '2014-07-30' }
 			];
-			testSeg({
+
+			var testSegOptions = {
 				firstCol: 0,
 				lastCol: 2,
 				isStart: false,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event starting at view\'s start', function() {
+			var options = {};
 			options.events = [
 				{ start: '2014-07-27', end: '2014-07-29' }
 			];
-			testSeg({
+
+			var testSegOptions = {
 				firstCol: 0,
 				lastCol: 1,
 				isStart: true,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event starting after view\'s start', function() {
+			var options = {};
 			options.events = [
 				{ start: '2014-08-01', end: '2014-08-02' }
 			];
-			testSeg({
+
+			var testSegOptions = {
 				firstCol: 5,
 				lastCol: 5,
 				isStart: true,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event starting on a hidden day at week start', function() {
+			var options = {};
 			options.weekends = false;
 			options.events = [
 				{ start: '2014-07-27', end: '2014-07-30' }
 			];
-			testSeg({
+
+			var testSegOptions = {
 				firstCol: 0,
 				lastCol: 1,
 				isStart: false,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event starting on a hidden day in middle of week', function() {
+			var options = {};
 			options.hiddenDays = [ 2 ]; // hide Tues
 			options.events = [
 				{ start: '2014-07-29', end: '2014-08-01' }
 			];
-			testSeg({
+
+			var testSegOptions = {
 				firstCol: 2,
 				lastCol: 3,
 				isStart: false,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event ending before view\'s end', function() {
+			var options = {};
 			options.events = [
 				{ start: '2014-09-02', end: '2014-09-05' }
 			];
-			testSeg({
+			var testSegOptions = {
 				row: 5,
 				firstCol: 2,
 				lastCol: 4,
 				isStart: true,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions)
 		});
 
 		it('correctly renders an event ending at view\'s end', function() {
+			var options = {};
 			options.events = [
 				{ start: '2014-09-04', end: '2014-09-07' }
 			];
-			testSeg({
+
+			var testSegOptions = {
 				row: 5,
 				firstCol: 4,
 				lastCol: 6,
 				isStart: true,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event ending after view\'s end', function() {
+			var options = {};
 			options.events = [
 				{ start: '2014-09-04', end: '2014-09-08' }
 			];
-			testSeg({
+			var testSegOptions = {
 				row: 5,
 				firstCol: 4,
 				lastCol: 6,
 				isStart: true,
 				isEnd: false
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event ending at a week\'s end', function() {
+			var options = {};
 			options.events = [
 				{ start: '2014-08-28', end: '2014-08-31' }
 			];
-			testSeg({
+			var testSegOptions = {
 				row: 4,
 				firstCol: 4,
 				lastCol: 6,
 				isStart: true,
 				isEnd: true
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event ending on a hidden day at week end', function() {
+			var options = {};
 			options.weekends = false;
 			options.events = [
 				{ start: '2014-07-30', end: '2014-08-03' }
 			];
-			testSeg({
+			var testSegOptions = {
 				firstCol: 2,
 				lastCol: 4,
 				isStart: true,
 				isEnd: false
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
 		it('correctly renders an event ending on a hidden day in middle of week', function() {
+			var options = {};
 			options.hiddenDays = [ 4 ]; // Thurs
 			options.events = [
 				{ start: '2014-07-28', end: '2014-08-01' }
 			];
-			testSeg({
+			var testSegOptions = {
 				firstCol: 1,
 				lastCol: 3,
 				isStart: true,
 				isEnd: false
-			});
+			};
+			testSeg(options, testSegOptions);
 		});
 
-		function testSeg(testSegOptions) {
-			options.isRTL = isRTL;
-			$('#cal').fullCalendar(options);
+		function testSeg(calendarOptions, testSegOptions) {
+			calendarOptions.isRTL = isRTL;
+			initCalendar(calendarOptions);
 			directionallyTestSeg(testSegOptions, isRTL);
 		}
 	}
 
 	it('rendering of events across weeks stays consistent', function() {
+		var options = {};
 		options.events = [
 			{
 				title: 'event1',
@@ -180,7 +203,7 @@ describe('DayGrid event rendering', function() {
 				className: 'event2'
 			}
 		];
-		$('#cal').fullCalendar(options);
+		initCalendar(options);
 		var row0 = $('.fc-day-grid .fc-row:eq(0)');
 		var row0event1 = row0.find('.event1');
 		var row0event2 = row0.find('.event2');
@@ -192,22 +215,24 @@ describe('DayGrid event rendering', function() {
 	});
 
 	it('renders an event with no url with no <a> href', function() {
+		var options = {};
 		options.events = [ {
 			title: 'event1',
 			start: '2014-08-01'
 		} ];
-		$('#cal').fullCalendar(options);
+		initCalendar(options);
 		var seg = $('.fc-event');
 		expect(seg).not.toHaveAttr('href');
 	});
 
 	it('renders an event with a url with an <a> href', function() {
+		var options = {};
 		options.events = [ {
 			title: 'event1',
 			start: '2014-08-01',
 			url: 'http://google.com/'
 		} ];
-		$('#cal').fullCalendar(options);
+		initCalendar(options);
 		var seg = $('.fc-event');
 		expect(seg).toHaveAttr('href');
 	});

+ 14 - 18
tests/legacy/addEventSource.js

@@ -1,24 +1,20 @@
-describe('addEventSource', function() {
-
-	var options;
+describe('addEventSource', function() {	
 	var eventArray = [
 		{ id: 0, title: 'event zero', start: '2014-06-24', className: 'event-zero' },
 		{ id: 1, title: 'event one', start: '2014-06-24', className: 'event-non-zero event-one' },
 		{ id: 2, title: 'event two', start: '2014-06-24', className: 'event-non-zero event-two' }
 	];
 
-	beforeEach(function() {
-		affix('#cal');
-		options = {
-			defaultDate: '2014-06-24',
-			defaultView: 'month'
-		};
+	pushOptions({
+		defaultDate: '2014-06-24',
+		defaultView: 'month'
 	});
 
+
 	it('correctly adds an array source', function(done) {
 		go(
 			function() {
-				$('#cal').fullCalendar('addEventSource', eventArray);
+				currentCalendar.addEventSource(eventArray);
 			},
 			null,
 			done
@@ -28,7 +24,7 @@ describe('addEventSource', function() {
 	it('correctly adds a function source', function(done) {
 		go(
 			function() {
-				$('#cal').fullCalendar('addEventSource', function(start, end, timezone, callback) {
+				currentCalendar.addEventSource(function(start, end, timezone, callback) {
 					callback(eventArray);
 				});
 			},
@@ -40,7 +36,7 @@ describe('addEventSource', function() {
 	it('correctly adds an extended array source', function(done) {
 		go(
 			function() {
-				$('#cal').fullCalendar('addEventSource', {
+				currentCalendar.addEventSource({
 					className: 'arraysource',
 					events: eventArray
 				});
@@ -55,7 +51,7 @@ describe('addEventSource', function() {
 	it('correctly adds an extended array source', function(done) {
 		go(
 			function() {
-				$('#cal').fullCalendar('addEventSource', {
+				currentCalendar.addEventSource({
 					className: 'funcsource',
 					events: function(start, end, timezone, callback) {
 						callback(eventArray);
@@ -72,7 +68,7 @@ describe('addEventSource', function() {
 
 	function go(addFunc, extraTestFunc, doneFunc) {
 		var callCnt = 0;
-
+		var options = {};
 		options.eventAfterAllRender = function() {
 			callCnt++;
 			if (callCnt == 2) { // once for initial render. second time for addEventSource
@@ -84,8 +80,8 @@ describe('addEventSource', function() {
 				}
 
 				// move the calendar back out of view, then back in (for issue 2191)
-				$('#cal').fullCalendar('next');
-				$('#cal').fullCalendar('prev');
+				currentCalendar.next();
+				currentCalendar.prev();
 
 				// otherwise, prev/next would be cancelled out by doneFunc's calendar destroy
 				setTimeout(function() {
@@ -100,14 +96,14 @@ describe('addEventSource', function() {
 			}
 		};
 
-		$('#cal').fullCalendar(options);
+		initCalendar(options);
 		addFunc();
 	}
 
 	// Checks to make sure all events have been rendered and that the calendar
 	// has internal info on all the events.
 	function checkAllEvents() {
-		expect($('#cal').fullCalendar('clientEvents').length).toEqual(3);
+		expect(currentCalendar.clientEvents().length).toEqual(3);
 		expect($('.fc-event').length).toEqual(3);
 	}
 

+ 6 - 10
tests/legacy/allDaySlot.js

@@ -1,17 +1,13 @@
 
 describe('allDaySlots', function() {
 
-	beforeEach(function() {
-		affix('#cal');
-	});
-
 	describe('when allDaySlots is not set', function() {
 		describe('in agendaWeek', function() {
 			it('should default to having an allDaySlots table', function() {
 				var options = {
 					defaultView: 'agendaWeek'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDaySlotCount = $('.fc-day-grid').length;
 				expect(allDaySlotCount).toEqual(1);
 			});
@@ -21,7 +17,7 @@ describe('allDaySlots', function() {
 				var options = {
 					defaultView: 'agendaDay'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDaySlotCount = $('.fc-day-grid').length;
 				expect(allDaySlotCount).toEqual(1);
 			});
@@ -35,7 +31,7 @@ describe('allDaySlots', function() {
 					defaultView: 'agendaWeek',
 					allDaySlot: true
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDaySlotCount = $('.fc-day-grid').length;
 				expect(allDaySlotCount).toEqual(1);
 			});
@@ -46,7 +42,7 @@ describe('allDaySlots', function() {
 					defaultView: 'agendaDay',
 					allDaySlot: true
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDaySlotCount = $('.fc-day-grid').length;
 				expect(allDaySlotCount).toEqual(1);
 			});
@@ -60,7 +56,7 @@ describe('allDaySlots', function() {
 					defaultView: 'agendaWeek',
 					allDaySlot: false
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDaySlotCount = $('.fc-day-grid').length;
 				expect(allDaySlotCount).toEqual(0);
 			});
@@ -71,7 +67,7 @@ describe('allDaySlots', function() {
 					defaultView: 'agendaDay',
 					allDaySlot: false
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDaySlotCount = $('.fc-day-grid').length;
 				expect(allDaySlotCount).toEqual(0);
 			});

+ 8 - 12
tests/legacy/allDayText.js

@@ -1,17 +1,13 @@
 
 describe('allDayText', function() {
 
-	beforeEach(function() {
-		affix('#cal');
-	});
-
 	describe('when allDaySlots is not set', function() {
 		describe('in agendaWeek', function() {
 			it('should default allDayText to using \'all-day\'', function() {
 				var options = {
 					defaultView: 'agendaWeek'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('all-day');
 			});
@@ -21,7 +17,7 @@ describe('allDayText', function() {
 				var options = {
 					defaultView: 'agendaDay'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('all-day');
 			});
@@ -35,7 +31,7 @@ describe('allDayText', function() {
 					defaultView: 'agendaWeek',
 					allDaySlot: true
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('all-day');
 			});
@@ -46,7 +42,7 @@ describe('allDayText', function() {
 					defaultView: 'agendaDay',
 					allDaySlot: true
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('all-day');
 			});
@@ -61,7 +57,7 @@ describe('allDayText', function() {
 					allDaySlot: true,
 					locale: 'pt-br'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('dia inteiro');
 			});
@@ -73,7 +69,7 @@ describe('allDayText', function() {
 					allDaySlot: true,
 					locale: 'pt-br'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('dia inteiro');
 			});
@@ -88,7 +84,7 @@ describe('allDayText', function() {
 					allDaySlot: true,
 					allDayText: 'axis-phosy'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('axis-phosy');
 			});
@@ -99,7 +95,7 @@ describe('allDayText', function() {
 					defaultView: 'agendaDay',
 					allDayText: 'axis-phosy'
 				};
-				$('#cal').fullCalendar(options);
+				initCalendar(options);
 				var allDayText = $('.fc-day-grid > .fc-row > .fc-bg .fc-axis').text();
 				expect(allDayText).toEqual('axis-phosy');
 			});

+ 17 - 23
tests/legacy/businessHours.js

@@ -1,23 +1,17 @@
 // most other businessHours tests are in background-events.js
 
-describe('businessHours', function() {
-	var options;
-
-	beforeEach(function() {
-		options = {
-			defaultDate: '2014-11-25',
-			defaultView: 'month',
-			businessHours: true
-		};
-		affix('#cal');
-	});
-
+describe('businessHours', function() {	
+	pushOptions({
+		defaultDate: '2014-11-25',
+		defaultView: 'month',
+		businessHours: true
+	});			
 
 	it('doesn\'t break when starting out in a larger month time range', function() {
-		$('#cal').fullCalendar(options); // start out in the month range
-		$('#cal').fullCalendar('changeView', 'agendaWeek');
-		$('#cal').fullCalendar('next'); // move out of the original month range...
-		$('#cal').fullCalendar('next'); // ... out. should render correctly.
+		initCalendar(); // start out in the month range
+		currentCalendar.changeView('agendaWeek');
+		currentCalendar.next(); // move out of the original month range...
+		currentCalendar.next(); // ... out. should render correctly.
 
 		// whole days
 		expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // each multi-day stretch is one element
@@ -51,7 +45,7 @@ describe('businessHours', function() {
 		[ 'agendaWeek', 'month' ].forEach(function(viewName) {
 
 			it('allows dynamic turning on', function() {
-				$('#cal').fullCalendar({
+				initCalendar({
 					defaultView: viewName,
 					businessHours: false
 				});
@@ -59,14 +53,14 @@ describe('businessHours', function() {
 				expect(rootEl.length).toBe(1);
 
 				expect(queryNonBusinessSegs().length).toBe(0);
-				$('#cal').fullCalendar('option', 'businessHours', true);
+				currentCalendar.option('businessHours', true);
 				expect(queryNonBusinessSegs().length).toBeGreaterThan(0);
 
 				expect($('.fc-view > *:first')[0]).toBe(rootEl[0]); // same element. didn't completely rerender
 			});
 
 			it('allows dynamic turning off', function() {
-				$('#cal').fullCalendar({
+				initCalendar({
 					defaultView: viewName,
 					businessHours: true
 				});
@@ -74,7 +68,7 @@ describe('businessHours', function() {
 				expect(rootEl.length).toBe(1);
 
 				expect(queryNonBusinessSegs().length).toBeGreaterThan(0);
-				$('#cal').fullCalendar('option', 'businessHours', false);
+				currentCalendar.option('businessHours', false);
 				expect(queryNonBusinessSegs().length).toBe(0);
 
 				expect($('.fc-view > *:first')[0]).toBe(rootEl[0]); // same element. didn't completely rerender
@@ -86,7 +80,7 @@ describe('businessHours', function() {
 	describe('for multiple day-of-week definitions', function() {
 
 		it('rendes two day-of-week groups', function() {
-			$('#cal').fullCalendar({
+			initCalendar({
 				defaultDate: '2014-12-07',
 				defaultView: 'agendaWeek',
 				businessHours: [
@@ -128,7 +122,7 @@ describe('businessHours', function() {
 		});
 
 		it('wont\'t process businessHour items that omit dow', function() {
-			$('#cal').fullCalendar({
+			initCalendar({
 				defaultDate: '2014-12-07',
 				defaultView: 'agendaWeek',
 				businessHours: [
@@ -169,7 +163,7 @@ describe('businessHours', function() {
 
 
 	it('will grey-out a totally non-business-hour view', function() {
-		$('#cal').fullCalendar({
+		initCalendar({
 			defaultDate: '2016-07-23', // sat
 			defaultView: 'agendaDay',
 			businessHours: true

+ 25 - 33
tests/legacy/columnFormat.js

@@ -1,9 +1,6 @@
 
 describe('columnFormat', function() {
-    beforeEach(function() {
-        affix('#cal');
-    });
-
+    
     describe('when columnFormat is not set', function() {
 
         var viewWithFormat = [ { view: 'month', expected: 'Sun', selector: 'th.fc-day-header.fc-sun' },
@@ -13,18 +10,17 @@ describe('columnFormat', function() {
             { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' } ];
 
         beforeEach(function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 defaultDate: '2014-05-11'
             });
         });
 
-        it('should have default values', function() {
-            var cal = $('#cal');
+        it('should have default values', function() {            
 
             for (var i = 0; i <  viewWithFormat.length; i++) {
                 var crtView = viewWithFormat[i];
-                cal.fullCalendar('changeView', crtView.view);
-                expect(cal.find(crtView.selector).text()).toBe(crtView.expected);
+                currentCalendar.changeView(crtView.view);
+                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
             };
         });
     });
@@ -38,7 +34,7 @@ describe('columnFormat', function() {
             { view: 'agendaDay', expected: 'Sunday 5/11', selector: 'th.fc-widget-header.fc-sun' } ];
 
         beforeEach(function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 defaultDate: '2014-05-11',
                 views: {
                     month: { columnFormat: 'dddd' },
@@ -50,13 +46,12 @@ describe('columnFormat', function() {
             });
         });
 
-        it('should have the correct values', function() {
-            var cal = $('#cal');
+        it('should have the correct values', function() {            
 
             for (var i = 0; i <  viewWithFormat.length; i++) {
                 var crtView = viewWithFormat[i];
-                cal.fullCalendar('changeView', crtView.view);
-                expect(cal.find(crtView.selector).text()).toBe(crtView.expected);
+                currentCalendar.changeView(crtView.view);
+                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
             };
         });
     });
@@ -70,19 +65,18 @@ describe('columnFormat', function() {
             { view: 'agendaDay', expected: 'dimanche', selector: 'th.fc-widget-header.fc-sun' } ];
 
         beforeEach(function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 defaultDate: '2014-05-11',
                 locale: 'fr'
             });
         });
 
-        it('should have the translated dates', function() {
-            var cal = $('#cal');
+        it('should have the translated dates', function() {            
 
             for (var i = 0; i <  viewWithFormat.length; i++) {
                 var crtView = viewWithFormat[i];
-                cal.fullCalendar('changeView', crtView.view);
-                expect(cal.find(crtView.selector).text()).toBe(crtView.expected);
+                currentCalendar.changeView(crtView.view);
+                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
             };
         });
     });
@@ -96,19 +90,18 @@ describe('columnFormat', function() {
             { view: 'agendaDay', expected: 'Sunday', selector: 'th.fc-widget-header.fc-sun' } ];
 
         beforeEach(function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 defaultDate: '2014-05-11',
                 locale: 'en-gb'
             });
         });
 
-        it('should have the translated dates', function() {
-            var cal = $('#cal');
+        it('should have the translated dates', function() {            
 
             for (var i = 0; i <  viewWithFormat.length; i++) {
                 var crtView = viewWithFormat[i];
-                cal.fullCalendar('changeView', crtView.view);
-                expect(cal.find(crtView.selector).text()).toBe(crtView.expected);
+                currentCalendar.changeView(crtView.view);
+                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
             };
         });
     });
@@ -122,19 +115,18 @@ describe('columnFormat', function() {
             { view: 'agendaDay', expected: '일요일', selector: 'th.fc-widget-header.fc-sun' } ];
 
         beforeEach(function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 defaultDate: '2014-05-11',
                 locale: 'ko'
             });
         });
 
-        it('should have the translated dates and columnFormat should be computed differently', function() {
-            var cal = $('#cal');
+        it('should have the translated dates and columnFormat should be computed differently', function() {            
 
             for (var i = 0; i <  viewWithFormat.length; i++) {
                 var crtView = viewWithFormat[i];
-                cal.fullCalendar('changeView', crtView.view);
-                expect(cal.find(crtView.selector).text()).toBe(crtView.expected);
+                currentCalendar.changeView(crtView.view);
+                expect(currentCalendar.el.find(crtView.selector).text()).toBe(crtView.expected);
             };
         });
     });
@@ -142,7 +134,7 @@ describe('columnFormat', function() {
     describe('using custom views', function() {
 
         it('multi-year default only displays day-of-week', function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 views: {
                     multiYear: {
                         type: 'basic',
@@ -156,7 +148,7 @@ describe('columnFormat', function() {
         });
 
         it('multi-month default only displays day-of-week', function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 views: {
                     multiMonth: {
                         type: 'basic',
@@ -170,7 +162,7 @@ describe('columnFormat', function() {
         });
 
         it('multi-week default only displays day-of-week', function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 views: {
                     multiWeek: {
                         type: 'basic',
@@ -184,7 +176,7 @@ describe('columnFormat', function() {
         });
 
         it('multi-day default displays short full date', function() {
-            $('#cal').fullCalendar({
+            initCalendar({
                 views: {
                     multiDay: {
                         type: 'basic',