themeButtonIcons.js 1.4 KB

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