|
@@ -1,33 +1,29 @@
|
|
|
describe('View object', function() {
|
|
describe('View object', function() {
|
|
|
|
|
|
|
|
- var options;
|
|
|
|
|
-
|
|
|
|
|
/*
|
|
/*
|
|
|
TODO: move tests from eventLimitClick.js about view.name/type into here
|
|
TODO: move tests from eventLimitClick.js about view.name/type into here
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- affix('#cal');
|
|
|
|
|
- options = {
|
|
|
|
|
- defaultDate: '2015-01-01'
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ pushOptions({
|
|
|
|
|
+ defaultDate: '2015-01-01'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
describe('title', function() {
|
|
describe('title', function() {
|
|
|
|
|
|
|
|
it('is a correctly defined string', function() {
|
|
it('is a correctly defined string', function() {
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
- var view = $('#cal').fullCalendar('getView');
|
|
|
|
|
|
|
+ initCalendar();
|
|
|
|
|
+ var view = currentCalendar.getView();
|
|
|
expect(view.title).toBe('January 2015');
|
|
expect(view.title).toBe('January 2015');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('is available in the viewRender callback', function() {
|
|
it('is available in the viewRender callback', function() {
|
|
|
- options.viewRender = function(view) {
|
|
|
|
|
|
|
+ var viewRenderSpy = spyOnCalendarCallback('viewRender', function(view) {
|
|
|
expect(view.title).toBe('January 2015');
|
|
expect(view.title).toBe('January 2015');
|
|
|
- };
|
|
|
|
|
- spyOn(options, 'viewRender').and.callThrough();
|
|
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
- expect(options.viewRender).toHaveBeenCalled();
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ initCalendar();
|
|
|
|
|
+ expect(viewRenderSpy).toHaveBeenCalled();
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
});
|
|
});
|