11var Plotly = require ( '@lib/index' ) ;
22var Lib = require ( '@src/lib' ) ;
3+ var Queue = require ( '@src/lib/queue' ) ;
34
45var createGraphDiv = require ( '../assets/create_graph_div' ) ;
56var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
@@ -181,7 +182,7 @@ describe('Test frame api', function() {
181182 expect ( f [ 7 ] ) . toEqual ( { name : 'frame7' , data : [ 2 ] } ) ;
182183 expect ( f [ 10 ] ) . toEqual ( { name : 'frame10' , data : [ 3 ] } ) ;
183184
184- return Plotly . Queue . undo ( gd ) ;
185+ return Queue . undo ( gd ) ;
185186 } )
186187 . then ( validate )
187188 . then ( done , done . fail ) ;
@@ -207,7 +208,7 @@ describe('Test frame api', function() {
207208 expect ( f [ 7 ] ) . toEqual ( { name : 'frame7' , data : [ 2 ] } ) ;
208209 expect ( f [ 10 ] ) . toEqual ( { name : 'frame10' , data : [ 3 ] } ) ;
209210
210- return Plotly . Queue . undo ( gd ) ;
211+ return Queue . undo ( gd ) ;
211212 } )
212213 . then ( validate )
213214 . then ( done , done . fail ) ;
@@ -220,12 +221,12 @@ describe('Test frame api', function() {
220221 }
221222
222223 Plotly . addFrames ( gd , [ { name : 'frame 0' } , { name : 'frame 1' } ] ) . then ( validate ) . then ( function ( ) {
223- return Plotly . Queue . undo ( gd ) ;
224+ return Queue . undo ( gd ) ;
224225 } ) . then ( function ( ) {
225226 expect ( f ) . toEqual ( [ ] ) ;
226227 expect ( h ) . toEqual ( { } ) ;
227228
228- return Plotly . Queue . redo ( gd ) ;
229+ return Queue . redo ( gd ) ;
229230 } )
230231 . then ( validate )
231232 . then ( done , done . fail ) ;
@@ -242,12 +243,12 @@ describe('Test frame api', function() {
242243 expect ( f ) . toEqual ( [ { name : 'test1' } , { name : 'test2' } , { name : 'test3' } ] ) ;
243244 expect ( Object . keys ( h ) ) . toEqual ( [ 'test1' , 'test2' , 'test3' ] ) ;
244245
245- return Plotly . Queue . undo ( gd ) ;
246+ return Queue . undo ( gd ) ;
246247 } ) . then ( function ( ) {
247248 expect ( f ) . toEqual ( [ { name : 'test1' , data : [ 'y' ] } , { name : 'test2' } ] ) ;
248249 expect ( Object . keys ( h ) ) . toEqual ( [ 'test1' , 'test2' ] ) ;
249250
250- return Plotly . Queue . redo ( gd ) ;
251+ return Queue . redo ( gd ) ;
251252 } ) . then ( function ( ) {
252253 expect ( f ) . toEqual ( [ { name : 'test1' } , { name : 'test2' } , { name : 'test3' } ] ) ;
253254 expect ( Object . keys ( h ) ) . toEqual ( [ 'test1' , 'test2' , 'test3' ] ) ;
@@ -267,11 +268,11 @@ describe('Test frame api', function() {
267268 expect ( f ) . toEqual ( [ ] ) ;
268269 expect ( Object . keys ( h ) ) . toEqual ( [ ] ) ;
269270
270- return Plotly . Queue . undo ( gd ) ;
271+ return Queue . undo ( gd ) ;
271272 } ) . then ( function ( ) {
272273 expect ( f ) . toEqual ( [ { name : 'frame1' } ] ) ;
273274
274- return Plotly . Queue . redo ( gd ) ;
275+ return Queue . redo ( gd ) ;
275276 } ) . then ( function ( ) {
276277 expect ( f ) . toEqual ( [ ] ) ;
277278 expect ( Object . keys ( h ) ) . toEqual ( [ ] ) ;
@@ -297,13 +298,13 @@ describe('Test frame api', function() {
297298 Plotly . addFrames ( gd , frames ) . then ( function ( ) {
298299 return Plotly . deleteFrames ( gd , [ 2 , 8 , 4 , 6 ] ) ;
299300 } ) . then ( validate ) . then ( function ( ) {
300- return Plotly . Queue . undo ( gd ) ;
301+ return Queue . undo ( gd ) ;
301302 } ) . then ( function ( ) {
302303 for ( i = 0 ; i < 10 ; i ++ ) {
303304 expect ( f [ i ] ) . toEqual ( { name : 'frame' + i } ) ;
304305 }
305306
306- return Plotly . Queue . redo ( gd ) ;
307+ return Queue . redo ( gd ) ;
307308 } )
308309 . then ( validate )
309310 . then ( done , done . fail ) ;
@@ -328,13 +329,13 @@ describe('Test frame api', function() {
328329 return Plotly . deleteFrames ( gd ) ;
329330 } ) . then ( validateCount ( 0 ) ) . then ( function ( ) {
330331 // Restore:
331- return Plotly . Queue . undo ( gd ) ;
332+ return Queue . undo ( gd ) ;
332333 } ) . then ( validateCount ( n ) ) . then ( function ( ) {
333334 // Delete with null arg:
334335 return Plotly . deleteFrames ( gd , null ) ;
335336 } ) . then ( validateCount ( 0 ) ) . then ( function ( ) {
336337 // Restore:
337- return Plotly . Queue . undo ( gd ) ;
338+ return Queue . undo ( gd ) ;
338339 } ) . then ( validateCount ( n ) ) . then ( function ( ) {
339340 // Delete with undefined:
340341 return Plotly . deleteFrames ( gd , undefined ) ;
0 commit comments