View.js 756 B

123456789101112131415161718192021222324252627282930313233
  1. describe('View object', function() {
  2. var options;
  3. /*
  4. TODO: move tests from eventLimitClick.js about view.name/type into here
  5. */
  6. beforeEach(function() {
  7. affix('#cal');
  8. options = {
  9. defaultDate: '2015-01-01'
  10. };
  11. });
  12. describe('title', function() {
  13. it('is a correctly defined string', function() {
  14. $('#cal').fullCalendar(options);
  15. var view = $('#cal').fullCalendar('getView');
  16. expect(view.title).toBe('January 2015');
  17. });
  18. it('is available in the viewRender callback', function() {
  19. options.viewRender = function(view) {
  20. expect(view.title).toBe('January 2015');
  21. };
  22. spyOn(options, 'viewRender').and.callThrough();
  23. $('#cal').fullCalendar(options);
  24. expect(options.viewRender).toHaveBeenCalled();
  25. });
  26. });
  27. });