themeButtonIcons.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. describe('themeButtonIcons', function() {
  2. var options;
  3. var defaultSelectors = [
  4. '.ui-icon-circle-triangle-w',
  5. '.ui-icon-circle-triangle-e',
  6. '.ui-icon-seek-prev',
  7. '.ui-icon-seek-next'
  8. ];
  9. beforeEach(function() {
  10. affix('#cal');
  11. options = {
  12. header: {
  13. left: 'prevYear,prev,next,nextYear today',
  14. center: 'title',
  15. right: 'month,agendaWeek,agendaDay'
  16. }
  17. };
  18. });
  19. describe('when theme is off', function() {
  20. beforeEach(function() {
  21. options.theme = false;
  22. });
  23. it('should not have any of the default theme icon classes', function() {
  24. $('#cal').fullCalendar(options);
  25. defaultSelectors.forEach(function(selector) {
  26. expect($(selector)).not.toBeInDOM();
  27. });
  28. });
  29. });
  30. describe('when theme is on', function() {
  31. beforeEach(function() {
  32. options.theme = true;
  33. });
  34. it('should have all of the deafult theme icon classes', function() {
  35. $('#cal').fullCalendar(options);
  36. defaultSelectors.forEach(function(selector) {
  37. expect($(selector)).toBeInDOM();
  38. });
  39. });
  40. it('should accept values that override the individual defaults', function() {
  41. options.themeButtonIcons = {
  42. prev: 'arrowthickstop-1-w',
  43. next: 'arrowthickstop-1-e'
  44. };
  45. $('#cal').fullCalendar(options);
  46. [
  47. '.ui-icon-arrowthickstop-1-w',
  48. '.ui-icon-arrowthickstop-1-e',
  49. '.ui-icon-seek-prev', // prev/next year should remain
  50. '.ui-icon-seek-next' //
  51. ]
  52. .forEach(function(selector) {
  53. expect($(selector)).toBeInDOM();
  54. });
  55. });
  56. });
  57. });