|
@@ -1,26 +1,18 @@
|
|
|
|
|
|
|
|
describe('background events', function() {
|
|
describe('background events', function() {
|
|
|
|
|
|
|
|
- // SEE ALSO: event-color.js
|
|
|
|
|
-
|
|
|
|
|
- var options;
|
|
|
|
|
-
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- options = {
|
|
|
|
|
- defaultDate: '2014-11-04',
|
|
|
|
|
- scrollTime: '00:00'
|
|
|
|
|
- };
|
|
|
|
|
- affix('#cal');
|
|
|
|
|
- $('#cal').width(1100);
|
|
|
|
|
|
|
+ // SEE ALSO: event-color.js
|
|
|
|
|
+ pushOptions({
|
|
|
|
|
+ defaultDate: '2014-11-04',
|
|
|
|
|
+ scrollTime: '00:00'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- describe('when in month view', function() {
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- options.defaultView = 'month';
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ describe('when in month view', function() {
|
|
|
|
|
+ pushOptions({defaultView:'month'});
|
|
|
|
|
|
|
|
describe('when LTR', function() {
|
|
describe('when LTR', function() {
|
|
|
it('render correctly on a single day', function(done) {
|
|
it('render correctly on a single day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
title: 'hi',
|
|
title: 'hi',
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -34,9 +26,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent .fc-resizer').length).toBe(0); // can't resize
|
|
expect($('.fc-bgevent .fc-resizer').length).toBe(0); // can't resize
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly spanning multiple weeks', function(done) {
|
|
it('render correctly spanning multiple weeks', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
title: 'hi',
|
|
title: 'hi',
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -52,9 +45,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly when two span on top of each other', function(done) {
|
|
it('render correctly when two span on top of each other', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [
|
|
options.events = [
|
|
|
{
|
|
{
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -75,10 +69,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
describe('when weekNumbers', function() {
|
|
describe('when weekNumbers', function() {
|
|
|
it('renders to right of week numbers', function(done) {
|
|
it('renders to right of week numbers', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.weekNumbers = true;
|
|
options.weekNumbers = true;
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-02',
|
|
start: '2014-11-02',
|
|
@@ -92,10 +87,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
it('renders "business hours" on whole days', function(done) {
|
|
it('renders "business hours" on whole days', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.businessHours = true;
|
|
options.businessHours = true;
|
|
|
options.eventAfterAllRender = function() {
|
|
options.eventAfterAllRender = function() {
|
|
|
setTimeout(function() { // no trigger when business hours renders. this will have to do.
|
|
setTimeout(function() { // no trigger when business hours renders. this will have to do.
|
|
@@ -103,15 +99,15 @@ describe('background events', function() {
|
|
|
done();
|
|
done();
|
|
|
}, 0)
|
|
}, 0)
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- describe('when RTL', function() {
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- options.isRTL = true;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ describe('when RTL', function() {
|
|
|
|
|
+ pushOptions({isRTL: true});
|
|
|
|
|
+
|
|
|
it('render correctly on a single day', function(done) {
|
|
it('render correctly on a single day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
title: 'hi',
|
|
title: 'hi',
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -124,9 +120,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly spanning multiple weeks', function(done) {
|
|
it('render correctly spanning multiple weeks', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
title: 'hi',
|
|
title: 'hi',
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -142,10 +139,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
describe('when weekNumbers', function() {
|
|
describe('when weekNumbers', function() {
|
|
|
it('renders to left of week numbers', function(done) {
|
|
it('renders to left of week numbers', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.weekNumbers = true;
|
|
options.weekNumbers = true;
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-02',
|
|
start: '2014-11-02',
|
|
@@ -159,7 +157,7 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
@@ -168,6 +166,7 @@ describe('background events', function() {
|
|
|
|
|
|
|
|
describe('when LTR', function() {
|
|
describe('when LTR', function() {
|
|
|
it('render correctly on a single day', function(done) {
|
|
it('render correctly on a single day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
title: 'hi',
|
|
title: 'hi',
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -190,9 +189,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly spanning multiple weeks', function(done) {
|
|
it('render correctly spanning multiple weeks', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
title: 'hi',
|
|
title: 'hi',
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -217,9 +217,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly when starts before start of month', function(done) {
|
|
it('render correctly when starts before start of month', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-10-24',
|
|
start: '2014-10-24',
|
|
|
end: '2014-11-06',
|
|
end: '2014-11-06',
|
|
@@ -239,9 +240,10 @@ describe('background events', function() {
|
|
|
|
|
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly when ends after end of month', function(done) {
|
|
it('render correctly when ends after end of month', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-27',
|
|
start: '2014-11-27',
|
|
|
end: '2014-12-08',
|
|
end: '2014-12-08',
|
|
@@ -261,9 +263,10 @@ describe('background events', function() {
|
|
|
|
|
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly with two related events, in reverse order', function(done) {
|
|
it('render correctly with two related events, in reverse order', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [
|
|
options.events = [
|
|
|
{
|
|
{
|
|
|
id: 'hi',
|
|
id: 'hi',
|
|
@@ -293,15 +296,15 @@ describe('background events', function() {
|
|
|
|
|
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- describe('when RTL', function() {
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- options.isRTL = true;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ describe('when RTL', function() {
|
|
|
|
|
+ pushOptions({isRTL:true});
|
|
|
|
|
+
|
|
|
it('render correctly on a single day', function(done) {
|
|
it('render correctly on a single day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
title: 'hi',
|
|
title: 'hi',
|
|
|
start: '2014-11-04',
|
|
start: '2014-11-04',
|
|
@@ -324,13 +327,14 @@ describe('background events', function() {
|
|
|
|
|
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
describe('when in month view', function() {
|
|
describe('when in month view', function() {
|
|
|
it('can be activated when rendering set on the source', function(done) {
|
|
it('can be activated when rendering set on the source', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.defaultView = 'month';
|
|
options.defaultView = 'month';
|
|
|
options.eventSources = [ {
|
|
options.eventSources = [ {
|
|
|
rendering: 'background',
|
|
rendering: 'background',
|
|
@@ -343,12 +347,13 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
describe('when in agenda view and timed event', function() {
|
|
describe('when in agenda view and timed event', function() {
|
|
|
it('can be activated when rendering set on the source', function(done) {
|
|
it('can be activated when rendering set on the source', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.defaultView = 'agendaWeek';
|
|
options.defaultView = 'agendaWeek';
|
|
|
options.eventSources = [ {
|
|
options.eventSources = [ {
|
|
|
rendering: 'background',
|
|
rendering: 'background',
|
|
@@ -361,18 +366,17 @@ describe('background events', function() {
|
|
|
expect($('.fc-event').length).toBe(0);
|
|
expect($('.fc-event').length).toBe(0);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- describe('when in agendaWeek view', function() {
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- options.defaultView = 'agendaWeek';
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ describe('when in agendaWeek view', function() {
|
|
|
|
|
+ pushOptions({defaultView:'agendaWeek'});
|
|
|
|
|
|
|
|
describe('when LTR', function() {
|
|
describe('when LTR', function() {
|
|
|
it('render correctly on one day', function(done) {
|
|
it('render correctly on one day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-04T05:00:00',
|
|
end: '2014-11-04T05:00:00',
|
|
@@ -387,9 +391,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent .fc-resizer').length).toBe(0); // can't resize
|
|
expect($('.fc-bgevent .fc-resizer').length).toBe(0); // can't resize
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly spanning multiple days', function(done) {
|
|
it('render correctly spanning multiple days', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-05T05:00:00',
|
|
end: '2014-11-05T05:00:00',
|
|
@@ -402,9 +407,10 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly when two span on top of each other', function(done) {
|
|
it('render correctly when two span on top of each other', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [
|
|
options.events = [
|
|
|
{
|
|
{
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
@@ -424,22 +430,24 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
describe('when businessHours', function() {
|
|
describe('when businessHours', function() {
|
|
|
it('renders correctly if assumed default', function() {
|
|
it('renders correctly if assumed default', function() {
|
|
|
|
|
+ var options = {};
|
|
|
options.businessHours = true;
|
|
options.businessHours = true;
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // whole days in the day area
|
|
expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // whole days in the day area
|
|
|
expect($('.fc-time-grid .fc-nonbusiness').length).toBe(12); // strips of gray on the timed area
|
|
expect($('.fc-time-grid .fc-nonbusiness').length).toBe(12); // strips of gray on the timed area
|
|
|
});
|
|
});
|
|
|
it('renders correctly if custom', function() {
|
|
it('renders correctly if custom', function() {
|
|
|
|
|
+ var options = {};
|
|
|
options.businessHours = {
|
|
options.businessHours = {
|
|
|
start: '02:00',
|
|
start: '02:00',
|
|
|
end: '06:00',
|
|
end: '06:00',
|
|
|
dow: [ 1, 2, 3, 4 ] // Mon-Thu
|
|
dow: [ 1, 2, 3, 4 ] // Mon-Thu
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
|
|
|
|
|
// whole days
|
|
// whole days
|
|
|
expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // each multi-day stretch is one element
|
|
expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // each multi-day stretch is one element
|
|
@@ -456,11 +464,10 @@ describe('background events', function() {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
- describe('when RTL', function() {
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- options.isRTL = true;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ describe('when RTL', function() {
|
|
|
|
|
+ pushOptions({isRTL:true});
|
|
|
it('render correctly on one day', function(done) {
|
|
it('render correctly on one day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-04T05:00:00',
|
|
end: '2014-11-04T05:00:00',
|
|
@@ -473,9 +480,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent')).toBeAbove('.fc-slats tr:eq(10)'); // 5am
|
|
expect($('.fc-bgevent')).toBeAbove('.fc-slats tr:eq(10)'); // 5am
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
it('render correctly spanning multiple days', function(done) {
|
|
it('render correctly spanning multiple days', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-05T05:00:00',
|
|
end: '2014-11-05T05:00:00',
|
|
@@ -487,16 +495,17 @@ describe('background events', function() {
|
|
|
expect(queryBgEventsInCol(4).length).toBe(1);
|
|
expect(queryBgEventsInCol(4).length).toBe(1);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
describe('when businessHours', function() {
|
|
describe('when businessHours', function() {
|
|
|
it('renders correctly if custom', function() {
|
|
it('renders correctly if custom', function() {
|
|
|
|
|
+ var options = {};
|
|
|
options.businessHours = {
|
|
options.businessHours = {
|
|
|
start: '02:00',
|
|
start: '02:00',
|
|
|
end: '06:00',
|
|
end: '06:00',
|
|
|
dow: [ 1, 2, 3, 4 ] // Mon-Thu
|
|
dow: [ 1, 2, 3, 4 ] // Mon-Thu
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
|
|
|
|
|
// whole days
|
|
// whole days
|
|
|
expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // each stretch of days is one element
|
|
expect($('.fc-day-grid .fc-nonbusiness').length).toBe(2); // each stretch of days is one element
|
|
@@ -519,6 +528,7 @@ describe('background events', function() {
|
|
|
describe('when LTR', function() {
|
|
describe('when LTR', function() {
|
|
|
|
|
|
|
|
it('render correctly on one day', function(done) {
|
|
it('render correctly on one day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-04T05:00:00',
|
|
end: '2014-11-04T05:00:00',
|
|
@@ -536,10 +546,11 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('render correctly spanning multiple days', function(done) {
|
|
it('render correctly spanning multiple days', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-05T05:00:00',
|
|
end: '2014-11-05T05:00:00',
|
|
@@ -557,10 +568,11 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('render correctly when starts before start of week', function(done) {
|
|
it('render correctly when starts before start of week', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-10-30T01:00:00',
|
|
start: '2014-10-30T01:00:00',
|
|
|
end: '2014-11-04T05:00:00',
|
|
end: '2014-11-04T05:00:00',
|
|
@@ -578,10 +590,11 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('render correctly when ends after end of week', function(done) {
|
|
it('render correctly when ends after end of week', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-12T05:00:00',
|
|
end: '2014-11-12T05:00:00',
|
|
@@ -595,10 +608,11 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('render correctly with two related events, in reverse order', function(done) {
|
|
it('render correctly with two related events, in reverse order', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [
|
|
options.events = [
|
|
|
{
|
|
{
|
|
|
id: 'hello',
|
|
id: 'hello',
|
|
@@ -625,10 +639,11 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('render correctly with two related events, nested', function(done) {
|
|
it('render correctly with two related events, nested', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [
|
|
options.events = [
|
|
|
{
|
|
{
|
|
|
id: 'hello',
|
|
id: 'hello',
|
|
@@ -658,16 +673,15 @@ describe('background events', function() {
|
|
|
|
|
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- describe('when RTL', function() {
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- options.isRTL = true;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ describe('when RTL', function() {
|
|
|
|
|
+ pushOptions({isRTL:true});
|
|
|
it('render correctly on one day', function(done) {
|
|
it('render correctly on one day', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
end: '2014-11-04T05:00:00',
|
|
end: '2014-11-04T05:00:00',
|
|
@@ -685,12 +699,13 @@ describe('background events', function() {
|
|
|
// TODO: maybe check y coords
|
|
// TODO: maybe check y coords
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
describe('when out of view range', function() {
|
|
describe('when out of view range', function() {
|
|
|
it('should still render', function(done) {
|
|
it('should still render', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-01-01T01:00:00',
|
|
start: '2014-01-01T01:00:00',
|
|
|
end: '2014-01-01T05:00:00',
|
|
end: '2014-01-01T05:00:00',
|
|
@@ -700,12 +715,13 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent').length).toBe(7);
|
|
expect($('.fc-bgevent').length).toBe(7);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('can have custom Event Object color', function(done) {
|
|
it('can have custom Event Object color', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
rendering: 'background',
|
|
rendering: 'background',
|
|
@@ -715,10 +731,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('can have custom Event Object backgroundColor', function(done) {
|
|
it('can have custom Event Object backgroundColor', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.events = [ {
|
|
options.events = [ {
|
|
|
start: '2014-11-04T01:00:00',
|
|
start: '2014-11-04T01:00:00',
|
|
|
rendering: 'background',
|
|
rendering: 'background',
|
|
@@ -728,10 +745,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('can have custom Event Source color', function(done) {
|
|
it('can have custom Event Source color', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.eventSources = [ {
|
|
options.eventSources = [ {
|
|
|
color: 'red',
|
|
color: 'red',
|
|
|
events: [ {
|
|
events: [ {
|
|
@@ -743,10 +761,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('can have custom Event Source backgroundColor', function(done) {
|
|
it('can have custom Event Source backgroundColor', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.eventSources = [ {
|
|
options.eventSources = [ {
|
|
|
backgroundColor: 'red',
|
|
backgroundColor: 'red',
|
|
|
events: [ {
|
|
events: [ {
|
|
@@ -758,10 +777,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('is affected by global eventColor', function(done) {
|
|
it('is affected by global eventColor', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.eventColor = 'red';
|
|
options.eventColor = 'red';
|
|
|
options.eventSources = [ {
|
|
options.eventSources = [ {
|
|
|
events: [ {
|
|
events: [ {
|
|
@@ -773,10 +793,11 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('is affected by global eventBackgroundColor', function(done) {
|
|
it('is affected by global eventBackgroundColor', function(done) {
|
|
|
|
|
+ var options = {};
|
|
|
options.eventBackgroundColor = 'red';
|
|
options.eventBackgroundColor = 'red';
|
|
|
options.eventSources = [ {
|
|
options.eventSources = [ {
|
|
|
events: [ {
|
|
events: [ {
|
|
@@ -788,11 +809,10 @@ describe('background events', function() {
|
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
expect($('.fc-bgevent').css('background-color')).toMatch(RED_REGEX);
|
|
|
done();
|
|
done();
|
|
|
};
|
|
};
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
|
|
+ initCalendar(options);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-
|
|
|
|
|
function queryBgEventsInCol(col) {
|
|
function queryBgEventsInCol(col) {
|
|
|
return $('.fc-time-grid .fc-content-skeleton td:not(.fc-axis):eq(' + col + ') .fc-bgevent');
|
|
return $('.fc-time-grid .fc-content-skeleton td:not(.fc-axis):eq(' + col + ') .fc-bgevent');
|
|
|
}
|
|
}
|
|
@@ -800,5 +820,4 @@ describe('background events', function() {
|
|
|
function queryNonBusinessSegsInCol(col) {
|
|
function queryNonBusinessSegsInCol(col) {
|
|
|
return $('.fc-time-grid .fc-content-skeleton td:not(.fc-axis):eq(' + col + ') .fc-nonbusiness');
|
|
return $('.fc-time-grid .fc-content-skeleton td:not(.fc-axis):eq(' + col + ') .fc-nonbusiness');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
});
|
|
});
|