@@ -1544,33 +1544,6 @@ describe('ModeBar', function() {
15441544 expect ( style . fill ) . toBe ( color ) ;
15451545 }
15461546
1547- function getStyleRule ( ) {
1548- var uid = gd . _fullLayout . _uid ;
1549- var ownerNode = document . getElementById ( 'plotly.js-style-modebar-' + uid ) ;
1550- var styleSheets = document . styleSheets ;
1551- for ( var i = 0 ; i < styleSheets . length ; i ++ ) {
1552- var ss = styleSheets [ i ] ;
1553- if ( ss . ownerNode === ownerNode ) return ss ;
1554- }
1555- }
1556-
1557- it ( 'create an associated style element and destroy it on purge' , function ( done ) {
1558- var styleSelector , style ;
1559- Plotly . newPlot ( gd , [ ] , { } )
1560- . then ( function ( ) {
1561- styleSelector = 'style[id*="modebar-' + gd . _fullLayout . _uid + '"]' ;
1562-
1563- style = document . querySelector ( styleSelector ) ;
1564- expect ( style ) . toBeTruthy ( ) ;
1565- } )
1566- . then ( function ( ) {
1567- Plotly . purge ( gd ) ;
1568- style = document . querySelector ( styleSelector ) ;
1569- expect ( style ) . toBeNull ( ) ;
1570- } )
1571- . then ( done , done . fail ) ;
1572- } ) ;
1573-
15741547 it ( 'changes icon colors' , function ( done ) {
15751548 Plotly . newPlot ( gd , [ ] , { modebar : { color : colors [ 0 ] } } )
15761549 . then ( function ( ) {
@@ -1602,14 +1575,12 @@ describe('ModeBar', function() {
16021575 Plotly . newPlot ( gd , [ ] , { modebar : { bgcolor : colors [ 0 ] } } )
16031576 . then ( function ( ) {
16041577 style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element . querySelector ( '.modebar-group' ) ) ;
1605- expect ( style . backgroundColor ) . toBe ( 'rgba(0, 0, 0, 0)' ) ;
1606- expect ( getStyleRule ( ) . rules [ 3 ] . style . backgroundColor ) . toBe ( colors [ 0 ] ) ;
1578+ expect ( style . backgroundColor ) . toBe ( colors [ 0 ] ) ;
16071579 } )
16081580 . then ( function ( ) { return Plotly . relayout ( gd , 'modebar.bgcolor' , colors [ 1 ] ) ; } )
16091581 . then ( function ( ) {
16101582 style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element . querySelector ( '.modebar-group' ) ) ;
1611- expect ( style . backgroundColor ) . toBe ( 'rgba(0, 0, 0, 0)' ) ;
1612- expect ( getStyleRule ( ) . rules [ 3 ] . style . backgroundColor ) . toBe ( colors [ 1 ] ) ;
1583+ expect ( style . backgroundColor ) . toBe ( colors [ 1 ] ) ;
16131584 } )
16141585 . then ( done , done . fail ) ;
16151586 } ) ;
@@ -1619,13 +1590,11 @@ describe('ModeBar', function() {
16191590 . then ( function ( ) {
16201591 style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element . querySelector ( '.modebar-group' ) ) ;
16211592 expect ( style . backgroundColor ) . toBe ( colors [ 0 ] ) ;
1622- expect ( getStyleRule ( ) . rules [ 3 ] . style . backgroundColor ) . toBe ( colors [ 0 ] ) ;
16231593 } )
16241594 . then ( function ( ) { return Plotly . relayout ( gd , 'modebar.bgcolor' , colors [ 1 ] ) ; } )
16251595 . then ( function ( ) {
16261596 style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element . querySelector ( '.modebar-group' ) ) ;
16271597 expect ( style . backgroundColor ) . toBe ( colors [ 1 ] ) ;
1628- expect ( getStyleRule ( ) . rules [ 3 ] . style . backgroundColor ) . toBe ( colors [ 1 ] ) ;
16291598 } )
16301599 . then ( done , done . fail ) ;
16311600 } ) ;
0 commit comments