8
0
Quellcode durchsuchen

Tests: Minor code refactoring in View tests.

Aleksander Nowodzinski vor 9 Jahren
Ursprung
Commit
0ec6e7277e
1 geänderte Dateien mit 23 neuen und 21 gelöschten Zeilen
  1. 23 21
      packages/ckeditor5-ui/tests/view.js

+ 23 - 21
packages/ckeditor5-ui/tests/view.js

@@ -44,36 +44,38 @@ describe( 'View', () => {
 			expect( view.t ).to.equal( locale.t );
 		} );
 
-		it( 'handles #ready binding of instances in #_viewCollections', () => {
-			const collection = new ViewCollection();
+		describe( '_viewCollections', () => {
+			it( 'manages #ready attribute binding', () => {
+				const collection = new ViewCollection();
 
-			expect( collection.ready ).to.be.false;
+				expect( collection.ready ).to.be.false;
 
-			view._viewCollections.add( collection );
-			expect( collection.ready ).to.be.false;
+				view._viewCollections.add( collection );
+				expect( collection.ready ).to.be.false;
 
-			view.ready = true;
-			expect( collection.ready ).to.be.true;
+				view.ready = true;
+				expect( collection.ready ).to.be.true;
 
-			view._viewCollections.remove( collection );
+				view._viewCollections.remove( collection );
 
-			view.ready = false;
-			expect( collection.ready ).to.be.true;
-		} );
+				view.ready = false;
+				expect( collection.ready ).to.be.true;
+			} );
 
-		it( 'handles #locale of instances in #_viewCollections', () => {
-			const locale = {
-				t() {}
-			};
+			it( 'manages #locale property', () => {
+				const locale = {
+					t() {}
+				};
 
-			const view = new View( locale );
-			const collection = new ViewCollection();
+				const view = new View( locale );
+				const collection = new ViewCollection();
 
-			expect( view.locale ).to.equal( locale );
-			expect( collection.locale ).to.be.undefined;
+				expect( view.locale ).to.equal( locale );
+				expect( collection.locale ).to.be.undefined;
 
-			view._viewCollections.add( collection );
-			expect( collection.locale ).to.equal( view.locale );
+				view._viewCollections.add( collection );
+				expect( collection.locale ).to.equal( view.locale );
+			} );
 		} );
 	} );