mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-11 11:18:47 +08:00
automated tests for weekNumberTitle
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
describe('weekNumberTitle', function() {
|
||||
|
||||
var options;
|
||||
|
||||
beforeEach(function() {
|
||||
affix('#cal');
|
||||
options = {
|
||||
weekNumbers: true
|
||||
};
|
||||
});
|
||||
|
||||
function getRenderedWeekNumberTitle() {
|
||||
// works for both kinds of views
|
||||
var text = $('th.fc-week-number').text();
|
||||
return text.replace(/\d/g, '');
|
||||
}
|
||||
|
||||
[ 'basicWeek', 'agendaWeek' ].forEach(function(viewName) {
|
||||
describe('when views is ' + viewName, function() {
|
||||
|
||||
beforeEach(function() {
|
||||
options.defaultView = viewName;
|
||||
});
|
||||
|
||||
it('renders correctly by default', function() {
|
||||
$('#cal').fullCalendar(options);
|
||||
expect(getRenderedWeekNumberTitle()).toBe('W');
|
||||
});
|
||||
|
||||
it('renders correctly when unspecified and when language is customized', function() {
|
||||
options.lang = 'es';
|
||||
$('#cal').fullCalendar(options);
|
||||
expect(getRenderedWeekNumberTitle()).toBe('Sm');
|
||||
});
|
||||
|
||||
it('renders correctly when customized and LTR', function() {
|
||||
options.isRTL = false;
|
||||
options.weekNumberTitle = 'YO';
|
||||
$('#cal').fullCalendar(options);
|
||||
expect(getRenderedWeekNumberTitle()).toBe('YO');
|
||||
});
|
||||
|
||||
it('renders correctly when customized and RTL', function() {
|
||||
options.isRTL = true;
|
||||
options.weekNumberTitle = 'YO';
|
||||
$('#cal').fullCalendar(options);
|
||||
expect(getRenderedWeekNumberTitle()).toBe('YO');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user