@@ -798,4 +798,42 @@ describe('NgHttpLoaderComponent', () => {
798798
799799 expect ( element . style . opacity ) . toBe ( `0${ component . opacity } ` ) ;
800800 } ) ;
801+
802+ it ( 'should have a default backdrop background color if backdrop is true' , ( ) => {
803+ component . isVisible$ = of ( true ) ;
804+ fixture . detectChanges ( ) ;
805+
806+ const element : HTMLElement = fixture
807+ . debugElement
808+ . query ( By . css ( '#spinner' ) )
809+ . nativeElement ;
810+
811+ expect ( element . style . backgroundColor ) . toBe ( 'rgb(241, 241, 241)' ) ;
812+ } ) ;
813+
814+ it ( 'should be possible to override backdrop background color when backdrop is true' , ( ) => {
815+ component . isVisible$ = of ( true ) ;
816+ component . backdropBackgroundColor = '#777777' ;
817+ fixture . detectChanges ( ) ;
818+
819+ const element : HTMLElement = fixture
820+ . debugElement
821+ . query ( By . css ( '#spinner' ) )
822+ . nativeElement ;
823+
824+ expect ( element . style . backgroundColor ) . toBe ( 'rgb(119, 119, 119)' ) ;
825+ } ) ;
826+
827+ it ( 'should not have a transparent backdrop background color if backdrop is false' , ( ) => {
828+ component . isVisible$ = of ( true ) ;
829+ component . backdrop = false ;
830+ fixture . detectChanges ( ) ;
831+
832+ const element : HTMLElement = fixture
833+ . debugElement
834+ . query ( By . css ( '#spinner' ) )
835+ . nativeElement ;
836+
837+ expect ( element . style . backgroundColor ) . toBe ( 'transparent' ) ;
838+ } ) ;
801839} ) ;
0 commit comments