瀏覽代碼

Code refactoring in View tests.

Aleksander Nowodzinski 10 年之前
父節點
當前提交
8929978abe
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      packages/ckeditor5-engine/tests/ui/view.js

+ 2 - 4
packages/ckeditor5-engine/tests/ui/view.js

@@ -26,7 +26,6 @@ describe( 'constructor', function() {
 		setTestViewInstance( { a: 'foo', b: 42 } );
 
 		expect( view.model ).to.be.an.instanceof( modules.model );
-
 		expect( view ).to.have.deep.property( 'model.a', 'foo' );
 		expect( view ).to.have.deep.property( 'model.b', 42 );
 	} );
@@ -441,6 +440,7 @@ describe( 'destroy', function() {
 
 		setTestViewInstance( { foo: 'bar' } );
 
+		// Keep the reference after the view is destroyed.
 		var model = view.model;
 
 		expect( view.el.outerHTML ).to.be.equal( '<p>bar</p>' );
@@ -460,9 +460,7 @@ function updateModuleReference() {
 }
 
 function createViewInstanceWithTemplate() {
-	setTestViewClass( () => {
-		return { tag: 'a' };
-	} );
+	setTestViewClass( () => ( { tag: 'a' } ) );
 	setTestViewInstance();
 }