dayNamesShort.js
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
describe('short day names', function() {
var settings = {};
var testableClasses = [
'month',
'agendaWeek',
'basicWeek'
];
var dayClasses = [
'.fc-sun',
'.fc-mon',
'.fc-tue',
'.fc-wed',
'.fc-thu',
'.fc-fri',
'.fc-sat'
];
var languages = [ 'es', 'fr', 'de', 'zh-cn', 'es' ];
beforeEach(function() {
affix('#cal');
settings = { };
});
afterEach(function() {
moment.lang('en'); // reset moment's global language
});
testableClasses.forEach(function(viewClass, index, viewClasses) {
describe('when view is ' + viewClass, function() {
beforeEach(function() {
settings.defaultView = viewClass;
});
describe('when lang is default', function() {
it('should be in English', function() {
moment.lang('en');
$('#cal').fullCalendar(settings);
var weekdays = moment.weekdaysShort();
dayClasses.forEach(function(cls, index, classes) {
expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index]);
});
});
});
describe('when lang is not default', function() {
languages.forEach(function(language, index, languages) {
it('should be in the selected language', function() {
settings.lang = language;
$('#cal').fullCalendar(settings);
moment.lang(language);
var dow = moment.langData(language)._week.dow;
var weekdays = moment.weekdaysShort();
dayClasses.forEach(function(cls, index, classes) {
expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index]);
});
});
});
});
describe('when specified', function() {
it('should contain the specified names in the given order', function() {
var days = [
'Hov.', 'maS.', 'veS.', 'mech.', 'parmaq.', 'HoS.'
];
settings.dayNamesShort = days;
$('#cal').fullCalendar(settings);
dayClasses.forEach(function(cls, index, classes) {
expect($('.fc-view thead ' + cls)[0]).toContainText(days[index]);
});
});
});
});
});
});