Jelajahi Sumber

adjust tests (except event resize) to be touch-agnostic

Adam Shaw 9 tahun lalu
induk
melakukan
79fd918d5e

+ 0 - 3
tests/automated/dayClick.js

@@ -141,9 +141,6 @@ describe('dayClick', function() {
 	});
 
 	describe('when touch', function() {
-		beforeEach(function() {
-			options.isTouch = true;
-		});
 
 		it('fires correctly when simulated short drag on a cell', function(done) {
 			options.dayClick = function(date, jsEvent, view) {

+ 5 - 11
tests/automated/event-dnd.js

@@ -5,7 +5,8 @@ describe('eventDrop', function() {
 		options = {
 			defaultDate: '2014-06-11',
 			editable: true,
-			dragScroll: false
+			dragScroll: false,
+			longPressDelay: 100
 		};
 		affix('#cal');
 	});
@@ -19,13 +20,11 @@ describe('eventDrop', function() {
 			options.defaultView = 'month';
 		});
 
+		// TODO: test that event's dragged via touch that don't wait long enough for longPressDelay
+		// SHOULD NOT drag
+
 		[ false, true ].forEach(function(isTouch) {
 			describe('with ' + (isTouch ? 'touch' : 'mouse'), function() {
-				beforeEach(function() {
-					options.isTouch = isTouch;
-					options.longPressDelay = isTouch ? 100 : 0;
-				});
-
 				describe('when dragging an all-day event to another day', function() {
 					it('should be given correct arguments, with whole-day delta', function(done) {
 
@@ -152,11 +151,6 @@ describe('eventDrop', function() {
 
 		[ false, true ].forEach(function(isTouch) {
 			describe('with ' + (isTouch ? 'touch' : 'mouse'), function() {
-				beforeEach(function() {
-					options.isTouch = isTouch;
-					options.longPressDelay = isTouch ? 100 : 0;
-				});
-
 				describe('when dragging a timed event to another time on a different day', function() {
 					it('should be given correct arguments and delta with days/time', function(done) {
 						options.events = [ {

+ 0 - 1
tests/automated/eventClick.js

@@ -23,7 +23,6 @@ describe('eventClick', function() {
 	});
 
 	it('works in month view via touch', function(done) {
-		options.isTouch = true;
 		options.events = [
 			{ start: '2014-08-01', title: 'event1', className: 'event1' }
 		];

+ 2 - 5
tests/automated/select-callback.js

@@ -6,7 +6,8 @@ describe('select callback', function() {
 		affix('#cal');
 		options = {
 			defaultDate: '2014-05-25',
-			selectable: true
+			selectable: true,
+			longPressDelay: 100
 		};
 	});
 
@@ -45,8 +46,6 @@ describe('select callback', function() {
 					});
 				});
 				it('gets fired correctly when the user selects cells via touch', function(done) {
-					options.isTouch = true;
-					options.longPressDelay = 100;
 					options.select = function(start, end, jsEvent, view) {
 						expect(moment.isMoment(start)).toEqual(true);
 						expect(moment.isMoment(end)).toEqual(true);
@@ -162,8 +161,6 @@ describe('select callback', function() {
 						});
 					});
 					it('gets fired correctly when the user selects slots via touch', function(done) {
-						options.isTouch = true;
-						options.longPressDelay = 100;
 						options.select = function(start, end, jsEvent, view) {
 							expect(moment.isMoment(start)).toEqual(true);
 							expect(moment.isMoment(end)).toEqual(true);

+ 0 - 5
tests/lib/jasmine-ext.js

@@ -7,11 +7,6 @@ beforeEach(function() {
 	// (not the best place for this)
 	moment.suppressDeprecationWarnings = true;
 
-	// phantom JS falsely reports touch abilities, so explicitly disable.
-	// tests can override this on a per-calendar basis.
-	// (not the best place for this)
-	$.fullCalendar.isTouch = false;
-
 	// increase the default timeout
 	jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;