prev.js 754 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. SEE ALSO:
  3. - next (does core of date switching)
  4. */
  5. import { expectActiveRange } from './ViewDateUtils'
  6. describe('prev', function() {
  7. pushOptions({
  8. defaultDate: '2017-06-08'
  9. })
  10. describe('when in a week view', function() {
  11. pushOptions({
  12. defaultView: 'agendaWeek'
  13. })
  14. it('moves back by one week', function() {
  15. initCalendar()
  16. currentCalendar.prev()
  17. expectActiveRange('2017-05-28', '2017-06-04')
  18. })
  19. describe('when two week dateIncrement', function() {
  20. pushOptions({
  21. dateIncrement: { weeks: 2 }
  22. })
  23. it('moves back by two weeks', function() {
  24. initCalendar()
  25. currentCalendar.prev()
  26. expectActiveRange('2017-05-21', '2017-05-28')
  27. })
  28. })
  29. })
  30. })