validRange.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import * as EventRenderUtils from './EventRenderUtils'
  2. describe('validRange event rendering', function() {
  3. describe('with 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. describe('when event is partially before', function() {
  11. pushOptions({
  12. events: [
  13. { start: '2017-06-05', end: '2017-06-09' }
  14. ]
  15. })
  16. it('truncates the event\'s beginning', function() {
  17. initCalendar()
  18. EventRenderUtils.expectIsStart(false)
  19. EventRenderUtils.expectIsEnd(true)
  20. // TODO: more test about positioning
  21. })
  22. })
  23. })
  24. })
  25. describe('with end constraint', function() {
  26. describe('when month view', function() {
  27. pushOptions({
  28. defaultView: 'month',
  29. defaultDate: '2017-06-01',
  30. validRange: { end: '2017-06-07' }
  31. })
  32. describe('when event is partially before', function() {
  33. pushOptions({
  34. events: [
  35. { start: '2017-06-05', end: '2017-06-09' }
  36. ]
  37. })
  38. it('truncates the event\'s end', function() {
  39. initCalendar()
  40. EventRenderUtils.expectIsStart(true)
  41. EventRenderUtils.expectIsEnd(false)
  42. // TODO: more test about positioning
  43. })
  44. })
  45. })
  46. })
  47. })