|
@@ -1,43 +1,39 @@
|
|
|
-
|
|
|
|
|
describe('dayPopoverFormat', function() {
|
|
describe('dayPopoverFormat', function() {
|
|
|
|
|
|
|
|
- var options;
|
|
|
|
|
-
|
|
|
|
|
- beforeEach(function() {
|
|
|
|
|
- affix('#cal');
|
|
|
|
|
- options = {
|
|
|
|
|
- defaultDate: '2014-08-01',
|
|
|
|
|
- eventLimit: 3,
|
|
|
|
|
- events: [
|
|
|
|
|
- { title: 'event1', start: '2014-07-28', end: '2014-07-30', className: 'event1' },
|
|
|
|
|
- { title: 'event2', start: '2014-07-29', end: '2014-07-31', className: 'event2' },
|
|
|
|
|
- { title: 'event3', start: '2014-07-29', className: 'event3' },
|
|
|
|
|
- { title: 'event4', start: '2014-07-29', className: 'event4' }
|
|
|
|
|
- ]
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ pushOptions({
|
|
|
|
|
+ defaultDate: '2014-08-01',
|
|
|
|
|
+ eventLimit: 3,
|
|
|
|
|
+ events: [
|
|
|
|
|
+ { title: 'event1', start: '2014-07-28', end: '2014-07-30', className: 'event1' },
|
|
|
|
|
+ { title: 'event2', start: '2014-07-29', end: '2014-07-31', className: 'event2' },
|
|
|
|
|
+ { title: 'event3', start: '2014-07-29', className: 'event3' },
|
|
|
|
|
+ { title: 'event4', start: '2014-07-29', className: 'event4' }
|
|
|
|
|
+ ]
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- function init() {
|
|
|
|
|
- $('#cal').fullCalendar(options);
|
|
|
|
|
- $('.fc-more').simulate('click');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
it('can be set to a custom value', function() {
|
|
it('can be set to a custom value', function() {
|
|
|
- options.dayPopoverFormat = 'ddd, MMMM';
|
|
|
|
|
- init();
|
|
|
|
|
|
|
+ initCalendar({
|
|
|
|
|
+ dayPopoverFormat: 'ddd, MMMM'
|
|
|
|
|
+ });
|
|
|
|
|
+ $('.fc-more').simulate('click');
|
|
|
expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('Tue, July');
|
|
expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('Tue, July');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('is affected by the current locale when the value is default', function() {
|
|
it('is affected by the current locale when the value is default', function() {
|
|
|
- options.locale = 'fr';
|
|
|
|
|
- init();
|
|
|
|
|
|
|
+ initCalendar({
|
|
|
|
|
+ locale: 'fr'
|
|
|
|
|
+ });
|
|
|
|
|
+ $('.fc-more').simulate('click');
|
|
|
expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('29 juillet 2014');
|
|
expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('29 juillet 2014');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('still maintains the same format when explicitly set, and there is a locale', function() {
|
|
it('still maintains the same format when explicitly set, and there is a locale', function() {
|
|
|
- options.locale = 'fr';
|
|
|
|
|
- options.dayPopoverFormat = 'YYYY';
|
|
|
|
|
- init();
|
|
|
|
|
|
|
+ initCalendar({
|
|
|
|
|
+ locale: 'fr',
|
|
|
|
|
+ dayPopoverFormat: 'YYYY',
|
|
|
|
|
+ });
|
|
|
|
|
+ $('.fc-more').simulate('click');
|
|
|
expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('2014');
|
|
expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('2014');
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
});
|
|
});
|