2
0

fixedWeekCount.js 975 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. describe('fixedWeekCount', function() {
  2. pushOptions({
  3. defaultView: 'month',
  4. defaultDate: '2014-07-01' // has 5 weeks
  5. });
  6. describe('when true', function() {
  7. pushOptions({
  8. fixedWeekCount: true
  9. });
  10. it('renders a 5-week month with 6 rows', function() {
  11. initCalendar();
  12. var weeks = $('.fc-week');
  13. expect(weeks.length).toBe(6);
  14. });
  15. });
  16. describe('when false', function() {
  17. pushOptions({
  18. fixedWeekCount: false
  19. });
  20. it('renders a 5-week month with 5 rows', function() {
  21. initCalendar();
  22. var weeks = $('.fc-week');
  23. expect(weeks.length).toBe(5);
  24. });
  25. });
  26. [ true, false ].forEach(function(bool) {
  27. describe('regardless of value (' + bool + ')', function() {
  28. pushOptions({
  29. fixedWeekCount: bool,
  30. defaultDate: '2014-08-01' // has 6 weeks
  31. });
  32. it('should render a 6-week month consistently', function() {
  33. initCalendar();
  34. var weeks = $('.fc-week');
  35. expect(weeks.length).toBe(6);
  36. });
  37. });
  38. });
  39. });