@@ -212,12 +212,18 @@ describe('Test gl plot interactions', function() {
212212 } ) ;
213213
214214 describe ( 'gl2d plots' , function ( ) {
215- var mock = require ( '@mocks/gl2d_10.json' ) ;
215+ var mock = require ( '@mocks/gl2d_10.json' ) ,
216+ relayoutCallback ;
216217
217218 beforeEach ( function ( done ) {
218219 gd = createGraphDiv ( ) ;
219220
220221 Plotly . plot ( gd , mock . data , mock . layout ) . then ( function ( ) {
222+
223+ relayoutCallback = jasmine . createSpy ( 'relayoutCallback' ) ;
224+
225+ gd . on ( 'plotly_relayout' , relayoutCallback ) ;
226+
221227 delay ( done ) ;
222228 } ) ;
223229 } ) ;
@@ -226,6 +232,24 @@ describe('Test gl plot interactions', function() {
226232 var nodes = d3 . selectAll ( 'canvas' ) ;
227233 expect ( nodes [ 0 ] . length ) . toEqual ( 1 ) ;
228234 } ) ;
235+
236+ it ( 'should respond to drag interactions' , function ( done ) {
237+
238+ var sceneTarget = gd . querySelector ( '.plot-container .gl-container canvas' ) ;
239+
240+ // Drag scene
241+ sceneTarget . dispatchEvent ( new MouseEvent ( 'mousedown' , { x : 0 , y : 0 } ) ) ;
242+ sceneTarget . dispatchEvent ( new MouseEvent ( 'mousemove' , { x : 100 , y : 100 } ) ) ;
243+ sceneTarget . dispatchEvent ( new MouseEvent ( 'mouseup' , { x : 100 , y : 100 } ) ) ;
244+
245+ setTimeout ( function ( ) {
246+
247+ expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 1 ) ;
248+
249+ done ( ) ;
250+
251+ } , MODEBAR_DELAY ) ;
252+ } ) ;
229253 } ) ;
230254
231255 describe ( 'gl3d event handlers' , function ( ) {
0 commit comments