diff --git a/src/common/TimeGrid.events.js b/src/common/TimeGrid.events.js index cb6080f..d336dbb 100644 --- a/src/common/TimeGrid.events.js +++ b/src/common/TimeGrid.events.js @@ -145,7 +145,14 @@ $.extend(TimeGrid.prototype, { } return '' + '
' + (timeText ? diff --git a/tests/automated/DayGrid-events.js b/tests/automated/DayGrid-events.js index fcfdf8a..5cda9f7 100644 --- a/tests/automated/DayGrid-events.js +++ b/tests/automated/DayGrid-events.js @@ -34,4 +34,25 @@ describe('DayGrid event rendering', function() { expect(row0event1.offset().top).toBeLessThan(row0event2.offset().top); expect(row1event1.offset().top).toBeLessThan(row1event2.offset().top); }); + + it('renders an event with no url with no href', function() { + options.events = [ { + title: 'event1', + start: '2014-08-01' + } ]; + $('#cal').fullCalendar(options); + var seg = $('.fc-event'); + expect(seg).not.toHaveAttr('href'); + }); + + it('renders an event with a url with an href', function() { + options.events = [ { + title: 'event1', + start: '2014-08-01', + url: 'http://google.com/' + } ]; + $('#cal').fullCalendar(options); + var seg = $('.fc-event'); + expect(seg).toHaveAttr('href'); + }); }); \ No newline at end of file diff --git a/tests/automated/TimeGrid-events.js b/tests/automated/TimeGrid-events.js index 47a4310..2fb4f93 100644 --- a/tests/automated/TimeGrid-events.js +++ b/tests/automated/TimeGrid-events.js @@ -46,4 +46,25 @@ describe('TimeGrid event rendering', function() { expect(seg2.find('.fc-time')).not.toBeInDOM(); }); + it('renders an event with no url with no href', function() { + options.events = [ { + title: 'event1', + start: '2014-08-18T02:00:00' + } ]; + $('#cal').fullCalendar(options); + var seg = $('.fc-event'); + expect(seg).not.toHaveAttr('href'); + }); + + it('renders an event with a url with an href', function() { + options.events = [ { + title: 'event1', + start: '2014-08-18T02:00:00', + url: 'http://google.com/' + } ]; + $('#cal').fullCalendar(options); + var seg = $('.fc-event'); + expect(seg).toHaveAttr('href'); + }); + }); \ No newline at end of file