mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-07-29 11:20:30 +08:00
Using expect inside a loop is probably not the smartest idea
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user