Agenda-render.js
1.21 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
describe('Agenda view rendering', function() {
	var options;
	beforeEach(function() {
		affix('#cal');
		options = {
			defaultView: 'agendaWeek'
		};
	});
	describe('when LTR', function() {
		beforeEach(function() {
			options.isRTL = false;
		});
		it('renders the axis on the left', function() {
			$('#cal').fullCalendar(options);
			var header = $('.fc-view > table > thead');
			var firstSlat = $('.fc-slats tr:first');
			expect(header.find('.fc-axis')).toBeLeftOf(header.find('.fc-day-header:first'));
			expect($('.fc-day-grid .fc-axis')).toBeLeftOf($('.fc-day-grid .fc-day:first'));
			expect(firstSlat.find('.fc-axis')).toBeLeftOf(firstSlat.find('td:not(.fc-axis)'));
		});
	});
	describe('when RTL', function() {
		beforeEach(function() {
			options.isRTL = true;
		});
		it('renders the axis on the right', function() {
			$('#cal').fullCalendar(options);
			var header = $('.fc-view > table > thead');
			var firstSlat = $('.fc-slats tr:first');
			expect(header.find('.fc-axis')).toBeRightOf(header.find('.fc-day-header:first'));
			expect($('.fc-day-grid .fc-axis')).toBeRightOf($('.fc-day-grid .fc-day:first'));
			expect(firstSlat.find('.fc-axis')).toBeRightOf(firstSlat.find('td:not(.fc-axis)'));
		});
	});
});