@@ -408,6 +408,19 @@ describe('Test Plots', function() {
408408 beforeEach ( function ( done ) {
409409 gd = createGraphDiv ( ) ;
410410 Plotly . plot ( gd , [ { x : [ 1 , 2 , 3 ] , y : [ 2 , 3 , 4 ] } ] , { } ) . then ( done ) ;
411+
412+ // hacky: simulate getting stuck with these flags due to an error
413+ // see #2055 and commit 6a44a9a - before fixing that error, we would
414+ // end up in an inconsistent state that prevented future Plotly.newPlot
415+ // because _dragging and _dragged were not cleared by purge.
416+ gd . _dragging = true ;
417+ gd . _dragged = true ;
418+ gd . _hoverdata = true ;
419+ gd . _snapshotInProgress = true ;
420+ gd . _editing = true ;
421+ gd . _replotPending = true ;
422+ gd . _mouseDownTime = true ;
423+ gd . _legendMouseDownTime = true ;
411424 } ) ;
412425
413426 afterEach ( destroyGraphDiv ) ;
@@ -416,15 +429,16 @@ describe('Test Plots', function() {
416429 var expectedKeys = [
417430 '_ev' , '_internalEv' , 'on' , 'once' , 'removeListener' , 'removeAllListeners' ,
418431 '_internalOn' , '_internalOnce' , '_removeInternalListener' ,
419- '_removeAllInternalListeners' , 'emit' , '_context' , '_replotPending' ,
420- '_hmpixcount' , '_hmlumcount' , '_mouseDownTime' , '_legendMouseDownTime' ,
432+ '_removeAllInternalListeners' , 'emit' , '_context'
421433 ] ;
422434
423435 var expectedUndefined = [
424436 'data' , 'layout' , '_fullData' , '_fullLayout' , 'calcdata' , 'framework' ,
425437 'empty' , 'fid' , 'undoqueue' , 'undonum' , 'autoplay' , 'changed' ,
426- '_promises' , '_redrawTimer' , 'firstscatter' , 'hmlumcount' , 'hmpixcount' ,
427- 'numboxes' , '_transitionData' , '_transitioning'
438+ '_promises' , '_redrawTimer' , 'firstscatter' , 'numboxes' ,
439+ '_transitionData' , '_transitioning' , '_hmpixcount' , '_hmlumcount' ,
440+ '_dragging' , '_dragged' , '_hoverdata' , '_snapshotInProgress' , '_editing' ,
441+ '_replotPending' , '_mouseDownTime' , '_legendMouseDownTime'
428442 ] ;
429443
430444 Plots . purge ( gd ) ;
0 commit comments