File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ describe('ModeBar', function() {
29
29
function getMockGraphInfo ( xaxes , yaxes ) {
30
30
return {
31
31
_fullLayout : {
32
+ _uid : '6ea6a7' ,
32
33
dragmode : 'zoom' ,
33
34
_paperdiv : d3 . select ( getMockContainerTree ( ) ) ,
34
35
_has : Plots . _hasPlotType ,
@@ -292,16 +293,19 @@ describe('ModeBar', function() {
292
293
293
294
describe ( 'modeBar.destroy' , function ( ) {
294
295
it ( 'removes the mode bar entirely' , function ( ) {
295
- var modeBarParent = modeBar . element . parentNode ;
296
+ var modeBarParent = modeBar . element . parentNode ,
297
+ gd = getMockGraphInfo ( ) ,
298
+ styleSelector = 'style[id*="modebar-' + gd . _fullLayout . _uid + '"]' ;
296
299
297
- var style = document . querySelector ( 'style[id*="modebar"]' ) ;
300
+
301
+ var style = document . querySelector ( styleSelector ) ;
298
302
expect ( style ) . toBeTruthy ( ) ;
299
303
300
304
modeBar . destroy ( ) ;
301
305
302
306
expect ( modeBarParent . querySelector ( '.modebar' ) ) . toBeNull ( ) ;
303
307
304
- style = document . querySelector ( 'style[id*="modebar"]' ) ;
308
+ style = document . querySelector ( styleSelector ) ;
305
309
expect ( style ) . toBeNull ( ) ;
306
310
} ) ;
307
311
} ) ;
You can’t perform that action at this time.
0 commit comments