ソースを参照

test for dynamic options not causing event refetch

Adam Shaw 8 年 前
コミット
1c244b1ca5
1 ファイル変更24 行追加0 行削除
  1. 24 0
      tests/event-data/dynamic-options.js

+ 24 - 0
tests/event-data/dynamic-options.js

@@ -0,0 +1,24 @@
+
+describe('setting option dynamically', function() {
+
+	it('does not cause refetch of events', function(done) {
+		var fetchCnt = 0;
+
+		initCalendar({
+			defaultView: 'month',
+			events: function(start, end, timezone, callback) {
+				fetchCnt++;
+				callback([]);
+			}
+		});
+
+		expect(fetchCnt).toBe(1);
+
+		currentCalendar.option('selectable', true);
+
+		setTimeout(function() { // in case async
+			expect(fetchCnt).toBe(1);
+			done();
+		}, 0);
+	});
+});