Procházet zdrojové kódy

Converting Constructors in Legacy Tests

acerix před 8 roky
rodič
revize
16a727cbca
1 změnil soubory, kde provedl 10 přidání a 14 odebrání
  1. 10 14
      tests/legacy/basic-view.js

+ 10 - 14
tests/legacy/basic-view.js

@@ -1,21 +1,19 @@
 
 
 describe('basic view rendering', function() {
 describe('basic view rendering', function() {
 
 
-	beforeEach(function() {
-		affix('#cal');
+	pushOptions({
+		defaultView: 'month',
 	});
 	});
 
 
 	describe('when isRTL is false', function() {
 	describe('when isRTL is false', function() {
 
 
-		beforeEach(function() {
-			$('#cal').fullCalendar({
-				defaultView: 'month',
-				isRTL: false
-			});
+		pushOptions({
+			isRTL: false
 		});
 		});
 
 
 		it('should have have days ordered sun to sat', function() {
 		it('should have have days ordered sun to sat', function() {
-			var fc = $('#cal').find('.fc-day-header');
+			initCalendar();
+			var fc = $(currentCalendar.el).find('.fc-day-header');
 			expect(fc[0]).toHaveClass('fc-sun');
 			expect(fc[0]).toHaveClass('fc-sun');
 			expect(fc[1]).toHaveClass('fc-mon');
 			expect(fc[1]).toHaveClass('fc-mon');
 			expect(fc[2]).toHaveClass('fc-tue');
 			expect(fc[2]).toHaveClass('fc-tue');
@@ -28,15 +26,13 @@ describe('basic view rendering', function() {
 
 
 	describe('when isRTL is true', function() {
 	describe('when isRTL is true', function() {
 
 
-		beforeEach(function() {
-			$('#cal').fullCalendar({
-				defaultView: 'month',
-				isRTL: true
-			});
+		pushOptions({
+			isRTL: true
 		});
 		});
 
 
 		it('should have have days ordered sat to sun', function() {
 		it('should have have days ordered sat to sun', function() {
-			var fc = $('#cal').find('.fc-day-header');
+			initCalendar();
+			var fc = $(currentCalendar.el).find('.fc-day-header');
 			expect(fc[0]).toHaveClass('fc-sat');
 			expect(fc[0]).toHaveClass('fc-sat');
 			expect(fc[1]).toHaveClass('fc-fri');
 			expect(fc[1]).toHaveClass('fc-fri');
 			expect(fc[2]).toHaveClass('fc-thu');
 			expect(fc[2]).toHaveClass('fc-thu');