customButtons.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. theme: '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. theme: '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. });