Przeglądaj źródła

Add StylesMap._styleProcessor static getter tests.

Maciej Gołaszewski 5 lat temu
rodzic
commit
ec4b7dd3d2
1 zmienionych plików z 14 dodań i 0 usunięć
  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 );
+		} );
+	} );
 } );