Browse Source

Add tests for background color.

Maciej Gołaszewski 6 years ago
parent
commit
88c0de1d61
1 changed files with 21 additions and 0 deletions
  1. 21 0
      packages/ckeditor5-engine/tests/view/styles.js

+ 21 - 0
packages/ckeditor5-engine/tests/view/styles.js

@@ -673,5 +673,26 @@ describe( 'Styles', () => {
 				expect( styles.getInlineProperty( 'baz' ) ).to.equal( '2px 3em' );
 			} );
 		} );
+
+		describe( 'background', () => {
+			it( 'should normalize background', () => {
+				styles.setStyle( 'background:#f00;' );
+
+				expect( styles.getNormalized( 'background' ) ).to.deep.equal( { color: '#f00' } );
+			} );
+
+			it( 'should normalize background-color', () => {
+				styles.setStyle( 'background-color:#f00;' );
+
+				expect( styles.getNormalized( 'background' ) ).to.deep.equal( { color: '#f00' } );
+			} );
+
+			it( 'should output inline background-color style', () => {
+				styles.setStyle( 'background:#f00;' );
+
+				expect( styles.getInlineStyle() ).to.equal( 'background-color:#f00;' );
+				expect( styles.getInlineProperty( 'background-color' ) ).to.equal( '#f00' );
+			} );
+		} );
 	} );
 } );