Pārlūkot izejas kodu

Using expect inside a loop is probably not the smartest idea

David Asabina 11 gadi atpakaļ
vecāks
revīzija
f91ef2444c
1 mainītis faili ar 18 papildinājumiem un 3 dzēšanām
  1. 18 3
      tests/automated/dayNamesShort.js

+ 18 - 3
tests/automated/dayNamesShort.js

@@ -7,18 +7,33 @@ describe('short day names', function() {
     }
   });
 
-  describe('when view is agenda', function() {
+  describe('when view is agendaWeek', function() {
     describe('when lang is default', function() {
       beforeEach(function() {
         moment.lang('en');
+        settings.defaultView = 'agendaWeek';
       });
 
       it('should be in English, starting on Sunday', function() {
         $('#cal').fullCalendar(settings);
         var weekdays = moment.weekdaysShort();
 
-        $('.fc-day-header').each(function(index, item) {
-          expect(item).toContainText(weekdays[index]);
+        var dayClasses = [
+          '.fc-sun',
+          '.fc-mon',
+          '.fc-tue',
+          '.fc-wed',
+          '.fc-thu',
+          '.fc-fri',
+          '.fc-sat'
+        ];
+
+        //expect($('.fc-agenda-days thead .fc-sun')[0]).toContainText(weekdays[0]);
+        $.each(dayClasses, function(index, cls) {
+          (function(){
+            expect($('.fc-agenda-days thead ' + cls)[0]).toContainText(weekdays[index]);
+          })();
+          //console.log('dealing with ' + cls);
         });
       });
     });