mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-06-27 16:10:13 +08:00
issue 2263, and tests
This commit is contained in:
@@ -145,7 +145,14 @@ $.extend(TimeGrid.prototype, {
|
||||
}
|
||||
|
||||
return '<a class="' + classes.join(' ') + '"' +
|
||||
(skinCss ? ' style="' + skinCss + '"' : '') +
|
||||
(event.url ?
|
||||
' href="' + htmlEscape(event.url) + '"' :
|
||||
''
|
||||
) +
|
||||
(skinCss ?
|
||||
' style="' + skinCss + '"' :
|
||||
''
|
||||
) +
|
||||
'>' +
|
||||
'<div class="fc-content">' +
|
||||
(timeText ?
|
||||
|
||||
@@ -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 <a> 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 <a> 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');
|
||||
});
|
||||
});
|
||||
@@ -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 <a> 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 <a> 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');
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user