weekViewRender.js 803 B

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