@@ -1544,33 +1544,6 @@ describe('ModeBar', function() {
1544
1544
expect ( style . fill ) . toBe ( color ) ;
1545
1545
}
1546
1546
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
-
1574
1547
it ( 'changes icon colors' , function ( done ) {
1575
1548
Plotly . newPlot ( gd , [ ] , { modebar : { color : colors [ 0 ] } } )
1576
1549
. then ( function ( ) {
@@ -1602,14 +1575,12 @@ describe('ModeBar', function() {
1602
1575
Plotly . newPlot ( gd , [ ] , { modebar : { bgcolor : colors [ 0 ] } } )
1603
1576
. then ( function ( ) {
1604
1577
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 ] ) ;
1607
1579
} )
1608
1580
. then ( function ( ) { return Plotly . relayout ( gd , 'modebar.bgcolor' , colors [ 1 ] ) ; } )
1609
1581
. then ( function ( ) {
1610
1582
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 ] ) ;
1613
1584
} )
1614
1585
. then ( done , done . fail ) ;
1615
1586
} ) ;
@@ -1619,13 +1590,11 @@ describe('ModeBar', function() {
1619
1590
. then ( function ( ) {
1620
1591
style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element . querySelector ( '.modebar-group' ) ) ;
1621
1592
expect ( style . backgroundColor ) . toBe ( colors [ 0 ] ) ;
1622
- expect ( getStyleRule ( ) . rules [ 3 ] . style . backgroundColor ) . toBe ( colors [ 0 ] ) ;
1623
1593
} )
1624
1594
. then ( function ( ) { return Plotly . relayout ( gd , 'modebar.bgcolor' , colors [ 1 ] ) ; } )
1625
1595
. then ( function ( ) {
1626
1596
style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element . querySelector ( '.modebar-group' ) ) ;
1627
1597
expect ( style . backgroundColor ) . toBe ( colors [ 1 ] ) ;
1628
- expect ( getStyleRule ( ) . rules [ 3 ] . style . backgroundColor ) . toBe ( colors [ 1 ] ) ;
1629
1598
} )
1630
1599
. then ( done , done . fail ) ;
1631
1600
} ) ;
0 commit comments