1
1
var Plotly = require ( '@lib/index' ) ;
2
2
var Lib = require ( '@src/lib' ) ;
3
+ var Queue = require ( '@src/lib/queue' ) ;
3
4
4
5
var createGraphDiv = require ( '../assets/create_graph_div' ) ;
5
6
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
@@ -181,7 +182,7 @@ describe('Test frame api', function() {
181
182
expect ( f [ 7 ] ) . toEqual ( { name : 'frame7' , data : [ 2 ] } ) ;
182
183
expect ( f [ 10 ] ) . toEqual ( { name : 'frame10' , data : [ 3 ] } ) ;
183
184
184
- return Plotly . Queue . undo ( gd ) ;
185
+ return Queue . undo ( gd ) ;
185
186
} )
186
187
. then ( validate )
187
188
. then ( done , done . fail ) ;
@@ -207,7 +208,7 @@ describe('Test frame api', function() {
207
208
expect ( f [ 7 ] ) . toEqual ( { name : 'frame7' , data : [ 2 ] } ) ;
208
209
expect ( f [ 10 ] ) . toEqual ( { name : 'frame10' , data : [ 3 ] } ) ;
209
210
210
- return Plotly . Queue . undo ( gd ) ;
211
+ return Queue . undo ( gd ) ;
211
212
} )
212
213
. then ( validate )
213
214
. then ( done , done . fail ) ;
@@ -220,12 +221,12 @@ describe('Test frame api', function() {
220
221
}
221
222
222
223
Plotly . addFrames ( gd , [ { name : 'frame 0' } , { name : 'frame 1' } ] ) . then ( validate ) . then ( function ( ) {
223
- return Plotly . Queue . undo ( gd ) ;
224
+ return Queue . undo ( gd ) ;
224
225
} ) . then ( function ( ) {
225
226
expect ( f ) . toEqual ( [ ] ) ;
226
227
expect ( h ) . toEqual ( { } ) ;
227
228
228
- return Plotly . Queue . redo ( gd ) ;
229
+ return Queue . redo ( gd ) ;
229
230
} )
230
231
. then ( validate )
231
232
. then ( done , done . fail ) ;
@@ -242,12 +243,12 @@ describe('Test frame api', function() {
242
243
expect ( f ) . toEqual ( [ { name : 'test1' } , { name : 'test2' } , { name : 'test3' } ] ) ;
243
244
expect ( Object . keys ( h ) ) . toEqual ( [ 'test1' , 'test2' , 'test3' ] ) ;
244
245
245
- return Plotly . Queue . undo ( gd ) ;
246
+ return Queue . undo ( gd ) ;
246
247
} ) . then ( function ( ) {
247
248
expect ( f ) . toEqual ( [ { name : 'test1' , data : [ 'y' ] } , { name : 'test2' } ] ) ;
248
249
expect ( Object . keys ( h ) ) . toEqual ( [ 'test1' , 'test2' ] ) ;
249
250
250
- return Plotly . Queue . redo ( gd ) ;
251
+ return Queue . redo ( gd ) ;
251
252
} ) . then ( function ( ) {
252
253
expect ( f ) . toEqual ( [ { name : 'test1' } , { name : 'test2' } , { name : 'test3' } ] ) ;
253
254
expect ( Object . keys ( h ) ) . toEqual ( [ 'test1' , 'test2' , 'test3' ] ) ;
@@ -267,11 +268,11 @@ describe('Test frame api', function() {
267
268
expect ( f ) . toEqual ( [ ] ) ;
268
269
expect ( Object . keys ( h ) ) . toEqual ( [ ] ) ;
269
270
270
- return Plotly . Queue . undo ( gd ) ;
271
+ return Queue . undo ( gd ) ;
271
272
} ) . then ( function ( ) {
272
273
expect ( f ) . toEqual ( [ { name : 'frame1' } ] ) ;
273
274
274
- return Plotly . Queue . redo ( gd ) ;
275
+ return Queue . redo ( gd ) ;
275
276
} ) . then ( function ( ) {
276
277
expect ( f ) . toEqual ( [ ] ) ;
277
278
expect ( Object . keys ( h ) ) . toEqual ( [ ] ) ;
@@ -297,13 +298,13 @@ describe('Test frame api', function() {
297
298
Plotly . addFrames ( gd , frames ) . then ( function ( ) {
298
299
return Plotly . deleteFrames ( gd , [ 2 , 8 , 4 , 6 ] ) ;
299
300
} ) . then ( validate ) . then ( function ( ) {
300
- return Plotly . Queue . undo ( gd ) ;
301
+ return Queue . undo ( gd ) ;
301
302
} ) . then ( function ( ) {
302
303
for ( i = 0 ; i < 10 ; i ++ ) {
303
304
expect ( f [ i ] ) . toEqual ( { name : 'frame' + i } ) ;
304
305
}
305
306
306
- return Plotly . Queue . redo ( gd ) ;
307
+ return Queue . redo ( gd ) ;
307
308
} )
308
309
. then ( validate )
309
310
. then ( done , done . fail ) ;
@@ -328,13 +329,13 @@ describe('Test frame api', function() {
328
329
return Plotly . deleteFrames ( gd ) ;
329
330
} ) . then ( validateCount ( 0 ) ) . then ( function ( ) {
330
331
// Restore:
331
- return Plotly . Queue . undo ( gd ) ;
332
+ return Queue . undo ( gd ) ;
332
333
} ) . then ( validateCount ( n ) ) . then ( function ( ) {
333
334
// Delete with null arg:
334
335
return Plotly . deleteFrames ( gd , null ) ;
335
336
} ) . then ( validateCount ( 0 ) ) . then ( function ( ) {
336
337
// Restore:
337
- return Plotly . Queue . undo ( gd ) ;
338
+ return Queue . undo ( gd ) ;
338
339
} ) . then ( validateCount ( n ) ) . then ( function ( ) {
339
340
// Delete with undefined:
340
341
return Plotly . deleteFrames ( gd , undefined ) ;
0 commit comments