Using expect inside a loop is probably not the smartest idea

This commit is contained in:
David Asabina
2014-05-23 22:53:10 +02:00
parent b1e01e5e9b
commit f91ef2444c
+18 -3
View File
@@ -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);
});
});
});