|
|
@@ -20,7 +20,6 @@ describe( 'Background styles normalization', () => {
|
|
|
} );
|
|
|
|
|
|
it( 'should normalize background', () => {
|
|
|
- // TODO: border-box given only for coverage test.
|
|
|
styles.setTo( 'background:url("example.jpg") center #f00 repeat-y fixed border-box;' );
|
|
|
|
|
|
expect( styles.getNormalized( 'background' ) ).to.deep.equal( {
|
|
|
@@ -32,7 +31,27 @@ describe( 'Background styles normalization', () => {
|
|
|
} );
|
|
|
} );
|
|
|
|
|
|
- // TODO: define what should happen with layers
|
|
|
+ it( 'should normalize background (color with spaces)', () => {
|
|
|
+ styles.setTo( 'background:url("example.jpg") center rgb(253, 253, 119) repeat-y fixed border-box;' );
|
|
|
+
|
|
|
+ expect( styles.getNormalized( 'background' ) ).to.deep.equal( {
|
|
|
+ attachment: 'fixed',
|
|
|
+ image: 'url("example.jpg")',
|
|
|
+ position: [ 'center' ],
|
|
|
+ repeat: [ 'repeat-y' ],
|
|
|
+ color: 'rgb(253, 253, 119)'
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'should normalize background (color only with spaces)', () => {
|
|
|
+ styles.setTo( 'background: rgb(253, 253, 119);' );
|
|
|
+
|
|
|
+ expect( styles.getNormalized( 'background' ) ).to.deep.equal( {
|
|
|
+ color: 'rgb(253, 253, 119)'
|
|
|
+ } );
|
|
|
+ } );
|
|
|
+
|
|
|
+ // Layers are not supported.
|
|
|
it.skip( 'should normalize background with layers', () => {
|
|
|
styles.setTo( 'background:url("test.jpg") repeat-y,#f00;' );
|
|
|
|
|
|
@@ -45,6 +64,12 @@ describe( 'Background styles normalization', () => {
|
|
|
expect( styles.getNormalized( 'background' ) ).to.deep.equal( { color: '#f00' } );
|
|
|
} );
|
|
|
|
|
|
+ it( 'should normalize background-color with rgb() value', () => {
|
|
|
+ styles.setTo( 'background-color:rgba(253, 253, 119, 1);' );
|
|
|
+
|
|
|
+ expect( styles.getNormalized( 'background' ) ).to.deep.equal( { color: 'rgba(253, 253, 119, 1)' } );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should output inline background-color style', () => {
|
|
|
styles.setTo( 'background:#f00;' );
|
|
|
|