|
|
@@ -10,6 +10,54 @@ describe('constructor', function() {
|
|
|
expect(res instanceof jQuery).toBe(true);
|
|
|
});
|
|
|
|
|
|
+ it('should not modify the options object', function() {
|
|
|
+ var options = {
|
|
|
+ defaultView: 'agendaWeek',
|
|
|
+ scrollTime: '09:00:00',
|
|
|
+ slotDuration: { minutes: 45 }
|
|
|
+ };
|
|
|
+ var optionsCopy = $.extend({}, options, true);
|
|
|
+ $('#calendar').fullCalendar(options);
|
|
|
+ expect(options).toEqual(optionsCopy);
|
|
|
+ });
|
|
|
+
|
|
|
+ it('should not modify the events array', function() {
|
|
|
+ var options = {
|
|
|
+ defaultView: 'month',
|
|
|
+ defaultDate: '2014-05-27',
|
|
|
+ events: [
|
|
|
+ {
|
|
|
+ title: 'mytitle',
|
|
|
+ start: '2014-05-27'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ var optionsCopy = $.extend(true, {}, options); // recursive copy
|
|
|
+ $('#calendar').fullCalendar(options);
|
|
|
+ expect(options).toEqual(optionsCopy);
|
|
|
+ });
|
|
|
+
|
|
|
+ /*
|
|
|
+ TODO: implement this behavior
|
|
|
+ it('should not modify the eventSources array', function() {
|
|
|
+ var options = {
|
|
|
+ defaultView: 'month',
|
|
|
+ defaultDate: '2014-05-27',
|
|
|
+ eventSources: [
|
|
|
+ { events: [
|
|
|
+ {
|
|
|
+ title: 'mytitle',
|
|
|
+ start: '2014-05-27'
|
|
|
+ }
|
|
|
+ ] }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ var optionsCopy = $.extend(true, {}, options); // recursive copy
|
|
|
+ $('#calendar').fullCalendar(options);
|
|
|
+ expect(options).toEqual(optionsCopy);
|
|
|
+ });
|
|
|
+ */
|
|
|
+
|
|
|
describe('when called on a div', function() {
|
|
|
|
|
|
beforeEach(function() {
|