Explorar o código

tests for accepting person email as google calendar ID

Adam Shaw %!s(int64=11) %!d(string=hai) anos
pai
achega
8788d58ff0
Modificáronse 1 ficheiros con 22 adicións e 0 borrados
  1. 22 0
      tests/automated/events-gcal.js

+ 22 - 0
tests/automated/events-gcal.js

@@ -205,6 +205,28 @@ describe('Google Calendar plugin', function() {
 		$('#cal').fullCalendar(options);
 	});
 
+	it('detects a gcal when `events` is the actual calendar ID, person gmail', function(done) {
+		options.googleCalendarApiKey = API_KEY;
+		options.events = '[email protected]';
+		options.eventAfterAllRender = function() {
+			expect(currentWarnArgs.length).toBe(2);
+			expect(typeof currentWarnArgs[1]).toBe('object'); // sent the request to google, but not-found warning
+			done();
+		};
+		$('#cal').fullCalendar(options);
+	});
+
+	it('detects a gcal when `events` is the actual calendar ID, person googlemail', function(done) {
+		options.googleCalendarApiKey = API_KEY;
+		options.events = '[email protected]';
+		options.eventAfterAllRender = function() {
+			expect(currentWarnArgs.length).toBe(2);
+			expect(typeof currentWarnArgs[1]).toBe('object'); // sent the request to google, but not-found warning
+			done();
+		};
+		$('#cal').fullCalendar(options);
+	});
+
 	it('works with requesting an HTTP V1 API feed URL', function(done) {
 		options.googleCalendarApiKey = API_KEY;
 		options.events = 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic';