switching.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. describe('theme switching', function() {
  2. it('can switch from standard to jquery-ui', function() {
  3. initCalendar()
  4. verifyStandardTheme()
  5. currentCalendar.option('themeSystem', 'jquery-ui')
  6. verifyJqueryUiTheme()
  7. })
  8. it('can switch from jquery-ui to boostrap3', function() {
  9. initCalendar({ themeSystem: 'jquery-ui' })
  10. verifyJqueryUiTheme()
  11. currentCalendar.option('themeSystem', 'bootstrap3')
  12. verifyBootstrapTheme()
  13. })
  14. it('can switch from jquery-ui to boostrap4', function() {
  15. initCalendar({ themeSystem: 'jquery-ui' })
  16. verifyJqueryUiTheme()
  17. currentCalendar.option('themeSystem', 'bootstrap4')
  18. verifyBootstrap4Theme()
  19. })
  20. function verifyStandardTheme() {
  21. expect($('.fc-unthemed')).toBeInDOM()
  22. expect($('.fc-widget-header')).toBeInDOM()
  23. }
  24. function verifyJqueryUiTheme() {
  25. expect($('.fc.ui-widget')).toBeInDOM()
  26. expect($('.ui-widget-header')).toBeInDOM()
  27. }
  28. function verifyBootstrapTheme() {
  29. expect($('.fc-bootstrap3')).toBeInDOM()
  30. expect($('.fc .table-bordered')).toBeInDOM()
  31. }
  32. function verifyBootstrap4Theme() {
  33. expect($('.fc-bootstrap4')).toBeInDOM()
  34. expect($('.fc .table-bordered')).toBeInDOM()
  35. }
  36. })