mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-19 12:10:12 +08:00
moved automated test files to new locations
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
|
||||
describe('when header options set with next|prev|prevYear|nextYear|today', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
affix('#calendar');
|
||||
var options = {
|
||||
header: {
|
||||
left: 'next,prev,prevYear,nextYear today',
|
||||
center: '',
|
||||
right: 'title'
|
||||
}
|
||||
};
|
||||
$('#calendar').fullCalendar(options);
|
||||
});
|
||||
|
||||
describe('and click next', function() {
|
||||
it('should change view to next month', function() {
|
||||
$('#calendar').fullCalendar('gotoDate', 2010, 1, 1);
|
||||
$('.fc-button-next').simulate('click');
|
||||
var newDate = $('#calendar').fullCalendar('getDate');
|
||||
expect(newDate).toEqual(new Date(2010, 2, 1));
|
||||
});
|
||||
});
|
||||
|
||||
describe('and click prev', function() {
|
||||
it('should change view to prev month', function() {
|
||||
$('#calendar').fullCalendar('gotoDate', 2010, 1, 1);
|
||||
$('.fc-button-prev').simulate('click');
|
||||
var newDate = $('#calendar').fullCalendar('getDate');
|
||||
expect(newDate).toEqual(new Date(2009, 12, 1));
|
||||
});
|
||||
});
|
||||
|
||||
describe('and click prevYear', function() {
|
||||
it('should change view to prev month', function() {
|
||||
$('#calendar').fullCalendar('gotoDate', 2010, 1, 1);
|
||||
$('.fc-button-prevYear').simulate('click');
|
||||
var newDate = $('#calendar').fullCalendar('getDate');
|
||||
expect(newDate).toEqual(new Date(2009, 1, 1));
|
||||
});
|
||||
});
|
||||
|
||||
describe('and click nextYear', function() {
|
||||
it('should change view to prev month', function() {
|
||||
$('#calendar').fullCalendar('gotoDate', 2010, 1, 1);
|
||||
$('.fc-button-nextYear').simulate('click');
|
||||
var newDate = $('#calendar').fullCalendar('getDate');
|
||||
expect(newDate).toEqual(new Date(2011, 1, 1));
|
||||
});
|
||||
});
|
||||
|
||||
describe('and click today', function() {
|
||||
it('should change view to prev month', function() {
|
||||
$('#calendar').fullCalendar('gotoDate', 2010, 1, 1);
|
||||
$('.fc-button-today').simulate('click');
|
||||
var newDate = $('#calendar').fullCalendar('getDate');
|
||||
expect(newDate.toDateString()).toEqual(new Date().toDateString());
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user