validRange.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { expectDayRange } from './ViewRenderUtils'
  2. describe('validRange rendering', function() {
  3. describe('with hardcoded start constraint', function() {
  4. describe('when month view', function() {
  5. pushOptions({
  6. defaultView: 'month',
  7. defaultDate: '2017-06-01',
  8. validRange: { start: '2017-06-07' }
  9. })
  10. it('does not render days before', function() {
  11. initCalendar()
  12. expectDayRange('2017-06-07', '2017-07-09')
  13. })
  14. })
  15. describe('when in week view', function() {
  16. pushOptions({
  17. defaultView: 'agendaWeek',
  18. defaultDate: '2017-06-08',
  19. validRange: { start: '2017-06-06' }
  20. })
  21. it('does not render days before', function() {
  22. initCalendar()
  23. expectDayRange('2017-06-06', '2017-06-11')
  24. })
  25. })
  26. })
  27. describe('with hardcoded end constraint', function() {
  28. describe('when month view', function() {
  29. pushOptions({
  30. defaultView: 'month',
  31. defaultDate: '2017-06-01',
  32. validRange: { end: '2017-06-07' }
  33. })
  34. it('does not render days on or after', function() {
  35. initCalendar()
  36. expectDayRange('2017-05-28', '2017-06-07')
  37. })
  38. })
  39. describe('when in week view', function() {
  40. pushOptions({
  41. defaultView: 'agendaWeek',
  42. defaultDate: '2017-06-08',
  43. validRange: { end: '2017-06-06' }
  44. })
  45. it('does not render days on or after', function() {
  46. initCalendar()
  47. expectDayRange('2017-06-04', '2017-06-06')
  48. })
  49. })
  50. })
  51. })