customButtons.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. describe('customButtons', function() {
  2. it('can specify text', function() {
  3. initCalendar({
  4. customButtons: {
  5. mybutton: { text: 'asdf' }
  6. },
  7. header: { left: 'mybutton', center: '', right: '' }
  8. })
  9. expect($('.fc-mybutton-button')).toHaveText('asdf')
  10. })
  11. it('can specify an icon', function() {
  12. initCalendar({
  13. customButtons: {
  14. mybutton: { icon: 'asdf' }
  15. },
  16. header: { left: 'mybutton', center: '', right: '' }
  17. })
  18. expect($('.fc-mybutton-button .fc-icon')).toHaveClass('fc-icon-asdf')
  19. })
  20. it('can specify a jquery-ui icon', function() {
  21. initCalendar({
  22. themeSystem: 'jquery-ui',
  23. customButtons: {
  24. mybutton: { themeIcon: 'asdf' }
  25. },
  26. header: { left: 'mybutton', center: '', right: '' }
  27. })
  28. expect($('.fc-mybutton-button .ui-icon')).toHaveClass('ui-icon-asdf')
  29. })
  30. it('can specify a bootstrap glyphicon', function() {
  31. initCalendar({
  32. themeSystem: 'bootstrap3',
  33. customButtons: {
  34. mybutton: { bootstrapGlyphicon: 'asdf' }
  35. },
  36. header: { left: 'mybutton', center: '', right: '' }
  37. })
  38. expect($('.fc-mybutton-button .glyphicon')).toHaveClass('glyphicon-asdf')
  39. })
  40. it('can specify a bootstrap4 font-awesome icon', function() {
  41. initCalendar({
  42. themeSystem: 'bootstrap4',
  43. customButtons: {
  44. mybutton: { bootstrapFontAwesome: 'asdf' }
  45. },
  46. header: { left: 'mybutton', center: '', right: '' }
  47. })
  48. expect($('.fc-mybutton-button .fa')).toHaveClass('fa-asdf')
  49. })
  50. })