浏览代码

Add StylesMap._styleProcessor static getter tests.

Maciej Gołaszewski 5 年之前
父节点
当前提交
ec4b7dd3d2
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      packages/ckeditor5-engine/tests/view/stylesmap.js

+ 14 - 0
packages/ckeditor5-engine/tests/view/stylesmap.js

@@ -251,4 +251,18 @@ describe( 'StylesMap', () => {
 			expect( stylesMap.getStyleNames() ).to.deep.equal( [ 'foo' ] );
 		} );
 	} );
+
+	describe( 'static _styleProcessor getter', () => {
+		it( 'should return StyleProcessor instance', () => {
+			// Set undefined to reset field value for code coverage.
+			StylesMap._setProcessor( undefined );
+			expect( StylesMap._styleProcessor ).to.be.instanceOf( StylesProcessor );
+		} );
+
+		it( 'should return the same StyleProcessor instance on consecutive calls', () => {
+			const stylesProcessor = StylesMap._styleProcessor;
+
+			expect( StylesMap._styleProcessor ).to.equal( stylesProcessor );
+		} );
+	} );
 } );