weekViewRender.js 781 B

12345678910111213141516171819202122232425262728293031
  1. describe('weekViewRender', function() {
  2. var nowStr = $.fullCalendar.moment(new Date()).format('YYYY-MM-DD')
  3. pushOptions({
  4. defaultDate: nowStr,
  5. defaultView: 'agendaWeek'
  6. })
  7. describe('verify th class for today', function() {
  8. it('should have fc-today class only on "today"', function() {
  9. initCalendar()
  10. var foundToday = false
  11. $('th.fc-day-header', currentCalendar.el).each(function(i, headerNode) {
  12. var headerEl = $(headerNode)
  13. var dateMatchesToday = headerEl.data('date') === nowStr
  14. var hasTodayClass = headerEl.hasClass('fc-today')
  15. expect(dateMatchesToday).toBe(hasTodayClass)
  16. if (hasTodayClass) {
  17. foundToday = true
  18. }
  19. })
  20. expect(foundToday).toBe(true)
  21. })
  22. })
  23. })