import { CssOptions } from './customCss.interfaces' ; import setCustomCss from './setCustomCss' ; describe ( 'setCustomCss' , ( ) => { it ( 'should be able to set the custom css with the default options' , ( ) => { const cssOptions = { addressBarPadding : 6 , disableCSSAnimation : false , id : 'id' , toolBarPadding : 6 , } ; expect ( document . head . textContent ) . toMatchSnapshot ( ) ; setCustomCss ( cssOptions ) ; expect ( document . head . textContent ) . toMatchSnapshot ( ) ; } ) ; it ( 'should be able to set the custom css with the animations disabled' , ( ) => { const cssOptions = { addressBarPadding : 6 , disableCSSAnimation : true , id : 'id' , toolBarPadding : 6 , } ; expect ( document . head . textContent ) . toMatchSnapshot ( ) ; setCustomCss ( cssOptions ) ; expect ( document . head . textContent ) . toMatchSnapshot ( ) ; } ) ; it ( 'should be able to set the custom css with the with padding set to 0' , ( ) => { const cssOptions = { addressBarPadding : 0 , disableCSSAnimation : true , id : 'id' , toolBarPadding : 0 , } ; expect ( document . head . textContent ) . toMatchSnapshot ( ) ; setCustomCss ( cssOptions ) ; expect ( document . head . textContent ) . toMatchSnapshot ( ) ; } ) ; it ( 'should do nothing if document.head is null' , ( ) => { const cssOptions = { addressBarPadding : 6 , disableCSSAnimation : false , id : 'id' , toolBarPadding : 6 , } ; Object . defineProperty ( document , 'head' , { value : null } ) ; setCustomCss ( cssOptions ) ; expect ( document . head ) . toBe ( null ) ; } ) ; } ) ;