themeButtonIcons.js
1.46 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
describe('themeButtonIcons', function() {
var options;
var defaultSelectors = [
'.ui-icon-circle-triangle-w',
'.ui-icon-circle-triangle-e',
'.ui-icon-seek-prev',
'.ui-icon-seek-next'
];
beforeEach(function() {
affix('#cal');
options = {
header: {
left: 'prevYear,prev,next,nextYear today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
}
};
});
describe('when theme is off', function() {
beforeEach(function() {
options.theme = false;
});
it('should not have any of the default theme icon classes', function() {
$('#cal').fullCalendar(options);
defaultSelectors.forEach(function(selector) {
expect($(selector)).not.toBeInDOM();
});
});
});
describe('when theme is on', function() {
beforeEach(function() {
options.theme = true;
});
it('should have all of the deafult theme icon classes', function() {
$('#cal').fullCalendar(options);
defaultSelectors.forEach(function(selector) {
expect($(selector)).toBeInDOM();
});
});
it('should accept values that override the individual defaults', function() {
options.themeButtonIcons = {
prev: 'arrowthickstop-1-w',
next: 'arrowthickstop-1-e'
};
$('#cal').fullCalendar(options);
[
'.ui-icon-arrowthickstop-1-w',
'.ui-icon-arrowthickstop-1-e',
'.ui-icon-seek-prev', // prev/next year should remain
'.ui-icon-seek-next' //
]
.forEach(function(selector) {
expect($(selector)).toBeInDOM();
});
});
});
});