|
|
@@ -1,95 +1,40 @@
|
|
|
|
|
|
describe('columnHead', function() {
|
|
|
- beforeEach(function() {
|
|
|
- affix('#cal');
|
|
|
+ pushOptions({
|
|
|
+ defaultDate: '2014-05-11'
|
|
|
});
|
|
|
|
|
|
- describe('when columnHead is not set', function() {
|
|
|
+ describeOptions('defaultView', {
|
|
|
+ 'when month view': 'month',
|
|
|
+ 'when agenda view': 'agendaDay',
|
|
|
+ 'when basic view': 'basicDay'
|
|
|
+ }, function() {
|
|
|
|
|
|
- var viewWithFormat = [
|
|
|
- { view: 'month' },
|
|
|
- { view: 'basicWeek' },
|
|
|
- { view: 'agendaWeek' },
|
|
|
- { view: 'basicDay' },
|
|
|
- { view: 'agendaDay' }
|
|
|
- ];
|
|
|
-
|
|
|
- beforeEach(function() {
|
|
|
- $('#cal').fullCalendar({
|
|
|
- defaultDate: '2014-05-11'
|
|
|
+ describe('when off', function() {
|
|
|
+ pushOptions({
|
|
|
+ columnHead: true
|
|
|
});
|
|
|
- });
|
|
|
-
|
|
|
- it('header should be visible', function() {
|
|
|
- var cal = $('#cal');
|
|
|
|
|
|
- for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
- var crtView = viewWithFormat[i];
|
|
|
- cal.fullCalendar('changeView', crtView.view);
|
|
|
- expect(cal.find('thead.fc-head').length).toBe(1);
|
|
|
- };
|
|
|
+ it('should show header', function() {
|
|
|
+ initCalendar();
|
|
|
+ expect(hasHeader()).toBe(true);
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
|
|
|
- describe('when columnHead is set to false', function() {
|
|
|
-
|
|
|
- var viewWithFormat = [
|
|
|
- { view: 'month' },
|
|
|
- { view: 'basicWeek' },
|
|
|
- { view: 'agendaWeek' },
|
|
|
- { view: 'basicDay' },
|
|
|
- { view: 'agendaDay' }
|
|
|
- ];
|
|
|
-
|
|
|
- beforeEach(function() {
|
|
|
- $('#cal').fullCalendar({
|
|
|
- defaultDate: '2014-05-11',
|
|
|
+ describe('when on', function() {
|
|
|
+ pushOptions({
|
|
|
columnHead: false
|
|
|
});
|
|
|
- });
|
|
|
-
|
|
|
- it('header should not be visible', function() {
|
|
|
- var cal = $('#cal');
|
|
|
|
|
|
- for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
- var crtView = viewWithFormat[i];
|
|
|
- cal.fullCalendar('changeView', crtView.view);
|
|
|
- expect(cal.find('thead.fc-head').length).toBe(0);
|
|
|
- };
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- describe('when columnHead is set on a per-view basis', function() {
|
|
|
-
|
|
|
- var viewWithFormat = [
|
|
|
- { view: 'month', columnHeadLength: 0 },
|
|
|
- { view: 'basicWeek', columnHeadLength: 1 },
|
|
|
- { view: 'agendaWeek', columnHeadLength: 0 },
|
|
|
- { view: 'basicDay', columnHeadLength: 0 },
|
|
|
- { view: 'agendaDay', columnHeadLength: 1 }
|
|
|
- ];
|
|
|
-
|
|
|
- beforeEach(function() {
|
|
|
- $('#cal').fullCalendar({
|
|
|
- defaultDate: '2014-05-11',
|
|
|
- views: {
|
|
|
- month: { columnHead: false },
|
|
|
- agendaDay: { columnHead: true },
|
|
|
- agendaWeek: { columnHead: false },
|
|
|
- basicDay: { columnHead: false },
|
|
|
- basicWeek: { columnHead: true }
|
|
|
- }
|
|
|
+ it('should not show header', function() {
|
|
|
+ initCalendar();
|
|
|
+ expect(hasHeader()).toBe(false);
|
|
|
});
|
|
|
});
|
|
|
+ });
|
|
|
|
|
|
- it('if columnHead is false, header should not be visible', function() {
|
|
|
- var cal = $('#cal');
|
|
|
+ function hasHeader() {
|
|
|
+ return $('.fc-view > table > .fc-head').length === 1;
|
|
|
+ }
|
|
|
|
|
|
- for (var i = 0; i < viewWithFormat.length; i++) {
|
|
|
- var crtView = viewWithFormat[i];
|
|
|
- cal.fullCalendar('changeView', crtView.view);
|
|
|
- expect(cal.find('thead.fc-head').length).toBe(crtView.columnHeadLength);
|
|
|
- };
|
|
|
- });
|
|
|
- });
|
|
|
-});
|
|
|
+});
|