fixedWeekCount.js
1.12 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
describe('fixedWeekCount', function() {
var options;
beforeEach(function() {
affix('#cal');
options = {
defaultView: 'month',
defaultDate: '2014-07-01' // has 5 weeks
};
});
describe('when true', function() {
beforeEach(function() {
options.fixedWeekCount = true;
});
it('renders a 5-week month with 6 rows', function() {
$('#cal').fullCalendar(options);
var weeks = $('.fc-week');
expect(weeks.length).toBe(6);
});
});
describe('when false', function() {
beforeEach(function() {
options.fixedWeekCount = false;
});
it('renders a 5-week month with 5 rows', function() {
$('#cal').fullCalendar(options);
var weeks = $('.fc-week');
expect(weeks.length).toBe(5);
});
});
[ true, false ].forEach(function(bool) {
describe('regardless of value (' + bool + ')', function() {
beforeEach(function() {
options.fixedWeekCount = bool;
options.defaultDate = '2014-08-01'; // has 6 weeks
});
it('should render a 6-week month consistently', function() {
$('#cal').fullCalendar(options);
var weeks = $('.fc-week');
expect(weeks.length).toBe(6);
});
});
});
});