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

tests for event data fetching, with new date range logix

Adam Shaw 9 лет назад
Родитель
Сommit
361a30e6ed

+ 33 - 0
tests/automated-better/event-data/events-function.js

@@ -0,0 +1,33 @@
+
+describe('events as a function', function() {
+	pushOptions({
+		defaultView: 'month'
+	});
+
+	it('requests the correct dates when days at the start/end of the month are hidden', function(done) {
+		initCalendar({
+			currentView: 'month',
+			defaultDate: '2013-06-01', // June 2013 has first day as Saturday, and last as Sunday!
+			weekends: false,
+			fixedWeekCount: false,
+			events: function(start, end, timezone, callback) {
+				expect(start).toEqualMoment('2013-06-03');
+				expect(end).toEqualMoment('2013-06-29');
+				done();
+			}
+		});
+	});
+
+	it('does not request dates excluded by disableNonCurrentDates', function(done) {
+		initCalendar({
+			currentView: 'month',
+			defaultDate: '2013-06-01',
+			disableNonCurrentDates: true,
+			events: function(start, end, timezone, callback) {
+				expect(start).toEqualMoment('2013-06-01');
+				expect(end).toEqualMoment('2013-07-01');
+				done();
+			}
+		});
+	});
+});

+ 0 - 14
tests/automated/events-function.js

@@ -139,18 +139,4 @@ describe('events as a function', function() {
 		$('#cal').fullCalendar(options);
 	});
 
-	it('requests the correct dates when days at the start/end of the month are hidden', function(done) {
-		options.currentView = 'month';
-		options.defaultDate = '2013-06-01'; // June 2013 has first day as Saturday, and last as Sunday!
-		options.weekends = false;
-		options.height = 'auto';
-		options.fixedWeekCount = false;
-		options.events = function(start, end, timezone, callback) {
-			expect(start).toEqualMoment('2013-06-03');
-			expect(end).toEqualMoment('2013-06-29');
-			done();
-		};
-		$('#cal').fullCalendar(options);
-	});
-
 });